最大编辑距离和基于词频的建议

log*_*og0 9 c# c++ nlp spell-checking hunspell

我需要一个符合以下规范的拼写检查器:

  • 非常可扩展.
  • 能够为建议的单词设置最大编辑距离.
  • 根据提供的单词频率(最常见的单词首先)获得建议.

我接过一看的hunspell:
我发现参数MAXDIFF的人,但似乎并没有像预期的那样工作.也许我用错了方法

文件t.aff:

MAXDIFF 1 
Run Code Online (Sandbox Code Playgroud)

文件dico.dic:

5  
rouge  
vert  
bleu  
bleue  
orange  
Run Code Online (Sandbox Code Playgroud)

-

NHunspell.Hunspell h = new NHunspell.Hunspell("t.aff", "dico.dic");
List<string> s = h.Suggest("bleuue");
Run Code Online (Sandbox Code Playgroud)

返回相同的东西t.aff是否为空:

bleue
bleu
Run Code Online (Sandbox Code Playgroud)

log*_*og0 3

我们决定使用Apache Solr,它完全满足我们的需求。
http://wiki.apache.org/solr/SpellCheckComponent#spellcheck