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

With Korean dictionary, I got random results #28

Open hyunwoongko opened 7 months ago

hyunwoongko commented 7 months ago

you can get dictionary here. https://github.com/spellcheck-ko/hunspell-dict-ko/releases/download/0.7.94/ko-aff-dic-0.7.94.zip

I changed name of dictionary to 'ko_KR' from 'ko'.

from spylls.hunspell import Dictionary

dic = Dictionary.from_files('ko_KR')
word = "가방"
print(dic.lookup(word))    

This code returns True sometimes, and it also returns False sometimes. Please run this code 20 times, then you can see same results with me. I don't understand why this happens. Thanks.

zverok commented 7 months ago

That’s interesting. For now, I have no consistent theory why it could be stochastic, there are very few possibilities of randomness inside the code :thinking: But as I know very little about the Korean writing systems/encoding, might be related to it somehow.

A couple of questions to try to understand that: