pub struct TokenSort<D: DistanceMetric> { /* private fields */ }Expand description
TokenSort modifies the inner string distance dist to adjust for
differences in word orders by reording words alphabetically.
For other types than strings this is just a delegate to the inner metric.
Trait Implementations§
Source§impl<D> DistanceMetric for TokenSort<D>where
D: DistanceMetric,
impl<D> DistanceMetric for TokenSort<D>where
D: DistanceMetric,
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 TokenSort<D>where
D: Freeze,
impl<D> RefUnwindSafe for TokenSort<D>where
D: RefUnwindSafe,
impl<D> Send for TokenSort<D>where
D: Send,
impl<D> Sync for TokenSort<D>where
D: Sync,
impl<D> Unpin for TokenSort<D>where
D: Unpin,
impl<D> UnwindSafe for TokenSort<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