Skip to main content

string_score

Function string_score 

Source
pub fn string_score(text: &str, word: &str) -> f64
Expand description

How well word matches text by Eagle’s quick-search score (the string_score method): 1 for identical strings, 0 when the letters of word do not all appear in order, otherwise a score rewarding letters that follow each other, start a word or keep their case, and a shared first letter. Lengths and positions are in UTF-16 units, as in JavaScript.