I need to clean the misspelling words in a query like "eat an appple", "eat an bannnna". I have tried the autocorrect function but it only works for single words.
from autocorrect import spell
spell("appple")
it returns the correct word "apple". However, for the whole sentence, it does not work.
I wonder if there is any easier way to automatically correct the misspelling words in a sentence without writing a loop.
autocorrectpackage, you'll need to do some kind of iteration over the words in the sentence.