我对自动更正模块有问题,尤其是函数拼写(word): 这是我用的课
class SpellCorrector(PreprocessModule):
def process(self, text):
result = ""
for word in text.split():
result = result + spell(word) + " "
return result
测试是:
^{pr2}$输出是:
"Eh Thia ia a beautiful dau"
所以,它似乎不太好用,而且速度非常慢。在
对于使用过Python中的“autocorrect”模块的人来说,这是正常的吗?我忘了什么吗?对其他的拼写检查有什么建议吗?在
提前谢谢
我建议使用Peter Novig's拼写更正。它使用
Probability Theory
下面的代码首先检查它是否是一个英语单词。如果不是的话,就用彼得算法的修正方法
相关问题 更多 >
编程相关推荐