DamerauLevenshtein

Damerau-Levenshtein distance with transposition (unrestricted Damerau-Levenshtein distance).

The distance is the minimum number of operations needed to transform one string into the other, where an operation is defined as an insertion, deletion, or substitution of a single character, or a transposition of two adjacent characters. It does respect triangle inequality, and is thus a metric distance.

Damerau–Levenshtein

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun distance(first: CharSequence, second: CharSequence): Int

Compute the distance between strings: the minimum number of operations needed to transform one string into the other (insertion, deletion, substitution of a single character, or a transposition of two adjacent characters).