Class LevenshteinDistance
java.lang.Object
com.espertech.esper.common.internal.util.LevenshteinDistance
Utility for string comparison based on the Levenshtein algo.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Make 3 characters an acceptable distance for reporting. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
computeLevenshteinDistance
(CharSequence str1, CharSequence str2) Compute the distance between two strins using the Levenshtein algorithm, including a case-insensitive string comparison.
-
Field Details
-
ACCEPTABLE_DISTANCE
public static final int ACCEPTABLE_DISTANCEMake 3 characters an acceptable distance for reporting.- See Also:
-
-
Constructor Details
-
LevenshteinDistance
public LevenshteinDistance()
-
-
Method Details
-
computeLevenshteinDistance
Compute the distance between two strins using the Levenshtein algorithm, including a case-insensitive string comparison.- Parameters:
str1
- first stringstr2
- second string- Returns:
- distance or zero if case-insensitive string comparison found equal strings or Integer.MAX_VALUE for invalid comparison because of null values.
-