[][src]Struct str_distance::levenshtein::DamerauLevenshtein

pub struct DamerauLevenshtein { /* fields omitted */ }

Specify a maximum distance. Specifying a maximum distance allows short circuit exit after exceeding the maximum distance and less cell evaluation. It essentially changes the time complexity from being the product of the two string lengths to being just the length of the shorter string

See http://blog.softwx.net/2015/01/optimizing-damerau-levenshtein_15.html Note that this is based on Sten Hjelmqvist's "Fast, memory efficient" algorithm, described at http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm. This version differs by including some optimizations, and extending it to the Damerau- Levenshtein algorithm. Note that this is the simpler and faster optimal string alignment (aka restricted edit) distance that difers slightly from the classic Damerau-Levenshtein algorithm by imposing the restriction that no substring is edited more than once. So for example, "CA" to "ABC" has an edit distance of 2 by a complete application of Damerau-Levenshtein, but a distance of 3 by this method that uses the optimal string alignment algorithm. See wikipedia article for more detail on this distinction.

Methods

impl DamerauLevenshtein[src]

pub fn with_max_distance(max_distance: usize) -> Self[src]

Trait Implementations

impl Clone for DamerauLevenshtein[src]

impl Debug for DamerauLevenshtein[src]

impl Default for DamerauLevenshtein[src]

impl DistanceMetric for DamerauLevenshtein[src]

type Dist = DistanceValue

Represents the data type in which this distance is evaluated.

Auto Trait Implementations

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.