public interface StringMetric extends Metric<String>
The similarity measure should be consistent with equals such that
a.equals(b) => compare(a,b) == 1.0
.
The similarity measure should be reflexive such that
compare(a,a) == 1.0
.
The similarity measure should be symmetric such that
compare(a,b) == compare(b,a)
.
Modifier and Type | Method and Description |
---|---|
float |
compare(String a,
String b)
Measures the similarity between strings a and b.
|
float compare(String a, String b)
compare
in interface Metric<String>
a
- string a to compareb
- string b to compareNullPointerException
- when either a or b is nullCopyright © 2014–2018. All rights reserved.