擅长:python、mysql、java
<p>这个问题是关于hunspell而不是spacy或spacy\u hunspell。你知道吗</p>
<p>我认为这是一个编码问题,尽管在您的所有测试用例中可能都不是这样。我不确定您是如何找到这些葡萄牙语词典的,但它们不在UTF-8中,也不是当前/标准的hunspell pt\u pt库,这些库来自LibreOffice:</p>
<p><a href="https://github.com/LibreOffice/dictionaries/tree/master/pt_PT" rel="nofollow noreferrer">https://github.com/LibreOffice/dictionaries/tree/master/pt_PT</a></p>
<p>这些是debian/ubuntu安装的葡萄牙语词典,如果您安装包<code>hunspell-pt-pt</code>(例如,使用<code>apt-get install hunspell-pt-pt</code>),它们在上面的测试用例中具有正确的行为,无论是命令行上的hunspell还是上面代码中的pyhunspell。你知道吗</p>