[][src]Struct str_distance::qgram::QGram

pub struct QGram { /* fields omitted */ }

Represents a QGram metric where q is the length of a q-gram fragment.

The distance corresponds to

    ||v(s1, q) - v(s2, q)||

where v(s, q) denotes the vec on the space of q-grams of length q, that contains the number of times a q-gram fragment appears for the str s

Methods

impl QGram[src]

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

Creates a new [QGram] of length q.

Panics

Panics if q is 0.

Trait Implementations

impl Clone for QGram[src]

impl Debug for QGram[src]

impl DistanceMetric for QGram[src]

type Dist = usize

Represents the data type in which this distance is evaluated.

Auto Trait Implementations

impl RefUnwindSafe for QGram

impl Send for QGram

impl Sync for QGram

impl Unpin for QGram

impl UnwindSafe for QGram

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.