go-similarity

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2024 License: MIT

README

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL