Skip to content

Instantly share code, notes, and snippets.

@nikhilcheke
Created October 8, 2020 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilcheke/f277cd38bde0360952fa910f40918479 to your computer and use it in GitHub Desktop.
Save nikhilcheke/f277cd38bde0360952fa910f40918479 to your computer and use it in GitHub Desktop.
Sample spell corrector using pyspellchecker
from spellchecker import SpellChecker
spell = SpellChecker()
# find those words that may be misspelled
misspelled = spell.unknown(['this', 'is', 'pythen', 'code'])
for word in misspelled:
print("Misspelled word: "+word+"\nCorrected word: "+spell.correction(word))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment