A generic implementation of the Levenshtein distance that allows weighting operations.
This crate can work on slices of any kind. It can therefore:
rust
assert_eq!(distance ("abc", "aaxcc"), 3);
rust
assert_eq!(
distance (
"The quick brown fox".split (' ').collect::<Vec<_>>(),
"The very quick brown cat".split (' ').collect()),
2);
rust
assert_eq!(distance (vec![1, 2, 3], vec![0, 1, 3, 3, 4]), 3);
This crate allows defining custom weights for each operation on each symbol.