Rajesh Patnaik
Rajesh Patnaik

Reputation: 35

Why is pyspellchecker returning the same word for both the unknown/misspelled word and its correction?

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?

Upvotes: 0

Views: 308

Answers (0)

Related Questions