Skip to content

Commit c77e1cf

Browse files
committed
Fix incorrectly flipped Boolean value passed to wordSequence.addWord
1 parent 566da99 commit c77e1cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/nlp/Segmentation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ export async function splitToWords(text: string, langCode: string): Promise<Text
9999
for (const wordText of wordArray) {
100100
const startOffset = offset
101101
const endOffset = startOffset + wordText.length
102-
const isNonPunctuation = isWordOrSymbolWord(wordText)
102+
const isPunctuation = !isWordOrSymbolWord(wordText)
103103

104-
wordSequence.addWord(wordText, startOffset, isNonPunctuation)
104+
wordSequence.addWord(wordText, startOffset, isPunctuation)
105105

106106
offset = endOffset
107107
}

0 commit comments

Comments
 (0)