Class EditDistance
java.lang.Object
org.languagetool.rules.spelling.symspell.implementation.EditDistance
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate EditDistance.DistanceAlgorithmprivate Stringprivate int[]private int[] -
Constructor Summary
ConstructorsConstructorDescriptionEditDistance(String baseString, EditDistance.DistanceAlgorithm algorithm) Create a new EditDistance object. The base string to which other strings will be compared. The desired edit distance algorithm. -
Method Summary
Modifier and TypeMethodDescriptionintusing the previously selected algorithm.
The string to compare. The maximum distance allowed.The edit distance (or -1 if maxDistance exceeded). intDamerauLevenshteinDistance(String string2, int maxDistance) String being compared for distance. String being compared against other string. The maximum edit distance of interest.int edit distance, >= 0 representing the number of edits required to transform one string to the other, or -1 if the distance is greater than the specified maxDistance.
-
Field Details
-
baseString
-
algorithm
-
v0
private int[] v0 -
v2
private int[] v2
-
-
Constructor Details
-
EditDistance
Create a new EditDistance object. The base string to which other strings will be compared. The desired edit distance algorithm.
-
-
Method Details
-
compare
using the previously selected algorithm.
The string to compare. The maximum distance allowed.The edit distance (or -1 if maxDistance exceeded). -
DamerauLevenshteinDistance
String being compared for distance. String being compared against other string. The maximum edit distance of interest.int edit distance, >= 0 representing the number of edits required to transform one string to the other, or -1 if the distance is greater than the specified maxDistance.
-