[−][src]Struct str_distance::qgram::Overlap
Represents a Overlap metric where q
is the length of a q-gram
fragment.
The distance corresponds to
1 - |Q(s1, q) ∩ Q(s2, q)| / min(|Q(s1, q)|, |Q(s2, q)|)
where Q(s, q)
denotes the set of q-grams of length n for the str s
If both inputs are empty a value of 1.
is returned. If one input is empty
and the other is not, a value of 0.
is returned. This avoids a return of
f64::NaN
for those cases.
Methods
impl Overlap
[src]
Trait Implementations
impl Clone for Overlap
[src]
impl Debug for Overlap
[src]
impl Default for Overlap
[src]
impl DistanceMetric for Overlap
[src]
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 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_distance<S, T>(&self, a: S, b: T) -> Self::Dist where
S: AsRef<str>,
T: AsRef<str>,
[src]
S: AsRef<str>,
T: AsRef<str>,
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 RefUnwindSafe for Overlap
impl Send for Overlap
impl Sync for Overlap
impl Unpin for Overlap
impl UnwindSafe for Overlap
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>,