I was trying all of the functions in pyenchant
and when I tried store_replacement
, it didn't work for me and I have no idea why. Here's my code:
d = enchant.Dict('en_us')
d.check('alllow')
Out[1]: False
d.suggest('alllow')`
Out[2]: ['allow',
'all low',
'all-low',
'wallop',
'allot',
'alloy',
'Willow',
'allele',
'allover']
d.store_replacement('alllow', 'alloy')`
d.suggest('alllow')`
Out[3]: ['allow',
'all low',
'all-low',
'wallop',
'allot',
'alloy',
'Willow',
'allele',
'allover']
According to the docs from pyenchant:
store_replacement(mis, cor)
:
Store a replacement spelling for a miss-spelled word. This method makes a suggestion to the spellchecking engine that the miss-spelled word is in fact correctly spelled as cor. Such a suggestion will typically mean that cor appears early in the list of suggested spellings offered for later instances of mis.
As you see it doesn't bring forward my suggestion. The suggestion list is exactly the same. If I try to do the same thing but with a word that doesn't exists in the suggestion list I get the same.
I don't understand what I'm doing wrong. I appreciate any help. Thanks!