2 releases
0.1.1 | Jun 23, 2024 |
---|---|
0.1.0 | Jun 23, 2024 |
#620 in Text processing
41 downloads per month
20KB
409 lines
Levenshtein Lite
This crate provides a no-frills implementatation of a Levenshtein Automata and Levenshtein Distance function.
Example
use levenshtein_lite::{LevenshteinAutomata, levenshtein_distance};
let lda = LevenshteinAutomata::new("abc", 1);
assert!(lda.check("abx"));
assert!(!lda.check("axx"));
assert!(levenshtein_distance("abc", "abx") == 1);
assert!(levenshtein_distance("abc", "axx") == 2);