我想更正法语文本中拼写错误的单词,似乎 spacy 是最准确、最快速的软件包,但它很复杂,我尝试使用 textblob,但我没有设法用法语单词完成
它在英语中完美运行,但是当我尝试用法语做同样的事情时,我得到了相同的拼写错误
#english words
from textblob import TextBlob
misspelled=["hapenning", "mornin", "windoow", "jaket"]
[str(TextBlob(word).correct()) for word in misspelled]
#french words
misspelled2=["resaissir", "matinnée", "plonbier", "tecnicien"]
[str(TextBlob(word).correct()) for word in misspelled2]
Run Code Online (Sandbox Code Playgroud)
我明白了:
英语:['发生','早上','窗口','夹克']
法语:['resaissir'、'matinnée'、'plonbier'、'tecnicien']