| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final double | Returns: The computed Q-gram distance.The first string to compare. s1, final String The second string to compare. s2)Implements info. The distance between two strings is defined as the L1 norm of the difference of their profiles (the number of occurence of each k-shingle). |
| public final double |
| QGram | back to summary |
|---|---|
| public QGram(final int k) Q-gram similarity and distance. Defined by Ukkonen in "Approximate string-matching with q-grams and maximal matches", http://www.sciencedirect.com/science/article/pii/0304397592901434 The distance between two strings is defined as the L1 norm of the difference of their profiles (the number of occurences of each k-shingle). Q-gram distance is a lower bound on Levenshtein distance, but can be computed in O(|A| + |B|), where Levenshtein requires O(|A|.|B|) | |
| QGram | back to summary |
|---|---|
| public QGram() Q-gram similarity and distance. Defined by Ukkonen in "Approximate string-matching with q-grams and maximal matches", http://www.sciencedirect.com/science/article/pii/0304397592901434 The distance between two strings is defined as the L1 norm of the difference of their profiles (the number of occurence of each k-shingle). Q-gram distance is a lower bound on Levenshtein distance, but can be computed in O(|A| + |B|), where Levenshtein requires O(|A|.|B|) Default k is 3. | |
| distance | back to summary |
|---|---|
| public final double distance(final String s1, final String s2) Implements info. The distance between two strings is defined as the L1 norm of the difference of their profiles (the number of occurence of each k-shingle).
| |
| distance | back to summary |
|---|---|
| public final double distance(final Map<String, Integer> profile1, final Map<String, Integer> profile2) Compute QGram distance using precomputed profiles. | |