Go implementation of Editex (Zobel & Dart, SIGIR 1996): Levenshtein distance with phonetic letter groups. Built for Watchman token scoring.
import "github.com/PhonoGrams/editex"
editex.Similarity("Niall", "Neil") // 0.80
editex.Distance("nelson", "neilsen") // 2Same-group substitutions (bp, ckq, dt, aeiouy, …) cost 1; other substitutions cost 2. Similarity is 1 - dist / (2 * max(len)).
- Zobel & Dart, Phonetic string matching: Lessons from information retrieval, SIGIR 1996
- Watchman: moov-io/watchman#879
Apache License 2.0