@Immutable public class SorensenDice extends Object implements NormalizedStringDistance, NormalizedStringSimilarity
Constructor and Description |
---|
SorensenDice()
Sorensen-Dice coefficient, aka Sørensen index, Dice's coefficient or
Czekanowski's binary (non-quantitative) index.
|
SorensenDice(int k)
Sorensen-Dice coefficient, aka Sørensen index, Dice's coefficient or
Czekanowski's binary (non-quantitative) index.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(String s1,
String s2) |
int |
getK()
Return k, the length of k-shingles (aka n-grams).
|
Map<String,Integer> |
getProfile(String string)
Compute and return the profile of s, as defined by Ukkonen "Approximate
string-matching with q-grams and maximal matches".
|
double |
similarity(String s1,
String s2)
Similarity is computed as 2 * |A inter B| / (|A| + |B|).
|
public SorensenDice(int k)
k
- public SorensenDice()
public final double similarity(String s1, String s2)
similarity
in interface StringSimilarity
s1
- s2
- public double distance(String s1, String s2)
distance
in interface StringDistance
public int getK()
public final Map<String,Integer> getProfile(String string)
string
- Copyright © 2016. All rights reserved.