| Modifier and Type | Field and Description |
|---|---|
| private final CharacterInsDelInterface | |
| private final CharacterSubstitutionInterface |
| Access | Constructor and Description |
|---|---|
| public | WeightedLevenshtein(final CharacterSubstitutionInterface
The strategy to determine character substitution weights. charsub)Instantiate with provided character substitution. |
| public | WeightedLevenshtein(final CharacterSubstitutionInterface
The strategy to determine character substitution weights. charsub, final CharacterInsDelInterface The strategy to determine character insertion /
deletion weights. charchange)Instantiate with provided character substitution, insertion, and deletion weights. |
| Modifier and Type | Method and Description |
|---|---|
| private double | |
| public final double | distance(final String s1, final String s2)
Implements info. Equivalent to distance(s1, s2, Double.MAX_VALUE). |
| public final double | Returns: The computed weighted Levenshtein distance.The first string to compare. s1, final String The second string to compare. s2, final double The maximum result to compute before stopping. This
means that the calculation can terminate early if you
only care about strings with a certain similarity.
Set this to Double.MAX_VALUE if you want to run the
calculation to completion in every case. limit)Compute Levenshtein distance using provided weights for substitution. |
| private double |
| charchange | back to summary |
|---|---|
| private final CharacterInsDelInterface charchange | |
| charsub | back to summary |
|---|---|
| private final CharacterSubstitutionInterface charsub | |
| WeightedLevenshtein | back to summary |
|---|---|
| public WeightedLevenshtein(final CharacterSubstitutionInterface charsub) Instantiate with provided character substitution.
| |
| WeightedLevenshtein | back to summary |
|---|---|
| public WeightedLevenshtein(final CharacterSubstitutionInterface charsub, final CharacterInsDelInterface charchange) Instantiate with provided character substitution, insertion, and deletion weights.
| |
| deletionCost | back to summary |
|---|---|
| private double deletionCost(final char c) | |
| distance | back to summary |
|---|---|
| public final double distance(final String s1, final String s2) Implements info. Equivalent to distance(s1, s2, Double.MAX_VALUE). | |
| distance | back to summary |
|---|---|
| public final double distance(final String s1, final String s2, final double limit) Compute Levenshtein distance using provided weights for substitution.
| |
| insertionCost | back to summary |
|---|---|
| private double insertionCost(final char c) | |