Lines Matching refs:levenshtein
236 pub fn levenshtein(a: &str, b: &str) -> usize { in levenshtein() function
256 1.0 - (levenshtein(a, b) as f64) / (a.chars().count().max(b.chars().count()) as f64) in normalized_levenshtein()
695 assert_eq!(0, levenshtein("", "")); in levenshtein_empty()
700 assert_eq!(0, levenshtein("levenshtein", "levenshtein")); in levenshtein_same()
705 assert_eq!(3, levenshtein("kitten", "sitting")); in levenshtein_diff_short()
710 assert_eq!(5, levenshtein("hello, world", "bye, world")); in levenshtein_diff_with_space()
715 assert_eq!(3, levenshtein("öঙ香", "abc")); in levenshtein_diff_multibyte()
716 assert_eq!(3, levenshtein("abc", "öঙ香")); in levenshtein_diff_multibyte()
723 assert_eq!(37, levenshtein(a, b)); in levenshtein_diff_longer()
728 assert_eq!(7, levenshtein("", "sitting")); in levenshtein_first_empty()
733 assert_eq!(6, levenshtein("kitten", "")); in levenshtein_second_empty()