public class QGramComparator extends java.lang.Object implements StringComparator
Modifier and Type | Class and Description |
---|---|
static class |
QGramComparator.Formula
Represents the different formulas we can use to compute similarity.
|
static class |
QGramComparator.Tokenizer
Represents the different ways we can tokenize a string into a set
of q-grams for a given q.
|
Constructor and Description |
---|
QGramComparator() |
Modifier and Type | Method and Description |
---|---|
double |
compare(java.lang.String s1,
java.lang.String s2) |
boolean |
isTokenized() |
void |
setFormula(QGramComparator.Formula formula)
Tells the comparator what formula to use to compute the actual
similarity.
|
void |
setQ(int q)
Sets the value of q, that is, the size of the q-grams.
|
void |
setTokenizer(QGramComparator.Tokenizer tokenizer)
Tells the comparator what tokenizer to use to produce q-grams.
|
public boolean isTokenized()
isTokenized
in interface StringComparator
public double compare(java.lang.String s1, java.lang.String s2)
compare
in interface StringComparator
public void setQ(int q)
public void setFormula(QGramComparator.Formula formula)
public void setTokenizer(QGramComparator.Tokenizer tokenizer)