6 stable releases
Uses old Rust 2015
1.0.5 | Feb 22, 2021 |
---|---|
1.0.4 | Apr 16, 2019 |
1.0.3 | Jul 6, 2017 |
1.0.1 | Feb 15, 2017 |
1.0.0 | Feb 9, 2016 |
#96 in Algorithms
550,464 downloads per month
Used in 204 crates
(33 directly)
3KB
levenshtein.rs
Vladimir Levenshtein’s edit distance algorithm as a Rust library. There’s also a C library, C user command, and JavaScript module.
🎉 This is my first attempt at Rust!
Installation
[dependencies]
levenshtein = "1.0.5"
Usage
extern crate levenshtein;
use levenshtein::levenshtein;
fn main() {
println!("{}", levenshtein("kitten", "sitting"));
}
Yields:
3
API
fn levenshtein(a: &str, b: &str) -> usize
Given two strings, returns the edit distance between them.