【发布时间】:2020-03-09 20:20:31
【问题描述】:
我尝试在 Python 中使用 pyspellchecker 设置自动更正。一般来说,它确实有效,但它目前也拆分 URL,这并不是真正需要的。代码如下:
from spellchecker import SpellChecker
spell = SpellChecker()
words = spell.split_words("This is my URL https://test.com")
test = [spell.correction(word) for word in words]
这会导致以下结果: ['this', 'is', 'my', 'URL', 'steps', 'test', 'com']
我要如何更改所有 URL 都不会自动更正?
【问题讨论】:
标签: python spell-checking autocorrect