Search code examples
c#c++nlpspell-checkinghunspell

Max edit distance and suggestion based on word frequency


I need a spell checker with the following specification:

  • Very scalable.
  • To be able to set a maximum edit distance for the suggested words.
  • To get suggestion based on provided words frequencies (most common word first).

I took a look at Hunspell:
I found the parameter MAXDIFF in the man but doesn't seem to work as expected. Maybe I'm using it the wrong way

file t.aff:

MAXDIFF 1 

file dico.dic:

5  
rouge  
vert  
bleu  
bleue  
orange  

-

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

returns the same thing t.aff being empty or not:

bleue
bleu

Solution

  • We decided to use Apache Solr, which exactly fulfills our needs.
    http://wiki.apache.org/solr/SpellCheckComponent#spellcheck