https://github.com/a-poor/jarowinkler
An implementation of the Jaro-Winkler string similarity algorithm in Go.
https://github.com/a-poor/jarowinkler
jaro-winkler nlp text-similarity
Last synced: 27 days ago
JSON representation
An implementation of the Jaro-Winkler string similarity algorithm in Go.
- Host: GitHub
- URL: https://github.com/a-poor/jarowinkler
- Owner: a-poor
- License: mit
- Created: 2024-10-12T19:11:03.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-10-13T04:46:15.000Z (6 months ago)
- Last Synced: 2025-03-26T06:35:58.781Z (28 days ago)
- Topics: jaro-winkler, nlp, text-similarity
- Language: Go
- Homepage: https://pkg.go.dev/github.com/a-poor/jarowinkler
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JaroWinkler
[](https://pkg.go.dev/github.com/a-poor/jarowinkler)
[](https://github.com/a-poor/jarowinkler/actions/workflows/test.yaml)An implementation of the Jaro-Winkler string similarity algorithm in Go.
## Installation
```sh
go get github.com/a-poor/jarowinkler
```## Usage
```go
package mainimport (
"fmt""github.com/a-poor/jarowinkler"
)func main() {
s1 := "CRATE"
s2 := "CRACE"
fmt.Printf("%.4f\n", jarowinkler.JaroWinkler(s1, s2))
// Output: 0.9067
}```
## References
Based on the following implementations:
- https://geeksforgeeks.org/jaro-and-jaro-winkler-similarity/
- https://en.wikipedia.org/wiki/Jaro-Winkler_distance
- https://safjan.com/jaro-winkler-similarity
- https://tech.popdata.org/speeding-up-Jaro-Winkler-with-rust-and-bitwise-operations## Benchmarks
There are (very basic) benchmarks for the `Jaro` and `JaroWinkler` functions,
though they don't compare the performance of this implementation to other text
similarity algorithms.```
$ go test -bench=.
goos: linux
goarch: amd64
pkg: github.com/a-poor/jarowinkler
cpu: Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
BenchmarkJaro-8 2647617 406.6 ns/op
BenchmarkJaroWinkler-8 2698708 434.8 ns/op
BenchmarkJaroWinklerLong-8 111476 10478 ns/op
PASS
ok github.com/a-poor/jarowinkler 4.454s
```