zverok / spylls

Pure Python spell-checker, (almost) full port of Hunspell
https://spylls.readthedocs.io
Mozilla Public License 2.0
284 stars 21 forks source link

Question: Does hunspell/spylls have facility to change the root of the word? #24

Open exander77 opened 2 years ago

exander77 commented 2 years ago

Does hunspell/spylls have facility to change the root of the word when making word forms?

I am looking through cs_CZ and a lot of words are directly written there in all forms.

Like stůl (table):

stole
stolech
stolem
stoletím
stolu
stolů
stolům
stoly
stůl

Which seems highly inefficient to me. But it may be that there is no facility to implement character transform as ů is becoming o. Or is there something in hunspell format that can handle this?

Basically, every male gender word with ů gets transformed like this into o form. And there are several transformations like these in Czech language.

zverok commented 2 years ago

There is no way in Hunspell to declare explicitly "root of the word has to change", but it can be imitated to some extent by declaring that stůl root has suffixes ole, olech, ..., that also, when applied to the root, remove ůl from its end. This is wrong from a morphological structure point of view, but Hunspell actually hardly tries to correspond to how the real language morphology works, it just named some of its features "prefix" and "suffix", but they rarely correspond to what linguists would call that :shrug: