拼写修正
这个很棒的脚本将帮助你纠正你的文本单词拼写错误。你可以在下面找到脚本,将告诉你如何修复句子中的单个单词或多个单词。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
from textblob import *
def fix_paragraph_words(paragraph): sentence = TextBlob(paragraph) correction = sentence.correct() print(correction)
def fix_word_spell(word): word = Word(word) correction = word.correct() print(correction) fix_paragraph_words("This is sammple tet!!") fix_word_spell("maangoo")
|