Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

README.md

1.42 Kb · 29 lines

gno.land/p/nym-moultest123/x/daily/levenshtein/v0

Levenshtein edit-distance — Distance, Matrix, Similarity.

The minimum number of single-character insertions, deletions, or substitutions to turn one string into another. Fully rune-aware, pure (deterministic), two-row DP (O(min(len)) memory). Ported from Go's agext/levenshtein.

1import "gno.land/p/nym-moultest123/x/daily/levenshtein/v0"
2
3d := levenshtein.Distance("kitten", "sitting")   // 3
4m := levenshtein.Matrix("kitten", "sitting")     // full (7 x 8) DP matrix
5s := levenshtein.Similarity("kitten", "sitting") // 57 (a 0..100 percentage)

Live demo: r/moul/x/daily/levenshteindemo · render it at /r/nym-moultest123/x/daily/levenshteindemo/v0.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.