Popularity
0.5
Growing
Activity
0.0
Stable
0
3
0
Description
An implementation of the Levenshtein distance for Golang
Programming language: Go
License: MIT License
golang levenshtein alternatives and similar packages
Based on the "Data Structures" category.
Alternatively, view golang levenshtein alternatives based on common mentions on social networks and blogs.
-
gods
GoDS (Go Data Structures) - Sets, Lists, Stacks, Maps, Trees, Queues, and much more -
go-datastructures
A collection of useful, performant, and threadsafe Go datastructures. -
golang-set
A simple, battle-tested and generic set type for the Go language. Trusted by Docker, 1Password, Ethereum and Hashicorp. -
roaring
Roaring bitmaps in Go (golang), used by InfluxDB, Bleve, DataDog -
willf/bloom
Go package implementing Bloom filters, used by Milvus and Beego. -
gocache
☔️ A complete Go cache library that brings you multiple ways of managing your caches -
boomfilters
Probabilistic data structures for processing continuous, unbounded streams. -
cuckoofilter
Cuckoo Filter: Practically Better Than Bloom -
gostl
Data structure and algorithm library for go, designed to provide functions similar to C++ STL -
hyperloglog
HyperLogLog with lots of sugar (Sparse, LogLog-Beta bias correction and TailCut space reduction) brought to you by Axiom -
trie
Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching. -
ttlcache
An in-memory cache with item expiration and generics [Moved to: https://github.com/jellydator/ttlcache] -
go-geoindex
Go native library for fast point tracking and K-Nearest queries -
Bloomfilter
Face-meltingly fast, thread-safe, marshalable, unionable, probability- and optimal-size-calculating Bloom filter in go -
go-adaptive-radix-tree
Adaptive Radix Trees implemented in Go -
goconcurrentqueue
Go concurrent-safe, goroutine-safe, thread-safe queue -
hilbert
Go package for mapping values to and from space-filling curves, such as Hilbert and Peano curves. -
levenshtein
Go implementation to calculate Levenshtein Distance. -
cuckoo-filter
Cuckoo Filter go implement, better than Bloom Filter, configurable and space optimized 布谷鸟过滤器的Go实现,优于布隆过滤器,可以定制化过滤器参数,并进行了空间优化 -
ring
Package ring provides a high performance and thread safe Go implementation of a bloom filter. -
go-rquad
:pushpin: State of the art point location and neighbour finding algorithms for region quadtrees, in Go -
memlog
A Kafka log inspired in-memory and append-only data structure -
set
A simple Set data structure implementation in Go (Golang) using LinkedHashMap. -
nan
Zero allocation Nullable structures in one library with handy conversion functions, marshallers and unmarshallers -
timedmap
A thread safe map which has expiring key-value pairs. -
goset
Set is a useful collection but there is no built-in implementation in Go lang. -
hide
ID type with marshalling to/from hash to prevent sending IDs to clients.
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Promo
www.influxdata.com
Do you think we are missing an alternative of golang levenshtein or a related project?
README
levenshtein
An implementation of the Levenshtein distance for Golang
Sources
Install
go get github.com/gitchander/levenshtein
Examples
package main
import (
"fmt"
lev "github.com/gitchander/levenshtein"
)
func main() {
var (
a = "exponential"
b = "polynomial"
)
distance := lev.Strings(a, b)
fmt.Printf("the levenshtein distance between %q and %q = %d\n", a, b, distance)
}
result:
the levenshtein distance between "exponential" and "polynomial" = 6
Example the distance by words:
package main
import (
"fmt"
"strings"
lev "github.com/gitchander/levenshtein"
)
func main() {
var (
line1 = "one two three four"
line2 = "one two three"
)
var (
a = strings.Split(line1, " ")
b = strings.Split(line2, " ")
)
distance := lev.Distance(lev.StringSlices{a, b})
fmt.Printf("the levenshtein distance between %q and %q = %d\n", a, b, distance)
}
result:
the levenshtein distance between ["one" "two" "three" "four"] and ["one" "two" "three"] = 1
Example with print matrix:
package main
import (
"fmt"
lev "github.com/gitchander/levenshtein"
)
func main() {
var (
a = []rune("sitting")
b = []rune("kitten")
)
costs := lev.DefaultCosts
fmt.Print(lev.PrintableMatrix(costs, a, b, ""))
}
result:
. . k i t t e n
. 0 1 2 3 4 5 6
s 1 1 2 3 4 5 6
i 2 2 1 2 3 4 5
t 3 3 2 1 2 3 4
t 4 4 3 2 1 2 3
i 5 5 4 3 2 2 3
n 6 6 5 4 3 3 2
g 7 7 6 5 4 4 3
Example the distance by interfaces:
package main
import (
"fmt"
lev "github.com/gitchander/levenshtein"
)
func main() {
var (
a = []Person{{"one", 1}, {"two", 2}, {"three", 3}, {"four", 4}}
b = []Person{{"one", 1}, {"two", 2}, {"three", 3}}
)
distance := lev.Distance(PersonSlices{a, b})
fmt.Printf("the levenshtein distance = %d\n", distance)
}
type Person struct {
Name string
Age int
}
type PersonSlices [2][]Person
var _ lev.Interface = PersonSlices{}
func (p PersonSlices) Len(k int) int {
return len(p[k])
}
func (p PersonSlices) Match(i, j int) bool {
return p[0][i] == p[1][j]
}
result:
the levenshtein distance = 1