I am using pyspellchecker for finding wrong words. It is picking a few words as misspelled. But it suggests the same word as the correction.
Why is it doing so? Am I missing anything?
Example:
from spellchecker import SpellChecker
spell = SpellChecker()
list = ["BERHAMPUR", "berhampur", "SAHEBPARA"]
misspelled = spell.unknown(list)
print(misspelled)
for word in misspelled:
print(spell.correction(word))
It returns as follows:
> {'sahebpara', 'berhampur'}
>
> sahebpara berhampur
Why is misspelled
and the suggested correction for each word the same?
.correction
just returns the same word if it did not find any suitable candidates.pyshellchecker
uses an internal dictionary to look up words. These dictionaries are limited, so place names located in India won't be in these dictionaries. Additionally your code is checking the English dictionary. And there is not a dictionary for and Indian languages withinpyshellchecker