Crates.io | levenshtein_lite |
lib.rs | levenshtein_lite |
version | 0.1.1 |
source | src |
created_at | 2024-06-23 03:43:38.430471 |
updated_at | 2024-06-23 14:36:15.859793 |
description | No-frills implementation of a Levenshtein Automata and the Levenshtein Distance function. |
homepage | https://github.com/danmunson/levenshtein_lite |
repository | https://github.com/danmunson/levenshtein_lite |
max_upload_size | |
id | 1280952 |
size | 23,612 |
This crate provides a no-frills implementatation of a Levenshtein Automata and Levenshtein Distance function.
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);