com.wcohen.ss
Class Level2
java.lang.Object
com.wcohen.ss.AbstractStringDistance
com.wcohen.ss.AbstractTokenizedStringDistance
com.wcohen.ss.Level2
- All Implemented Interfaces:
- StringDistance, StringDistanceLearner
- Direct Known Subclasses:
- Level2Jaro, Level2JaroWinkler, Level2Levenstein, Level2MongeElkan
public class Level2
- extends AbstractTokenizedStringDistance
Generic version of Monge & Elkan's "level 2" recursive field
matching. Given strings A, B that are broken into substrings A =
A1...Ak and B=B1...Bm, the recursive string matching algorithm
scores
score(A,B) = 1/k [ sum_i max_j score(Ai,Bj) ]
For level 1, substrings Ai, Bj are delimited by commas; for level
2, they are tokens.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Level2
public Level2(Tokenizer tokenizer,
StringDistance tokenDistance)
score
public double score(StringWrapper s,
StringWrapper t)
- Description copied from class:
AbstractStringDistance
- This method needs to be implemented by subclasses.
- Specified by:
score
in interface StringDistance
- Specified by:
score
in class AbstractStringDistance
explainScore
public java.lang.String explainScore(StringWrapper s,
StringWrapper t)
- Explain how the distance was computed.
- Specified by:
explainScore
in interface StringDistance
- Specified by:
explainScore
in class AbstractStringDistance
train
public void train(StringWrapperIterator i)
- Training is a null operation. Properly speaking of course, it
should train the inner distance function.
- Specified by:
train
in class AbstractTokenizedStringDistance
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
main
public static void main(java.lang.String[] argv)