pub struct BayesianScorer {
pub track_evidence: bool,
}Expand description
Bayesian fuzzy matcher for command palette.
Computes relevance scores using a probabilistic model with evidence tracking for explainable ranking.
Fields§
§track_evidence: boolWhether to track detailed evidence (slower but explainable).
Implementations§
Source§impl BayesianScorer
impl BayesianScorer
Sourcepub fn score(&self, query: &str, title: &str) -> MatchResult
pub fn score(&self, query: &str, title: &str) -> MatchResult
Score a query against a title.
Returns a MatchResult with score, match type, positions, and evidence.
Sourcepub fn score_with_query_lower(
&self,
query: &str,
query_lower: &str,
title: &str,
) -> MatchResult
pub fn score_with_query_lower( &self, query: &str, query_lower: &str, title: &str, ) -> MatchResult
Score a query using a pre-lowercased query string.
This avoids repeated query normalization when scoring against many titles.
Sourcepub fn score_with_lowered_title(
&self,
query: &str,
query_lower: &str,
title: &str,
title_lower: &str,
) -> MatchResult
pub fn score_with_lowered_title( &self, query: &str, query_lower: &str, title: &str, title_lower: &str, ) -> MatchResult
Score a query with both query and title already lowercased.
This avoids per-title lowercasing in hot loops.
Sourcepub fn score_with_lowered_title_and_words(
&self,
query: &str,
query_lower: &str,
title: &str,
title_lower: &str,
word_starts: Option<&[usize]>,
) -> MatchResult
pub fn score_with_lowered_title_and_words( &self, query: &str, query_lower: &str, title: &str, title_lower: &str, word_starts: Option<&[usize]>, ) -> MatchResult
Score a query with pre-lowercased title and optional word-start cache.
Score a query against a title with tags.
Trait Implementations§
Source§impl Clone for BayesianScorer
impl Clone for BayesianScorer
Source§fn clone(&self) -> BayesianScorer
fn clone(&self) -> BayesianScorer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BayesianScorer
impl Debug for BayesianScorer
Source§impl Default for BayesianScorer
impl Default for BayesianScorer
Source§fn default() -> BayesianScorer
fn default() -> BayesianScorer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BayesianScorer
impl RefUnwindSafe for BayesianScorer
impl Send for BayesianScorer
impl Sync for BayesianScorer
impl Unpin for BayesianScorer
impl UnsafeUnpin for BayesianScorer
impl UnwindSafe for BayesianScorer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more