[][src]Trait weighted_levenshtein::EditWeight

pub trait EditWeight {
    fn add_cost(&self) -> usize;
fn rm_cost(&self) -> usize;
fn sub_cost(&self, other: &Self) -> usize; }

Trait for types that have custom costs for addition/removal and substitution.

Required methods

fn add_cost(&self) -> usize

Cost of adding this item to a sequence

fn rm_cost(&self) -> usize

Cost of removing this item from a sequence

fn sub_cost(&self, other: &Self) -> usize

Cost of substituting other for this item. Note: edit distance is only well-defined when self.sub_cost(&self) == 0

Loading content...

Implementations on Foreign Types

impl EditWeight for u8[src]

impl<'_> EditWeight for &'_ str[src]

Loading content...

Implementors

Loading content...