@Immutable public class QGram extends ShingleBased implements StringDistance
| Constructor and Description |
|---|
QGram()
Q-gram similarity and distance.
|
QGram(int k)
Q-gram similarity and distance.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distance(Map<String,Integer> profile1,
Map<String,Integer> profile2)
Compute QGram distance using precomputed profiles.
|
double |
distance(String s1,
String s2)
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).
|
getK, getProfilepublic QGram(int k)
k - public QGram()
public final double distance(String s1, String s2)
distance in interface StringDistances1 - The first string to compare.s2 - The second string to compare.NullPointerException - if s1 or s2 is null.Copyright © 2018. All rights reserved.