Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lexmag/simetric
String similarity metrics for Elixir
https://github.com/lexmag/simetric
distance elixir jaro-winkler levenshtein similarity
Last synced: 25 days ago
JSON representation
String similarity metrics for Elixir
- Host: GitHub
- URL: https://github.com/lexmag/simetric
- Owner: lexmag
- License: isc
- Created: 2014-11-21T22:23:24.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-04-26T15:16:21.000Z (over 3 years ago)
- Last Synced: 2024-05-09T21:52:57.666Z (7 months ago)
- Topics: distance, elixir, jaro-winkler, levenshtein, similarity
- Language: Elixir
- Homepage:
- Size: 11.7 KB
- Stars: 61
- Watchers: 4
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - String similarity metrics for Elixir. (Text and Numbers)
- fucking-awesome-elixir - simetric - String similarity metrics for Elixir. (Text and Numbers)
- awesome-elixir - simetric - String similarity metrics for Elixir. (Text and Numbers)
README
# Simetric
[![Build Status](https://travis-ci.org/lexmag/simetric.svg "Build Status")](https://travis-ci.org/lexmag/simetric)
[![Hex Version](https://img.shields.io/hexpm/v/simetric.svg "Hex Version")](https://hex.pm/packages/simetric)Simetric provides facilities to perform approximate string matching and measurement of string similarity/distance.
The library is focusing on speed and completeness.### Available metrics
* [Jaro](http://en.wikipedia.org/wiki/Jaro-Winkler_distance) (has been moved to [Elixir's standard library](https://hexdocs.pm/elixir/String.html#jaro_distance/2))
* [Jaro–Winkler](http://en.wikipedia.org/wiki/Jaro-Winkler_distance)
* [Levenshtein](http://en.wikipedia.org/wiki/Levenshtein_distance)## Installation
Add Simetric as a dependency to your `mix.exs` file:
```elixir
defp deps do
[{:simetric, "~> 0.2.0"}]
end
```Then, run `mix deps.get` in your shell to fetch the new dependency.
## Usage
__Jaro–Winkler:__
```elixir
Simetric.Jaro.Winkler.compare("dwayne", "duane") # => 0.8400000000000001
Simetric.Jaro.Winkler.compare("hardin", "martinez") # => 0.7222222222222222
Simetric.Jaro.Winkler.compare("same", "same") # => 1.0
```__Levenshtein:__
```elixir
Simetric.Levenshtein.compare("gumbo", "gambol") # => 2
Simetric.Levenshtein.compare("kitten", "sitting") # => 3
```## License
Simetric is released under [the ISC license](LICENSE).