@Immutable public class JaroWinkler extends Object implements NormalizedStringSimilarity, NormalizedStringDistance
Constructor and Description |
---|
JaroWinkler()
Instantiate with default threshold (0.7).
|
JaroWinkler(double threshold)
Instantiate with given threshold to determine when Winkler bonus should
be used.
|
Modifier and Type | Method and Description |
---|---|
double |
distance(String s1,
String s2)
Return 1 - similarity.
|
double |
getThreshold()
Returns the current value of the threshold used for adding the Winkler
bonus.
|
double |
similarity(String s1,
String s2)
Compute Jaro-Winkler similarity.
|
public JaroWinkler()
public JaroWinkler(double threshold)
threshold
- public final double getThreshold()
public final double similarity(String s1, String s2)
similarity
in interface StringSimilarity
s1
- The first string to compare.s2
- The second string to compare.NullPointerException
- if s1 or s2 is null.public final double distance(String s1, String s2)
distance
in interface StringDistance
s1
- The first string to compare.s2
- The second string to compare.NullPointerException
- if s1 or s2 is null.Copyright © 2017. All rights reserved.