Package io.github.connellite.util
Class Levenshtein
java.lang.Object
io.github.connellite.util.Levenshtein
Levenshtein (edit) distance: minimum single-character insertions, deletions, and substitutions
needed to turn one
CharSequence into another. Uses UTF-16 code units, like String.
Time O(m·n), space O(n) for lengths m and n (two rows).
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Levenshtein
public Levenshtein()
-
-
Method Details
-
dist
- Parameters:
word1- first sequence; not nullword2- second sequence; not null- Returns:
- edit distance between
word1andword2(non-negative)
-