@Immutable public class WeightedLevenshtein extends Object implements StringDistance
| Constructor and Description |
|---|
WeightedLevenshtein(CharacterSubstitutionInterface charsub)
Instantiate with provided character substitution.
|
WeightedLevenshtein(CharacterSubstitutionInterface charsub,
CharacterInsDelInterface charchange)
Instantiate with provided character substitution, insertion, and
deletion weights.
|
| Modifier and Type | Method and Description |
|---|---|
double |
distance(String s1,
String s2)
Compute Levenshtein distance using provided weights for substitution.
|
public WeightedLevenshtein(CharacterSubstitutionInterface charsub)
charsub - The strategy to determine character substitution weights.public WeightedLevenshtein(CharacterSubstitutionInterface charsub, CharacterInsDelInterface charchange)
charsub - The strategy to determine character substitution weights.charchange - The strategy to determine character insertion /
deletion weights.public final double distance(String s1, String s2)
distance in interface StringDistances1 - The first string to compare.s2 - The second string to compare.NullPointerException - if s1 or s2 is null.Copyright © 2018. All rights reserved.