|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.TermEnum org.apache.lucene.search.FilteredTermEnum org.apache.lucene.search.FuzzyTermEnum
public final class FuzzyTermEnum
Subclass of FilteredTermEnum for enumerating all terms that are similar to the specified filter term.
Term enumerations are always ordered by Term.compareTo(). Each term in the enumeration is greater than all that precede it.
Field Summary |
---|
Fields inherited from class org.apache.lucene.search.FilteredTermEnum |
---|
actualEnum, currentTerm |
Constructor Summary | |
---|---|
FuzzyTermEnum(IndexReader reader,
Term term)
Creates a FuzzyTermEnum with an empty prefix and a minSimilarity of 0.5f. |
|
FuzzyTermEnum(IndexReader reader,
Term term,
float minSimilarity)
Creates a 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()
Closes the enumeration to further activity, freeing resources. |
float |
difference()
Equality measure on the term |
boolean |
endEnum()
Indicates the end of the enumeration has been reached |
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. |
Methods inherited from class org.apache.lucene.search.FilteredTermEnum |
---|
docFreq, next, setEnum, term |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FuzzyTermEnum(IndexReader reader, Term term) throws IOException
After calling the constructor the enumeration is already pointing to the first valid term if such a term exists.
reader
- term
-
IOException
FuzzyTermEnum(IndexReader, Term, float, int)
public FuzzyTermEnum(IndexReader reader, Term term, float minSimilarity) throws IOException
After calling the constructor the enumeration is already pointing to the first valid term if such a term exists.
reader
- term
- minSimilarity
-
IOException
FuzzyTermEnum(IndexReader, Term, float, int)
public FuzzyTermEnum(IndexReader reader, Term term, float minSimilarity, int prefixLength) throws IOException
reader
which share a prefix of
length prefixLength
with term
and which have a fuzzy similarity >
minSimilarity
.
After calling the constructor the enumeration is already pointing to the first valid term if such a term exists.
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.
IOException
Method Detail |
---|
protected final boolean termCompare(Term term)
termCompare
in class FilteredTermEnum
public final float difference()
difference
in class FilteredTermEnum
public final boolean endEnum()
endEnum
in class FilteredTermEnum
public void close() throws IOException
close
in interface Closeable
close
in class FilteredTermEnum
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |