levenshtein-fuzzy-match-pure-kmp

Installation
SKILL.md

Edit distance and candidate selection, in shared code

Edit distance is one nested loop and two integer arrays. Writing it out is cheaper than finding a multiplatform library for it, and the result compiles into shared code with no expect/actual:

// adapted
fun levenshtein(lhs: CharSequence, rhs: CharSequence): Int {
    var cost = IntArray(lhs.length + 1) { it }      // row for rhs-prefix of length 0
    var newCost = IntArray(lhs.length + 1) { 0 }
Installs
2
GitHub Stars
35
First Seen
6 days ago
levenshtein-fuzzy-match-pure-kmp — maxrave-dev/kotlin-footguns