Python – Spelling checker using Enchant

Enchant is a module in Python which is used to check the spelling of a word, gives suggestions to correct words. Also, gives antonym and synonym of words. It checks whether a word exists in dictionary or not.

Enchant can also be used to check spelling of words. The check() method returns True if the passed word is present in the language dictionary, else it returns False. This functionality of the check() method can be used to spell check words.

The suggest() method is used to suggest the correct spelling of the incorrectly spelled word.





# import the enchant module
import enchant
# create dictionary for the language
# in use(en_US here)
dict = enchant.Dict("en_US")
# list of words
words = ["cmputr", "watr", "study", "wrte"]
# find those words that may be misspelled 
misspelled =[]
for word in words:
    if dict.check(word) == False:
print("The misspelled words are : " + str(misspelled))
# suggest the correct spelling of
# the missplelled words
for word in misspelled:
    print("Suggestion for " + word + " : " + str(dict.suggest(word)))


Output :

The misspelled words are : ['cmputr', 'watr', 'wrte']
Suggestion for cmputr : ['computer']
Suggestion for watr : ['wart', 'watt', 'wat', 'war', 'water', 'wat r']
Suggestion for wrte : ['rte', 'write', 'wrote', 'wert', 'wite', 'w rte']

Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.