|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.lib.util.StringDistance
public class StringDistance
Utilities for calculating string distance.
Constructor Summary | |
---|---|
StringDistance()
|
Method Summary | |
---|---|
static String |
getClosestLevenshteinDistance(String str,
Collection candidates)
Returns the candidate string with the closest Levenshtein distance to the given string. |
static String |
getClosestLevenshteinDistance(String str,
Collection candidates,
float thresholdPercentage)
Returns the candidate string with the closest Levenshtein distance to the given string and using the threshold as the specified percentage of the length of the candidate string(0.0f-1.0f). |
static String |
getClosestLevenshteinDistance(String str,
Collection candidates,
int threshold)
Returns the candidate string with the closest Levenshtein distance to the given string. |
static String |
getClosestLevenshteinDistance(String str,
String[] candidates)
Returns the candidate string with the closest Levenshtein distance to the given string. |
static String |
getClosestLevenshteinDistance(String str,
String[] candidates,
float thresholdPercentage)
Returns the candidate string with the closest Levenshtein distance to the given string and using the threshold as the specified percentage of the length of the candidate string(0.0f-1.0f). |
static String |
getClosestLevenshteinDistance(String str,
String[] candidates,
int threshold)
Returns the candidate string with the closest Levenshtein distance to the given string. |
static int |
getLevenshteinDistance(String s,
String t)
Returns the Levenshtein distance between the two strings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringDistance()
Method Detail |
---|
public static String getClosestLevenshteinDistance(String str, String[] candidates)
getClosestLevenshteinDistance(String,Collection,int)
public static String getClosestLevenshteinDistance(String str, Collection candidates)
getClosestLevenshteinDistance(String,Collection,int)
public static String getClosestLevenshteinDistance(String str, String[] candidates, int threshold)
getClosestLevenshteinDistance(String,Collection,int)
public static String getClosestLevenshteinDistance(String str, String[] candidates, float thresholdPercentage)
getClosestLevenshteinDistance(String,Collection,int)
public static String getClosestLevenshteinDistance(String str, Collection candidates, float thresholdPercentage)
getClosestLevenshteinDistance(String,Collection,int)
public static String getClosestLevenshteinDistance(String str, Collection candidates, int threshold)
str
- the string to checkcandidates
- the list of strings to test againstthreshold
- the threshold distance a candidate must meetgetLevenshteinDistance(java.lang.String, java.lang.String)
public static int getLevenshteinDistance(String s, String t)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |