lev
github.com/ferhatelmas/levenshtein
go get github.com/ferhatelmas/levenshtein
lev

github.com/ferhatelmas/levenshtein

Levenshtein distance in Golang

by ferhat elmas

v0.0.0-20160518143259-a12aecc52d76 (see all)License:MIT
go get github.com/ferhatelmas/levenshtein
Readme

Levenshtein Distance in Golang

Godoc Build Status

Calculate levenshtein distance in Golang.

Install

By go tool: go get github.com/ferhatelmas/levenshtein

Usage

This uses default calculator which has cost of 1 for additions, deletions and substitutions.

import github.com/ferhatelmas/levenshtein

levenshtein.Dist("aaa", "ab") // 2

You can specify different weights to increment/deletion and substitutions.

levenshtein.New(1, 1).Dist("aaa", "ab") // 2
levenshtein.New(1, 2).Dist("aaa", "ab") // 3
levenshtein.New(1, 3).Dist("aaa", "ab") // 3
levenshtein.New(1, 4).Dist("aaa", "ab") // 3
levenshtein.New(2, 2).Dist("aaa", "ab") // 4
levenshtein.New(3, 2).Dist("aaa", "ab") // 5

LICENSE

MIT © Ferhat Elmas

GitHub Stars

11

LAST COMMIT

6yrs ago

MAINTAINERS

0

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20160518143259-a12aecc52d76
3yrs ago
No alternatives found
No tutorials found
Add a tutorial