mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 06:22:44 -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) {
|
if (token.isKnown) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
return isNPlusOneWordCountToken(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isNPlusOneWordCountToken(token: MergedToken): boolean {
|
||||||
if (token.partOfSpeech === PartOfSpeech.particle) {
|
if (token.partOfSpeech === PartOfSpeech.particle) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -308,7 +311,7 @@ export function markNPlusOneTargets(tokens: MergedToken[], minSentenceWords = 3)
|
|||||||
for (let i = start; i < endExclusive; i++) {
|
for (let i = start; i < endExclusive; i++) {
|
||||||
const token = markedTokens[i];
|
const token = markedTokens[i];
|
||||||
if (!token) continue;
|
if (!token) continue;
|
||||||
if (!isSentenceBoundaryToken(token) && token.surface.trim().length > 0) {
|
if (isNPlusOneWordCountToken(token)) {
|
||||||
sentenceWordCount += 1;
|
sentenceWordCount += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user