Answers for "python search text corrector"

1

python search text corrector

#pip install pyspellchecker
from spellchecker import SpellChecker

spell = SpellChecker()

# find those words that may be misspelled
misspelled = spell.unknown(['something', 'is', 'hapenning', 'here'])

for word in misspelled:
    # Get the one `most likely` answer
    print(spell.correction(word))

    # Get a list of `likely` options
    print(spell.candidates(word))
Posted by: Guest on April-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language