pub struct TokenSet<D: DistanceMetric> { /* private fields */ }Expand description
A TokenSet distance modifies the distance of its inner DistanceMetric
to adjust for differences in word orders and word numbers by comparing the
intersection of two str with each str.
http://chairnerd.seatgeek.com/fuzzywuzzy-fuzzy-string-matching-in-python/
Implementations§
Trait Implementations§
Source§impl<D: DistanceMetric> DistanceMetric for TokenSet<D>
impl<D: DistanceMetric> DistanceMetric for TokenSet<D>
Source§type Dist = <D as DistanceMetric>::Dist
type Dist = <D as DistanceMetric>::Dist
Represents the data type in which this distance is evaluated.
Source§fn distance<S, T>(&self, a: S, b: T) -> Self::Distwhere
S: IntoIterator,
T: IntoIterator,
<S as IntoIterator>::IntoIter: Clone,
<T as IntoIterator>::IntoIter: Clone,
<S as IntoIterator>::Item: PartialEq + PartialEq<<T as IntoIterator>::Item>,
<T as IntoIterator>::Item: PartialEq,
fn distance<S, T>(&self, a: S, b: T) -> Self::Distwhere
S: IntoIterator,
T: IntoIterator,
<S as IntoIterator>::IntoIter: Clone,
<T as IntoIterator>::IntoIter: Clone,
<S as IntoIterator>::Item: PartialEq + PartialEq<<T as IntoIterator>::Item>,
<T as IntoIterator>::Item: PartialEq,
Generic implementation of the metric.
Source§fn str_distance<S, T>(&self, a: S, b: T) -> Self::Dist
fn str_distance<S, T>(&self, a: S, b: T) -> Self::Dist
Evaluates the distance between two str.
Source§fn normalized<S, T>(&self, a: S, b: T) -> f64where
S: IntoIterator,
T: IntoIterator,
<S as IntoIterator>::IntoIter: Clone,
<T as IntoIterator>::IntoIter: Clone,
<S as IntoIterator>::Item: PartialEq + PartialEq<<T as IntoIterator>::Item>,
<T as IntoIterator>::Item: PartialEq,
fn normalized<S, T>(&self, a: S, b: T) -> f64where
S: IntoIterator,
T: IntoIterator,
<S as IntoIterator>::IntoIter: Clone,
<T as IntoIterator>::IntoIter: Clone,
<S as IntoIterator>::Item: PartialEq + PartialEq<<T as IntoIterator>::Item>,
<T as IntoIterator>::Item: PartialEq,
Evaluates the normalized distance between two strings
A value of ‘0.0’ corresponds to the “zero distance”, both strings are
considered equal by means of the metric, whereas a value of ‘1.0’
corresponds to the maximum distance that can exist between the strings.
Auto Trait Implementations§
impl<D> Freeze for TokenSet<D>where
D: Freeze,
impl<D> RefUnwindSafe for TokenSet<D>where
D: RefUnwindSafe,
impl<D> Send for TokenSet<D>where
D: Send,
impl<D> Sync for TokenSet<D>where
D: Sync,
impl<D> Unpin for TokenSet<D>where
D: Unpin,
impl<D> UnwindSafe for TokenSet<D>where
D: UnwindSafe,
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