fuzzy_matcher::skim

Struct SkimScoreConfig

Source
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

Source§

fn clone(&self) -> SkimScoreConfig

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for SkimScoreConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for SkimScoreConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.