mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 06:22:45 -08:00
fix nplusone min sentence count
This commit is contained in:
@@ -247,7 +247,10 @@ export function isNPlusOneCandidateToken(token: MergedToken): boolean {
|
||||
if (token.isKnown) {
|
||||
return false;
|
||||
}
|
||||
return isNPlusOneWordCountToken(token);
|
||||
}
|
||||
|
||||
function isNPlusOneWordCountToken(token: MergedToken): boolean {
|
||||
if (token.partOfSpeech === PartOfSpeech.particle) {
|
||||
return false;
|
||||
}
|
||||
@@ -308,7 +311,7 @@ export function markNPlusOneTargets(tokens: MergedToken[], minSentenceWords = 3)
|
||||
for (let i = start; i < endExclusive; i++) {
|
||||
const token = markedTokens[i];
|
||||
if (!token) continue;
|
||||
if (!isSentenceBoundaryToken(token) && token.surface.trim().length > 0) {
|
||||
if (isNPlusOneWordCountToken(token)) {
|
||||
sentenceWordCount += 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user