pub struct LevenshteinMetric2 {
pub max_dist: Option<usize>,
}Expand description
Levenshtein metric (version 2) with additional operations.
Fields§
§max_dist: Option<usize>Maximum allowed distance (None = unlimited).
Implementations§
Source§impl LevenshteinMetric2
impl LevenshteinMetric2
Sourcepub fn within_threshold(&self, a: &str, b: &str) -> bool
pub fn within_threshold(&self, a: &str, b: &str) -> bool
Check if distance is within threshold.
Sourcepub fn identity_law(&self, a: &str) -> bool
pub fn identity_law(&self, a: &str) -> bool
Check metric identity: d(a, a) = 0.
Sourcepub fn symmetry_law(&self, a: &str, b: &str) -> bool
pub fn symmetry_law(&self, a: &str, b: &str) -> bool
Check metric symmetry: d(a, b) = d(b, a).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LevenshteinMetric2
impl RefUnwindSafe for LevenshteinMetric2
impl Send for LevenshteinMetric2
impl Sync for LevenshteinMetric2
impl Unpin for LevenshteinMetric2
impl UnsafeUnpin for LevenshteinMetric2
impl UnwindSafe for LevenshteinMetric2
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