LevenshteinDistance

Functions

Link copied to clipboard
fun getLevenshteinDistance(s: String, t: String, maxAllowedEditDistance: Int): Int

Efficient version of Levenshtein Distance Algorithm. It saves CPU by returning early if the distance goes over maxAllowedEditDistance. See examples in LevenshteinDistanceTest class.