com.sun.enterprise.admin.cli
Class StringEditDistance
java.lang.Object
com.sun.enterprise.admin.cli.StringEditDistance
public class StringEditDistance
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
editDistance
public static int editDistance(String a,
String b)
- Computes the edit distance between two strings.
The complexity is O(nm) where n=a.length() and m=b.length().
findNearest
public static String findNearest(String key,
String[] group)
- Finds the string in the
group closest to
key and returns it.
- Returns:
- null if group.length==0.
Copyright © 2012. All Rights Reserved.