cfinke / Typo.js

A client-side JavaScript spellchecker that uses Hunspell-style dictionaries.
Other
501 stars 110 forks source link

problematic replacementTable suggest behaviour #46

Open kofifus opened 8 years ago

kofifus commented 8 years ago

In the current implementation, when a suggestion match is found with the replacement table, the search stops, see https://github.com/cfinke/Typo.js/blob/master/typo/typo.js#L767

This is problematic as more matches are possible.

An example is the word 'bere', the current implementation finds a match in replacementTable[18] -> replacementEntry = ["ere", "ear"] adds the match 'bear' and exits

Many other matches (ie 'bare' or 'beer') are not given, the correct behavior should be to continue searching.

This is fixed in https://github.com/cfinke/Typo.js/pull/45