Package one.microstream.chars
Class Levenshtein
java.lang.Object
one.microstream.chars.Levenshtein
public final class Levenshtein extends Object
Simple implementation of the Levenshtein distance algorithm for calculating Levenshtein distance or a
Levenshtein-based string similarity.
This class provides three overloaded methods for String
, CharSequence
and char[]
.
A constant Similator
function object as well as static convenience methods are provided as well.
-
Method Summary
Modifier and Type Method Description static float
charDistance(char a, char b)
static float
distance(char[] a, char[] b, _charDistance costFunction)
static float
distance(CharSequence a, CharSequence b, _charDistance costFunction)
static float
distance(String a, String b, _charDistance costFunction)
static float
similarity(char[] a, char[] b)
static float
similarity(char[] a, char[] b, _charDistance costFunction)
static float
similarity(CharSequence a, CharSequence b)
static float
similarity(CharSequence a, CharSequence b, _charDistance costFunction)
static float
similarity(String a, String b)
static float
similarity(String a, String b, _charDistance costFunction)
static double
similiarity(String a, String b)
static double
substringSimilarity(String s1, String s2)
static double
upperCaseSimiliarity(String a, String b)
-
Method Details
-
similiarity
-
upperCaseSimiliarity
-
charDistance
public static final float charDistance(char a, char b) -
substringSimilarity
-
distance
-
distance
-
distance
-
similarity
-
similarity
-
similarity
-
similarity
-
similarity
-
similarity
public static final float similarity(char[] a, char[] b)
-