Skip to main content

get_close_matches

Function get_close_matches 

Source
pub fn get_close_matches(
    word: &str,
    possibilities: &[String],
    n: usize,
    cutoff: f64,
) -> Vec<String>
Expand description

difflib.get_close_matches(word, possibilities, n, cutoff).

CPython sets word as sequence b and each possibility as a, then takes the n largest (ratio, possibility) tuples — so a tie is broken by the possibility that sorts later.