hunspell / hunspell

The most popular spellchecking library.
http://hunspell.github.io/
GNU Lesser General Public License v2.1
2.11k stars 235 forks source link

Words compounded with COMPOUNDRULE feature not getting suggested if misspelled by more then one character #368

Open ghost opened 8 years ago

ghost commented 8 years ago

Hunspell is not very good at suggesting correct word form if word is compounded using COMPOUNDRULE feature.

For example: if word 'četiristosedamdesetosmoga' is written in dic file, Hunspell can suggest right word form even if user misspell two or three letters.

But if it's compounded with COMPOUNDRULE, you can fault only one letter, and it's more likely that user will misspell such big word by more then one letter.

Consider this in aff file:

COMPOUNDMIN 1 COMPOUNDRULE 1 COMPOUNDRULE (AA)(AB)(AC)(AD)(AE)

četiri/AA sto/AB sedam/AC deset/AD osmoga/AE

Now, when you misspell this word by more then one character, Hunspell will count characters in misspelled word and look for closest word of the same length which is written directly in dic file. So you get completely different word which length is 25 characters (or which ever word is closest to that).

Think that compounded word should be treated the same as they were written directly in dic file, considering wiled cards. It's bad for user if he/she misspells word X and suggestion is word Z.

changwoo commented 7 years ago

Not just COMPOUNDRULE feature, but compounds with the other compound features (COMPOUNDFLAG, COMPOUDN{BEGIN,MIDDLE,END} also have the same problem.