【发布时间】:2016-11-06 08:35:33
【问题描述】:
我的自动更正模块有问题,尤其是功能 spell(word): 这是我使用的类
class SpellCorrector(PreprocessModule):
def process(self, text):
result = ""
for word in text.split():
result = result + spell(word) + " "
return result
测试是:
st = "Ehi thia ia a beautiful dau"
for w in st.split():
print(spellCorrector.process(w))
输出是:
"Eh Thia ia a beautiful dau"
所以,它似乎运行得不是很好,而且速度非常慢。
对于那些在 Python 中使用过“自动更正”模块的人来说,这是正常的吗?我是不是忘记了什么?对其他拼写检查器有什么建议吗?
提前致谢
【问题讨论】:
-
你想从中得到什么输出?
标签: python spell-checking autocorrect