Skip to main content

rank_names

Function rank_names 

Source
pub fn rank_names<'a>(
    names: impl IntoIterator<Item = &'a str>,
    keyword: &str,
) -> Vec<usize>
Expand description

Ranks names against a typed keyword as Eagle’s tag and folder filter searches and Go to Folder do: the keyword loses its spaces, both sides go through rank_key, names scoring 0 are dropped and the rest are ordered best first (ties keep their order). Returns indices into names. (Eagle also scores the pinyin of Chinese names; falcon does not.)