https://github.com/primait/ex_fuzzywuzzy
https://github.com/primait/ex_fuzzywuzzy
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/primait/ex_fuzzywuzzy
- Owner: primait
- License: mit
- Created: 2021-03-15T13:52:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-09-23T09:49:02.000Z (10 months ago)
- Last Synced: 2025-09-23T11:28:06.586Z (10 months ago)
- Language: Elixir
- Homepage:
- Size: 53.7 KB
- Stars: 4
- Watchers: 48
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# ExFuzzywuzzy
[](https://github.com/primait/ex_fuzzywuzzy/actions/workflows/ci.yml)
[](https://hex.pm/packages/ex_fuzzywuzzy)
[](https://hexdocs.pm/ex_fuzzywuzzy/)
[](https://hex.pm/packages/ex_fuzzywuzzy)
[](https://hex.pm/packages/ex_fuzzywuzzy)
[](https://github.com/primait/ex_fuzzywuzzy/commits/master)
ExFuzzyWuzzy is a fuzzy string matching library that provides many ways of calculating
a matching ratio between two strings, starting from a similarity function which can be
based on Levenshtein or Jaro-Winkler or a custom one.
The library is an Elixir port of SeatGeek's [fuzzywuzzy](https://github.com/seatgeek/fuzzywuzzy).
## Installation
To install ExFuzzyWuzzy, just add an entry to your `mix.exs`:
```elixir
def deps do
[
{:ex_fuzzywuzzy, "~> 0.3.0"}
]
end
```
## Usage
Choose the ratio function which fits best your needs among the available,
providing the two strings to be matched and - if needed - overwriting options
over the configured ones.
Available methods are:
- Simple ratio
- Quick ratio
- Partial ratio
- Token sort ratio
- Partial token sort ratio
- Token set ratio
- Partial token set ratio
- Best score ratio
Available options are:
- Similarity function (Levenshtein and Jaro-Winkler provided in library)
- Case sensitiveness of match
- Decimal precision of output score
Here are some examples.
### Simple ratio
```elixir
iex> ExFuzzywuzzy.ratio("this is a test", "this is a test!")
96.55
```
### Quick ratio
```elixir
iex> ExFuzzywuzzy.quick_ratio("this is a test", "this is a test!")
100.0
```
### Partial ratio
```elixir
iex> ExFuzzywuzzy.partial_ratio("this is a test", "this is a test!")
100.0
```
### Best Score ratio
```elixir
iex> ExFuzzywuzzy.best_score_ratio("this is a test", "this is a test!")
{:quick, 100.0}
```
## Contributing
Thank your for considering helping with this project. Please see
`CONTRIBUTING.md` file for contributing to this project.
## License
MIT License. Copyright (c) 2015-2024 Prima.it