https://github.com/joshuaclayton/jaro_winkler
A fast implementation of Jaro-Winkler distance comparing two &str values.
https://github.com/joshuaclayton/jaro_winkler
edit-distance jaro-winkler string-comparison
Last synced: 2 months ago
JSON representation
A fast implementation of Jaro-Winkler distance comparing two &str values.
- Host: GitHub
- URL: https://github.com/joshuaclayton/jaro_winkler
- Owner: joshuaclayton
- License: mit
- Created: 2022-11-24T04:15:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-14T22:59:39.000Z (over 1 year ago)
- Last Synced: 2024-03-15T06:04:11.133Z (about 1 year ago)
- Topics: edit-distance, jaro-winkler, string-comparison
- Language: Rust
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jaro_winkler
A fast implementation of [Jaro-Winkler distance] comparing two
`&str` values.[Jaro-Winkler distance]: https://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance
## Usage
Add `jaro_winkler` to your `Cargo.toml`:
```toml
[dependencies]
jaro_winkler = "0.1.0"
```## Benchmarks
See [benches/bench.rs](benches/bench.rs).
Comparing different lengths results in different execution times.
On my 2021 M1 Mac, benchmark results compared against [strsim] and [eddie]:
| character lengths | jaro_winkler | strsim | eddie |
|-------------------|--------------|---------|---------|
| 9, 10 | 40ns | 90ns | 102ns |
| 4, 5 | 19ns | 47ns | 82ns |
| 4, 25 | 21ns | 106ns | 97ns |
| 223, 29 | 498ns | 2815ns | 1168ns |
| 223, 188 | 10147ns | 25195ns | 12080ns |[strsim]: https://github.com/dguo/strsim-rs
[eddie]: https://github.com/thaumant/eddie## Copyright
Copyright 2022 Josh Clayton. See the [LICENSE](LICENSE).