pub struct FuzzyCorrection {
pub token: &'static str,
pub distance: u8,
pub confidence: f32,
}Expand description
A correction candidate produced by FuzzyVocabMatcher::correct.
Callers should multiply confidence by a context factor before comparing
against the engine threshold:
- Inside a detected marking region (between
//boundaries or(...)): multiply by1.0 + 0.15 * context_strength(practical range 1.10–1.15). - In open prose with no structural signal: use
confidenceas-is.
Fields§
§token: &'static strThe suggested canonical token from the vocabulary.
distance: u8Levenshtein edit distance between the input and token.
confidence: f32Base confidence score in [0.0, 1.0].
Derived from distance and token length. Does not include a
context factor — callers should apply one before thresholding.
Trait Implementations§
Source§impl Clone for FuzzyCorrection
impl Clone for FuzzyCorrection
Source§fn clone(&self) -> FuzzyCorrection
fn clone(&self) -> FuzzyCorrection
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 FuzzyCorrection
impl Debug for FuzzyCorrection
Source§impl PartialEq for FuzzyCorrection
impl PartialEq for FuzzyCorrection
impl StructuralPartialEq for FuzzyCorrection
Auto Trait Implementations§
impl Freeze for FuzzyCorrection
impl RefUnwindSafe for FuzzyCorrection
impl Send for FuzzyCorrection
impl Sync for FuzzyCorrection
impl Unpin for FuzzyCorrection
impl UnsafeUnpin for FuzzyCorrection
impl UnwindSafe for FuzzyCorrection
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