Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 526
log0 Avatar asked May 02 '11 13:05

log0


1 Answers

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

like image 103
log0 Avatar answered Sep 29 '22 19:09

log0