Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robopuff/go-dice
An implementation of Dice algorithm to compare strings
https://github.com/robopuff/go-dice
dice-similarity-coefficient golang golang-library
Last synced: 6 days ago
JSON representation
An implementation of Dice algorithm to compare strings
- Host: GitHub
- URL: https://github.com/robopuff/go-dice
- Owner: robopuff
- License: bsd-3-clause
- Created: 2019-01-08T15:45:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T13:43:56.000Z (almost 6 years ago)
- Last Synced: 2024-11-07T12:56:44.962Z (about 2 months ago)
- Topics: dice-similarity-coefficient, golang, golang-library
- Language: Go
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![GoDoc](https://godoc.org/github.com/robopuff/go-dice?status.svg)](https://godoc.org/github.com/robopuff/go-dice)
# go-dice
An implementation of [Dice coefficient](http://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient) algorithm in Go.
Code is based on [aceakash/string-similarity](https://github.com/aceakash/string-similarity)## Installation
```bash
$ go get github.com/robopuff/go-dice
```## Documentation
https://godoc.org/github.com/robopuff/go-dice
## Usage examples
```go
similarity := dice.ComparePair("healed", "sealed")
// `similarity` will be equal to 0.8
``````go
bestIndex, results := dice.FindBest("healed", []string{"mailed", "edward", "sealed", "theatre"})
// Since highest score will have "sealed" `bestIndex` will be equal to `2`
// and results will provide an array of ordered float32 similarity scores
```## License
This software is licensed under the BSD-3-Clause License. [View the license](LICENSE).