from enchant import DictWithPWL
from enchant.checker import SpellChecker
my_dict = DictWithPWL("en_US", "mywords.txt")
my_checker = SpellChecker(my_dict)
my_checker.set_text("This is sme sample txt with erors.")
for error in my_checker:
print "ERROR:", error.word
拼写检查器初始值设定项的第一个参数既可以是语言的名称,也可以是附魔词典:
文档对此并不清楚,但是the code is available:)
相关问题 更多 >
编程相关推荐