FileDocCategorySizeDatePackage
SuggestWord.javaAPI DocApache Lucene 2.1.01538Wed Feb 14 10:46:24 GMT 2007org.apache.lucene.search.spell

SuggestWord

public final class SuggestWord extends Object
SuggestWord, 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;