FileDocCategorySizeDatePackage
SuggestWord.javaAPI DocApache Lucene 1.91451Mon Feb 20 09:18:32 GMT 2006org.apache.lucene.search.spell

SuggestWord

public final class SuggestWord extends Object
SuggestWord Class, used in suggestSimilar method in SpellChecker class.
author
Nicolas Maisonneuve

Fields Summary
public float
score
the score of the word
public int
freq
The freq of the word
public String
string
the suggested word
Constructors Summary
Methods Summary
public final intcompareTo(org.apache.lucene.search.spell.SuggestWord a)

        //first criteria: the edit distance
        if (score>a.score) {
            return 1;
        }
        if (score<a.score) {
            return-1;
        }

        //second criteria (if first criteria is equal): the popularity
        if (freq>a.freq) {
            return 1;
        }

        if (freq<a.freq) {
            return-1;
        }

        return 0;