morfologik / morfologik-stemming

Tools for finite state automata construction and dictionary-based morphological dictionaries. Includes Polish stemming dictionary.
BSD 3-Clause "New" or "Revised" License
186 stars 44 forks source link

replacement-pairs fail at end of word #91

Closed danielnaber closed 6 years ago

danielnaber commented 7 years ago

It seems replacement pairs, at least when of different length, fail at the end of a word. E.g. "Fux" doesn't suggest "Fuchs" even with fsa.dict.speller.replacement-pairs=x chs. Adding two more characters at the end of the word makes it work (i.e. Fuxee suggests Fuchsee, both are fantasy words).

I've added a stand-alone example here in LanguageTool: https://github.com/languagetool-org/languagetool/blob/6d38df7eda58bfc6b796d91e35fc7debda57f7d5/languagetool-language-modules/de/src/test/java/org/languagetool/rules/de/GermanSpellerRuleTest.java#L369

Maybe this is related to this comment. If this is actually a bug and won't be fixed, it should be documented.

jaumeortola commented 7 years ago

It is probably related to the previous bug you mention. I will take a look, but I foresee it will be difficult to fix.

jaumeortola commented 7 years ago

This fixes the problem. There is no reason not to try replacements in short words.

dweiss commented 6 years ago

(Released the fix in 2.1.4)