public class Infingram extends Object
Infingram is a sequence of tokens (e.g., words), within another
String, t.
Each token from the Infingram either appear as is or as a substring
of a corresponding token in t, with all tokens maintaining their
relative order.
Infingrams are used for efficient multi-word fuzzy search
across values that have not been previously indexed. A search query that is
used to construct and Infingram is compiled for repeated comparisons
against potential matches using the in(String) method.
| Constructor and Description |
|---|
Infingram(String needle)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
in(String value)
Return
true if this Infingram (the needle)
exists within value (the haystack) such that it is an
infix search match. |
int |
numTokens()
Return the number of tokens.
|
public Infingram(String needle)
needle - public boolean in(String value)
true if this Infingram (the needle)
exists within value (the haystack) such that it is an
infix search match. If haystack is an infix
search match, it means that it contains a sequence of terms where each
term or a substring of the term matches the term in the same relative
position of the needle.
public final int numTokens()