public interface StringDistance
For some types of distances, it is fine to simply create a
StringDistance object and then use it, e.g.,
new JaroWinkler().compare("frederic", "fredrick").
Other string metrics benefit from caching information about a
string, especially when many comparisons are many concerning the
same string. The prepare() method returns a StringWrapper
object, which can cache any appropriate information about the
String it 'wraps'. The most frequent use of caching here is saving
a tokenized version of a string (as a BagOfTokens, which is
a subclass of StringWrapper.)
| Modifier and Type | Method and Description |
|---|---|
String |
explainScore(String s,
String t)
Explain how the distance was computed.
|
String |
explainScore(StringWrapper s,
StringWrapper t)
Explain how the distance was computed.
|
StringWrapper |
prepare(String s)
Preprocess a string for distance computation
|
double |
score(String s,
String t)
Find the distance between s and t
|
double |
score(StringWrapper s,
StringWrapper t)
Find the distance between s and t.
|
double score(StringWrapper s, StringWrapper t)
StringWrapper prepare(String s)
String explainScore(StringWrapper s, StringWrapper t)
Copyright © 2016. All rights reserved.