pub struct SkimScoreConfig {
pub score_match: i32,
pub gap_start: i32,
pub gap_extension: i32,
pub bonus_first_char_multiplier: i32,
pub bonus_head: i32,
pub bonus_break: i32,
pub bonus_camel: i32,
pub bonus_consecutive: i32,
pub penalty_case_mismatch: i32,
}
Fields§
§score_match: i32
§gap_start: i32
§gap_extension: i32
§bonus_first_char_multiplier: i32
The first character in the typed pattern usually has more significance than the rest so it’s important that it appears at special positions where bonus points are given. e.g. “to-go” vs. “ongoing” on “og” or on “ogo”. The amount of the extra bonus should be limited so that the gap penalty is still respected.
bonus_head: i32
We prefer matches at the beginning of a word, but the bonus should not be too great to prevent the longer acronym matches from always winning over shorter fuzzy matches. The bonus point here was specifically chosen that the bonus is cancelled when the gap between the acronyms grows over 8 characters, which is approximately the average length of the words found in web2 dictionary and my file system.
bonus_break: i32
Just like bonus_head, but its breakage of word is not that strong, so it should be slighter less then bonus_head
bonus_camel: i32
Edge-triggered bonus for matches in camelCase words. Compared to word-boundary case, they don’t accompany single-character gaps (e.g. FooBar vs. foo-bar), so we deduct bonus point accordingly.
bonus_consecutive: i32
Minimum bonus point given to characters in consecutive chunks. Note that bonus points for consecutive matches shouldn’t have needed if we used fixed match score as in the original algorithm.
penalty_case_mismatch: i32
Skim will match case-sensitively if the pattern contains ASCII upper case, If case of case insensitive match, the penalty will be given to case mismatch
Trait Implementations§
Source§impl Clone for SkimScoreConfig
impl Clone for SkimScoreConfig
Source§fn clone(&self) -> SkimScoreConfig
fn clone(&self) -> SkimScoreConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more