pub struct LevelThresholds {
pub exact: f32,
pub close: f32,
pub partial: f32,
}Expand description
Configurable per-field thresholds for mapping a float similarity score to a ComparisonLevel.
The defaults are tuned per FieldKind based on the expected noise distribution
for that field type in Dutch law enforcement data.
Fields§
§exact: f32Similarity >= this gives ComparisonLevel::Exact.
close: f32Similarity >= this (and < exact) gives ComparisonLevel::Close.
partial: f32Similarity >= this (and < close) gives ComparisonLevel::Partial.
Implementations§
Source§impl LevelThresholds
impl LevelThresholds
Sourcepub fn for_kind(kind: FieldKind) -> LevelThresholds
pub fn for_kind(kind: FieldKind) -> LevelThresholds
Default thresholds tuned per FieldKind.
Sourcepub fn apply(&self, sim: f32) -> ComparisonLevel
pub fn apply(&self, sim: f32) -> ComparisonLevel
Map a raw similarity score to a ComparisonLevel.
Trait Implementations§
Source§impl Clone for LevelThresholds
impl Clone for LevelThresholds
Source§fn clone(&self) -> LevelThresholds
fn clone(&self) -> LevelThresholds
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 moreAuto Trait Implementations§
impl Freeze for LevelThresholds
impl RefUnwindSafe for LevelThresholds
impl Send for LevelThresholds
impl Sync for LevelThresholds
impl Unpin for LevelThresholds
impl UnsafeUnpin for LevelThresholds
impl UnwindSafe for LevelThresholds
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more