1.4.1 release #10
@@ -3,7 +3,13 @@ package com.infendro.cli.util
|
||||
internal const val threshold = 2
|
||||
|
||||
/**
|
||||
* Damerau-Levenshtein string distance
|
||||
* Calculates the Damerau-Levenshtein distance between two strings.
|
||||
*
|
||||
* The distance is the minimum number of operations (insertion, deletion, substitution, and transposition) required to transform one string into another.
|
||||
*
|
||||
* @param a The source string.
|
||||
* @param b The target string.
|
||||
* @return The minimum number of operations to transform [a] into [b].
|
||||
*/
|
||||
internal fun distance(a: String, b: String): Int {
|
||||
if (a == b) return 0
|
||||
|
||||
Reference in New Issue
Block a user