org.apache.lucene.search
public final class FuzzyTermEnum extends FilteredTermEnum
Term enumerations are always ordered by Term.compareTo(). Each term in the enumeration is greater than all that precede it.
| Constructor Summary | |
|---|---|
| FuzzyTermEnum(IndexReader reader, Term term)
Empty prefix and minSimilarity of 0.5f are used.
| |
| FuzzyTermEnum(IndexReader reader, Term term, float minSimilarity)
This is the standard FuzzyTermEnum with an empty prefix.
| |
| FuzzyTermEnum(IndexReader reader, Term term, float minSimilarity, int prefixLength)
Constructor for enumeration of all terms from specified reader which share a prefix of
length prefixLength with term and which have a fuzzy similarity >
minSimilarity.
| |
| Method Summary | |
|---|---|
| void | close() |
| protected float | difference() |
| boolean | endEnum() |
| protected boolean | termCompare(Term term)
The termCompare method in FuzzyTermEnum uses Levenshtein distance to
calculate the distance between the given term and the comparing term. |
Parameters: reader term
Throws: IOException
See Also: FuzzyTermEnum
Parameters: reader term minSimilarity
Throws: IOException
See Also: FuzzyTermEnum
reader which share a prefix of
length prefixLength with term and which have a fuzzy similarity >
minSimilarity.
Parameters: reader Delivers terms. term Pattern term. minSimilarity Minimum required similarity for terms from the reader. Default value is 0.5f. prefixLength Length of required common prefix. Default value is 0.
Throws: IOException