pub struct ContextScore {
pub adjustment: f64,
pub positive_hits: usize,
pub code_like: bool,
}Expand description
Result of context scoring.
§Examples
use cloakrs_core::{context_score, ContextConfig, Span};
let score = context_score(
"email jane@example.com",
Span::new(6, 22),
&["email"],
&ContextConfig::default(),
);
assert!(score.adjustment > 0.0);Fields§
§adjustment: f64Adjustment to add to a recognizer’s base confidence.
positive_hits: usizeNumber of matching positive context terms.
code_like: boolWhether code-like context was detected.
Trait Implementations§
Source§impl Clone for ContextScore
impl Clone for ContextScore
Source§fn clone(&self) -> ContextScore
fn clone(&self) -> ContextScore
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 ContextScore
impl Debug for ContextScore
Source§impl<'de> Deserialize<'de> for ContextScore
impl<'de> Deserialize<'de> for ContextScore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContextScore
impl PartialEq for ContextScore
Source§fn eq(&self, other: &ContextScore) -> bool
fn eq(&self, other: &ContextScore) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContextScore
impl Serialize for ContextScore
impl Copy for ContextScore
impl StructuralPartialEq for ContextScore
Auto Trait Implementations§
impl Freeze for ContextScore
impl RefUnwindSafe for ContextScore
impl Send for ContextScore
impl Sync for ContextScore
impl Unpin for ContextScore
impl UnsafeUnpin for ContextScore
impl UnwindSafe for ContextScore
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