|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.util.EditDistance
public class EditDistance
Computes the string edit distance.
Refer to a computer science text book for the definition of the "string edit distance".
Method Summary | |
---|---|
static int |
editDistance(String a,
String b)
Computes the edit distance between two strings. |
static String |
findNearest(String key,
Collection<String> group)
|
static String |
findNearest(String key,
String[] group)
Finds the string in the group closest to
key and returns it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static int editDistance(String a, String b)
The complexity is O(nm) where n=a.length() and m=b.length().
public static String findNearest(String key, String[] group)
group
closest to
key
and returns it.
public static String findNearest(String key, Collection<String> group)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |