pub trait StringMetric {
// Required method
fn distance(&self, s1: &str, s2: &str) -> Result<f64>;
// Provided methods
fn normalized_distance(&self, s1: &str, s2: &str) -> Result<f64> { ... }
fn similarity(&self, s1: &str, s2: &str) -> Result<f64> { ... }
}Expand description
Trait for string distance metrics