[][src]Struct str_distance::qgram::Overlap

pub struct Overlap { /* fields omitted */ }

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]

pub fn new(q: usize) -> Self[src]

Creates a new [Overlap] of length q.

Panics

Panics if q is 0.

Trait Implementations

impl Clone for Overlap[src]

impl Debug for Overlap[src]

impl Default for Overlap[src]

fn default() -> Self[src]

Use a monogram as default overlap fragment length.

impl DistanceMetric for Overlap[src]

type Dist = f64

Represents the data type in which this distance is evaluated.

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.