pub struct EditDistance;Expand description
Levenshtein edit distance calculator.
Implementations§
Source§impl EditDistance
impl EditDistance
Sourcepub fn bytes(a: &[u8], b: &[u8]) -> usize
pub fn bytes(a: &[u8], b: &[u8]) -> usize
Compute the Levenshtein distance between two byte slices.
Sourcepub fn strings(a: &str, b: &str) -> usize
pub fn strings(a: &str, b: &str) -> usize
Compute the Levenshtein distance between two strings.
Sourcepub fn similarity(a: &str, b: &str) -> FuzzyScore
pub fn similarity(a: &str, b: &str) -> FuzzyScore
Convert edit distance to a normalised similarity score.
Auto Trait Implementations§
impl Freeze for EditDistance
impl RefUnwindSafe for EditDistance
impl Send for EditDistance
impl Sync for EditDistance
impl Unpin for EditDistance
impl UnsafeUnpin for EditDistance
impl UnwindSafe for EditDistance
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more