[−][src]Struct str_distance::modifiers::Winkler
Winkler
modifies a DistanceMetric
's distance to decrease the distance
between two strings, when their original distance is below some
threshold
. The boost is equal to min(l, maxlength) * p * dist
where l
denotes the length of their common prefix and dist
denotes the original
distance. The Winkler adjustment was originally defined for the Jaro
similarity score but is here defined it for any distance.
Methods
impl<D: DistanceMetric> Winkler<D>
[src]
pub fn new(inner: D) -> Self
[src]
pub fn with_config(inner: D, config: WinklerConfig) -> Self
[src]
Trait Implementations
impl<D: Clone + DistanceMetric> Clone for Winkler<D>
[src]
impl<D: Debug + DistanceMetric> Debug for Winkler<D>
[src]
impl Default for Winkler<Jaro>
[src]
impl<D> DistanceMetric for Winkler<D> where
D: DistanceMetric,
<D as DistanceMetric>::Dist: Into<f64>,
[src]
D: DistanceMetric,
<D as DistanceMetric>::Dist: Into<f64>,
type Dist = f64
Represents the data type in which this distance is evaluated.
fn distance<S, T>(&self, a: S, b: T) -> Self::Dist where
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,
[src]
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 str_distance<S, T>(&self, s1: S, s2: T) -> Self::Dist where
S: AsRef<str>,
T: AsRef<str>,
[src]
S: AsRef<str>,
T: AsRef<str>,
fn normalized<S, T>(&self, a: S, b: T) -> f64 where
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,
[src]
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 str_normalized<S, T>(&self, a: S, b: T) -> f64 where
S: AsRef<str>,
T: AsRef<str>,
[src]
S: AsRef<str>,
T: AsRef<str>,
Auto Trait Implementations
impl<D> RefUnwindSafe for Winkler<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for Winkler<D> where
D: Send,
D: Send,
impl<D> Sync for Winkler<D> where
D: Sync,
D: Sync,
impl<D> Unpin for Winkler<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for Winkler<D> where
D: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,