pub struct FuzzyScore { /* private fields */ }Expand description
A normalised similarity score in the range [0.0, 1.0].
1.0means an exact match.0.0means completely dissimilar.
Implementations§
Source§impl FuzzyScore
impl FuzzyScore
Sourcepub fn meets_threshold(self, threshold: f64) -> bool
pub fn meets_threshold(self, threshold: f64) -> bool
Check whether the score meets a given threshold.
Sourcepub fn weighted_average(scores: &[(Self, f64)]) -> Self
pub fn weighted_average(scores: &[(Self, f64)]) -> Self
Combine two scores using a weighted average.
Trait Implementations§
Source§impl Clone for FuzzyScore
impl Clone for FuzzyScore
Source§fn clone(&self) -> FuzzyScore
fn clone(&self) -> FuzzyScore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FuzzyScore
Source§impl Debug for FuzzyScore
impl Debug for FuzzyScore
Source§impl Display for FuzzyScore
impl Display for FuzzyScore
Source§impl PartialEq for FuzzyScore
impl PartialEq for FuzzyScore
Auto Trait Implementations§
impl Freeze for FuzzyScore
impl RefUnwindSafe for FuzzyScore
impl Send for FuzzyScore
impl Sync for FuzzyScore
impl Unpin for FuzzyScore
impl UnsafeUnpin for FuzzyScore
impl UnwindSafe for FuzzyScore
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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