use str_edit_distance::{ damerau_levenshtein, dice_coefficient, hamming, jaro_winkler, levenshtein, }; fn main() { // Levenshtein Distance let lev_distance = levenshtein("kitten", "sitting"); println!( "The Levenshtein distance between 'kitten' and 'sitting' is: {}", lev_distance.unwrap() ); // Damerau-Levenshtein Distance let dam_lev_distance = damerau_levenshtein("ca", "abc"); println!( "The Damerau-Levenshtein distance between 'ca' and 'abc' is: {}", dam_lev_distance.unwrap() ); // Hamming Distance let ham_distance = hamming("karolin", "kathrin"); println!( "The Hamming distance between 'karolin' and 'kathrin' is: {}", ham_distance.unwrap() ); // Jaro-Winkler Distance let jw_distance = jaro_winkler("martha", "marhta"); println!( "The Jaro-Winkler distance between 'martha' and 'marhta' is: {:.3}", jw_distance.unwrap() ); // Dice's Coefficient Distance let dice_distance = dice_coefficient("night", "nacth"); println!( "The Dice's Coefficient distance between 'night' and 'nacth' is: {:.3}", dice_distance.unwrap() ); }