Levenshtein

The Levenshtein distance between two words is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one string into the other.

This implementation uses dynamic programming (Wagner–Fischer algorithm).

Levenshtein Distance

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun distance(first: CharSequence, second: CharSequence, limit: Int = Int.MAX_VALUE): Int

The Levenshtein distance, or edit distance, between two words is the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other.