commit | eb6844b05fc6f7e10932b0621c7f5f7e8890541d | [log] [tgz] |
---|---|---|
author | Kilian Evang <noreply@texttheater.net> | Sun Dec 08 22:16:05 2019 |
committer | Kilian Evang <noreply@texttheater.net> | Sun Dec 08 22:16:05 2019 |
tree | c408591b7dac0e631aca4a11940cfde8affd0a6c | |
parent | b7aaf30637d6c51cd6f476c051e3215a73359ae8 [diff] |
Bugfix: init values in matrix depend on cost The first row/column of the Levenshtein matrix must contain the column/row indexes *multiplied by insertion/deletion cost*. This last part had been forgotten, working fine in the common case when insertion and deletion cost are 1 but breaking otherwise. Fixes #12.
An implementation of the Levenshtein algorithm in Go. Provides edit distances, edit scripts and ratios for strings (slices of runes).
$ go get github.com/texttheater/golang-levenshtein/levenshtein
The documentation can be viewed online here: https://godoc.org/github.com/texttheater/golang-levenshtein/levenshtein
For a package that is similar but more generic and provides more control, check out Daniël de Kok’s editdistance.