Package com.sun.enterprise.admin.cli
Class StringEditDistance
java.lang.Object
com.sun.enterprise.admin.cli.StringEditDistance
-
Method Summary
Modifier and TypeMethodDescriptionstatic inteditDistance(String a, String b) Computes the edit distance between two strings.static StringfindNearest(String key, String[] group) Finds the string in thegroupclosest tokeyand returns it.
-
Method Details
-
editDistance
Computes the edit distance between two strings.The complexity is O(nm) where n=a.length() and m=b.length().
-
findNearest
Finds the string in thegroupclosest tokeyand returns it.- Returns:
- null if group.length==0.
-