fuzzy_matcher

Trait FuzzyMatcher

Source
pub trait FuzzyMatcher: Send + Sync {
    // Required method
    fn fuzzy_indices(
        &self,
        choice: &str,
        pattern: &str,
    ) -> Option<(i64, Vec<usize>)>;

    // Provided method
    fn fuzzy_match(&self, choice: &str, pattern: &str) -> Option<i64> { ... }
}

Required Methods§

Source

fn fuzzy_indices( &self, choice: &str, pattern: &str, ) -> Option<(i64, Vec<usize>)>

fuzzy match choice with pattern, and return the score & matched indices of characters

Provided Methods§

Source

fn fuzzy_match(&self, choice: &str, pattern: &str) -> Option<i64>

fuzzy match choice with pattern, and return the score of matching

Implementors§

Source§

impl FuzzyMatcher for ClangdMatcher

Source§

impl FuzzyMatcher for SkimMatcher

The V1 matcher is based on ForrestTheWoods’s post https://www.forrestthewoods.com/blog/reverse_engineering_sublime_texts_fuzzy_match/

V1 algorithm is deprecated, checkout FuzzyMatcherV2

Source§

impl FuzzyMatcher for SkimMatcherV2