Skip to content

Similarity or distance metrics for string implemented on Golang, inspired by Sam Chapman's SimMetrics library.

License

Notifications You must be signed in to change notification settings

ghosind/go-similarity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-similarity

test Go Report Card codecov Version Badge License Badge Go Reference

Similarity or distance metrics for string implemented on Golang, inspired by Sam Chapman's SimMetrics library.

Installation

Run the following command to install the package:

go get -u github.com/ghosind/go-similarity

Getting Started

To use the similarity package, you need to import it in your Go file and create a new instance of the similarity you want to use.

sim := new(similarity.BlockDistance)
similarity := sim.Compare("Hello World", "Hello Go")
fmt.Println(similarity)
// 0.5

Supported Metrics Algorithms

Builtin Tokenizers

  • Whitespace Tokenizer: Tokenize the input string by whitespace.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Similarity or distance metrics for string implemented on Golang, inspired by Sam Chapman's SimMetrics library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages