Trait rdiff::string_diff::OperationScore
[−]
[src]
pub trait OperationScore { fn insert_score(&self, c: char) -> i32; fn delete_score(&self, c: char) -> i32; fn substitution_score(&self, old: char, new: char) -> i32; fn match_score(&self, c: char) -> i32; }
Used to calculate the score for each operation that will be performed. The score can be static, or it can vary based on which character is being deleted inserted or substituted. It is highly recommended to inline the implementation of these characters
Required Methods
fn insert_score(&self, c: char) -> i32
The score for inserting character c
into the string
fn delete_score(&self, c: char) -> i32
The score for deleting character c
from the string
fn substitution_score(&self, old: char, new: char) -> i32
The score for replacing character old
with character new
fn match_score(&self, c: char) -> i32
The score for when a character is one string matches the character in the other string
Implementors
impl OperationScore for EditDistance