strsim-rs
Rust implementations of string similarity metrics:
- Hamming
- Levenshtein - distance & normalized
- Optimal string alignment
- Damerau-Levenshtein - distance & normalized
- Jaro and Jaro-Winkler - this implementation of Jaro-Winkler does not limit the common prefix length
The normalized versions return values between 0.0 and 1.0, where 1.0 means
an exact match.
There are also generic versions of the functions for non-string inputs.
Installation
strsim is available on crates.io. Add it to
your Cargo.toml:
[]
= "0.9.3"
Usage
Go to Docs.rs for the full documentation. You can
also clone the repo, and run $ cargo doc --open.
Examples
extern crate strsim;
use ;
Using the generic versions of the functions:
extern crate strsim;
use generic_levenshtein;
Contributing
If you don't want to install Rust itself, you can run $ ./dev for a
development CLI if you have Docker installed.
Benchmarks require a Nightly toolchain. Run $ cargo +nightly bench.