Saltar al contenido
V volfread.xyz
LIB · Go

fast-levenshtein

In simple terms

Measures how similar two texts are by counting the edits needed to turn one into the other. Works well with accents, CJK characters and emoji — not just plain letters.

Technical details

Modern fork of ka-weihe/fast-levenshtein in Go 1.26. Uses stack-local tables for ASCII and local maps for Unicode, achieving a heap-free fast-path for ≤64 runes. Implements blocked Myers O((n/64)·m) with DP fallback for weighted costs, measured in runes (not bytes).

Go 1.26Myers bit-parallel

Highlights

  • ASCII fast-path 0 allocs (2 KiB stack) + Unicode U+10FFFF via runes
  • Dual API: Distance and DistanceWithCost with insert/delete weights
  • Thread-safe — verified with -race and fuzzing; ~13k ns/op for len 4

Install

go get github.com/yukiteruamano/fast-levenshtein/v2

Lines of code

689

Go
100%

Last recorded activity

Last recorded activity 3 commits · 52 sem
Semana 1: 0 commits Semana 2: 0 commits Semana 3: 0 commits Semana 4: 0 commits Semana 5: 0 commits Semana 6: 0 commits Semana 7: 0 commits Semana 8: 0 commits Semana 9: 0 commits Semana 10: 0 commits Semana 11: 0 commits Semana 12: 0 commits Semana 13: 0 commits Semana 14: 0 commits Semana 15: 0 commits Semana 16: 0 commits Semana 17: 0 commits Semana 18: 0 commits Semana 19: 0 commits Semana 20: 0 commits Semana 21: 0 commits Semana 22: 0 commits Semana 23: 0 commits Semana 24: 0 commits Semana 25: 0 commits Semana 26: 0 commits Semana 27: 0 commits Semana 28: 0 commits Semana 29: 0 commits Semana 30: 0 commits Semana 31: 0 commits Semana 32: 0 commits Semana 33: 0 commits Semana 34: 0 commits Semana 35: 0 commits Semana 36: 0 commits Semana 37: 0 commits Semana 38: 0 commits Semana 39: 0 commits Semana 40: 0 commits Semana 41: 0 commits Semana 42: 0 commits Semana 43: 0 commits Semana 44: 0 commits Semana 45: 0 commits Semana 46: 0 commits Semana 47: 0 commits Semana 48: 0 commits Semana 49: 0 commits Semana 50: 3 commits Semana 51: 0 commits Semana 52: 0 commits

Last recorded activity in the project.