Crates.io | levenshtein |
lib.rs | levenshtein |
version | 1.0.5 |
source | src |
created_at | 2016-02-09 16:11:54.828913 |
updated_at | 2021-02-22 09:21:50.932859 |
description | Levenshtein algorithm |
homepage | |
repository | https://github.com/wooorm/levenshtein-rs |
max_upload_size | |
id | 4137 |
size | 3,035 |
Vladimir Levenshtein’s edit distance algorithm as a Rust library. There’s also a C library, C user command, and JavaScript module.
:tada: This is my first attempt at Rust!
[dependencies]
levenshtein = "1.0.5"
extern crate levenshtein;
use levenshtein::levenshtein;
fn main() {
println!("{}", levenshtein("kitten", "sitting"));
}
Yields:
3
fn levenshtein(a: &str, b: &str) -> usize
Given two strings, returns the edit distance between them.