pub struct Levenshtein;
Expand description
This calculates the Levenshtein distance between two strings.
The distance metric itself is calculated using the Wagner-Fischer dynamic programming algorithm.
§Examples
use bk_tree::Metric;
use bk_tree::metrics::Levenshtein;
assert_eq!(Levenshtein.distance("bar", "baz"), 1);
assert_eq!(Levenshtein.distance("kitten", "sitting"), 3);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Levenshtein
impl RefUnwindSafe for Levenshtein
impl Send for Levenshtein
impl Sync for Levenshtein
impl Unpin for Levenshtein
impl UnwindSafe for Levenshtein
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more