Skip to content

Commit

Permalink
Syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo-ter-Doest committed Aug 9, 2024
1 parent 6219419 commit 887d627
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/tokenizer/testSentenceTokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ Experts believe that with continued global cooperation and investment, renewable
Stay tuned for more updates on this developing story.`

const result = tokenizer.tokenize(testData)
console.log(result)
console.log(result)
2 changes: 1 addition & 1 deletion lib/natural/tokenizers/sentence_tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SentenceTokenizer extends Tokenizer {
// Regular expression for sentence delimiters optionally followed by a bracket or quote
// Multiple delimiters with spaces in between are allowed
// The expression makes sure that the sentence delimiter group ends with a sentence delimiter
const delimiterPattern = /([.?!… ]*)([.?!…])(["'”’)}\]]?)/g;
const delimiterPattern = /([.?!… ]*)([.?!…])(["'”’)}\]]?)/g
const modifiedText = text.replace(delimiterPattern, (match, p1, p2, p3) => {
const placeholder = generateUniqueCode(DELIM, this.replacementCounter++)
this.delimiterMap.set(placeholder, p1 + p2 + p3)
Expand Down

0 comments on commit 887d627

Please sign in to comment.