|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectno.priv.garshol.duke.comparators.WeightedLevenshtein
public class WeightedLevenshtein
An implementation of the Levenshtein distance metric that uses weights, so that not all editing operations are considered equal. Useful explanation: http://www.let.rug.nl/kleiweg/lev/levenshtein.html
Nested Class Summary | |
---|---|
static class |
WeightedLevenshtein.DefaultWeightEstimator
|
static interface |
WeightedLevenshtein.WeightEstimator
The object which supplies the actual weights for editing operations. |
Constructor Summary | |
---|---|
WeightedLevenshtein()
|
Method Summary | |
---|---|
static double |
compactDistance(String s1,
String s2,
WeightedLevenshtein.WeightEstimator weight)
Optimized version of the Wagner & Fischer algorithm that only keeps a single column in the matrix in memory at a time. |
double |
compare(String s1,
String s2)
|
static double |
distance(String s1,
String s2,
WeightedLevenshtein.WeightEstimator weight)
|
boolean |
isTokenized()
Returns true if the comparator breaks string values up into tokens when comparing. |
void |
setEstimator(WeightedLevenshtein.WeightEstimator estimator)
|
static void |
timing(String s1,
String s2)
Utility function for testing Levenshtein performance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WeightedLevenshtein()
Method Detail |
---|
public double compare(String s1, String s2)
compare
in interface Comparator
public boolean isTokenized()
Comparator
isTokenized
in interface Comparator
public void setEstimator(WeightedLevenshtein.WeightEstimator estimator)
public static double distance(String s1, String s2, WeightedLevenshtein.WeightEstimator weight)
public static double compactDistance(String s1, String s2, WeightedLevenshtein.WeightEstimator weight)
public static void timing(String s1, String s2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |