pub struct LexicalScorer;Expand description
Dependency-free scorer: cosine similarity over Unicode word term-frequency vectors.
Deterministic and offline — the reference scorer for the working tier and tests.
Implementations§
Trait Implementations§
Source§impl Clone for LexicalScorer
impl Clone for LexicalScorer
Source§fn clone(&self) -> LexicalScorer
fn clone(&self) -> LexicalScorer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LexicalScorer
impl Debug for LexicalScorer
Source§impl Default for LexicalScorer
impl Default for LexicalScorer
Source§fn default() -> LexicalScorer
fn default() -> LexicalScorer
Returns the “default value” for a type. Read more
Source§impl SemanticScorer for LexicalScorer
impl SemanticScorer for LexicalScorer
Source§fn similarity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
document: &'life2 str,
) -> Pin<Box<dyn Future<Output = f64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn similarity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
document: &'life2 str,
) -> Pin<Box<dyn Future<Output = f64> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Similarity between
query and document in [0, 1].Auto Trait Implementations§
impl Freeze for LexicalScorer
impl RefUnwindSafe for LexicalScorer
impl Send for LexicalScorer
impl Sync for LexicalScorer
impl Unpin for LexicalScorer
impl UnsafeUnpin for LexicalScorer
impl UnwindSafe for LexicalScorer
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