You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For this simple query in Spanish, with empty stopwords (or with stopwords; it doesn't matter):
rake.generate("Cuantos años tienes?", {stopwords: []})
I get the error:
TypeError: Cannot read property 'forEach' of null
at phraseList.forEach
at Array.forEach
at Rake.calculatePhraseScores
If I omit the stopwords, then there is no error, but the word "años" is incorrectly split up:
rake.generate("Cuantos años tienes?")
=> [ 'ños tienes', 'Cuantos' ]
I think the code is treating the ñ as a word-break character, leading to the word being split in the second example, and leading to the single character ñ being used as a whole phrase in the function calculatePhraseScores, which leads to the error in the first example. The wordList regex seems to be looking only for 0-9a-z as acceptable word characters, which will be incomplete.
The text was updated successfully, but these errors were encountered:
For this simple query in Spanish, with empty stopwords (or with stopwords; it doesn't matter):
I get the error:
If I omit the stopwords, then there is no error, but the word "años" is incorrectly split up:
I think the code is treating the
ñ
as a word-break character, leading to the word being split in the second example, and leading to the single characterñ
being used as a whole phrase in the functioncalculatePhraseScores
, which leads to the error in the first example. ThewordList
regex seems to be looking only for0-9a-z
as acceptable word characters, which will be incomplete.The text was updated successfully, but these errors were encountered: