public class WeightedLevenshtein extends java.lang.Object implements Comparator
Title: Dataspace Framework
Description: 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
Copyright: Copyright (c) 2013
Company: StreamScape Technologies
Modifier and Type | Class and Description |
---|---|
static class |
WeightedLevenshtein.DefaultWeightEstimator |
static interface |
WeightedLevenshtein.WeightEstimator
The object which supplies the actual weights for editing
operations.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
Constructor and Description |
---|
WeightedLevenshtein() |
Modifier and Type | Method and Description |
---|---|
static double |
compactDistance(java.lang.String s1,
java.lang.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(java.lang.String s1,
java.lang.String s2) |
static double |
distance(java.lang.String s1,
java.lang.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) |
public double compare(java.lang.String s1, java.lang.String s2)
compare
in interface Comparator
public boolean isTokenized()
Comparator
isTokenized
in interface Comparator
public void setEstimator(WeightedLevenshtein.WeightEstimator estimator)
public static double distance(java.lang.String s1, java.lang.String s2, WeightedLevenshtein.WeightEstimator weight)
public static double compactDistance(java.lang.String s1, java.lang.String s2, WeightedLevenshtein.WeightEstimator weight)
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.