public class LevenshteinEditDistance extends Object
Modifier and Type | Method and Description |
---|---|
static int |
getEditDistance(String source,
String target)
Returns the edit distance between two strings.
|
static int |
getEditDistance(String source,
String target,
boolean caseSensitive)
Returns the edit distance between two strings.
|
static double |
getNormalizedEditDistance(String source,
String target,
boolean caseSensitive)
Returns a normalized edit distance between 0 and 1.
|
static int |
getWorstCaseEditDistance(int sourceLength,
int targetLength)
Calculate the worst case distance between two strings with the given lengths
|
public static int getEditDistance(String source, String target)
source
- The source string.target
- The target distance.getEditDistance(String, String, boolean)
public static int getEditDistance(String source, String target, boolean caseSensitive)
source
- The source string.target
- The target stringcaseSensitive
- If true, case is used in comparisons and 'a' != 'A'.getEditDistance(String, String)
public static double getNormalizedEditDistance(String source, String target, boolean caseSensitive)
public static int getWorstCaseEditDistance(int sourceLength, int targetLength)
Copyright © 2017. All rights reserved.