Yomguithereal / talisman

Straightforward fuzzy matching, information retrieval and NLP building blocks for JavaScript.
https://yomguithereal.github.io/talisman/
MIT License
704 stars 47 forks source link

phonetics/french/sonnex check for undefined #144

Closed emmanuelvlad closed 4 years ago

emmanuelvlad commented 6 years ago

Line 266: - while (current.length) { + while (current && current.length) {

Becomes undefined when having us at the end of a word TypeError: Cannot read property 'length' of undefined

Yomguithereal commented 6 years ago

Hello @EmmanuelVlad. Thanks for noticing this. The original line in non-transpiled source is line 484. Your solution does not fix the issue though. Try 'Jesus' for instance. Do you want to try & fix the issue then open a PR or do you want me to fix it?

emmanuelvlad commented 6 years ago

Sorry I didn't see your reply, I don't have much time to figure out why it doesn't work

tuzepoito commented 4 years ago

Hello, Thanks for porting the Sonnex algorithm to JavaScript. However, as of April 2020 the issue with us syllable still persists. Any news?

tuzepoito commented 4 years ago

In the end I could manage a fix, you can find my pull request above. There is still an issue with words ending with -us, with a non-silent "s". Such as "bus" and its derivatives : "abribus", "autobus". Or words derived from Latin such as "malus". And right now this makes "plus" rhyme with "plu" at all times. Now, all this is outside the scope of this issue.

Yomguithereal commented 4 years ago

Yes handling latin name is somewhat difficult as only a dictionary approach would work unfortunately.