public class StringUtils extends Object
| Constructor and Description |
|---|
StringUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
getOptimalStringAlignmentDistance(String s,
String t)
Finds the
Optimal string alignment distance –
also referred to as the Damerau-Levenshtein distance –
between two strings.
|
public static int getOptimalStringAlignmentDistance(String s, String t)
FuzzyTermsEnum.
Lucene itself has an implementation of this algorithm,
but it is much less efficient in terms of space (also note that Lucene's
implementation does not return the distance, but a similarity score based on it).s - the first string, must not be null.t - the second string, must not be null.IllegalArgumentException - if either String input is null.StringUtils.getLevenshteinDistance(String, String),
LuceneLevenshteinDistanceCopyright © 2012–2017. All rights reserved.