pub struct FuzzyPenalties {
pub insertion: f32,
pub deletion: f32,
pub substitution: f32,
pub swap: f32,
}Expand description
Penalty weights for different edit operations.
These weights are used to calculate a weighted edit distance where different operations can have different costs. Lower penalties mean the operation is considered “cheaper” during matching.
Fields§
§insertion: f32Penalty for inserting a character (extra char in text).
deletion: f32Penalty for deleting a character (missing char from pattern).
substitution: f32Penalty for substituting a character.
swap: f32Penalty for swapping adjacent characters.
Implementations§
Source§impl FuzzyPenalties
impl FuzzyPenalties
Sourcepub fn substitution(self, penalty: f32) -> Self
pub fn substitution(self, penalty: f32) -> Self
Set the substitution penalty.
Trait Implementations§
Source§impl Clone for FuzzyPenalties
impl Clone for FuzzyPenalties
Source§fn clone(&self) -> FuzzyPenalties
fn clone(&self) -> FuzzyPenalties
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 FuzzyPenalties
impl Debug for FuzzyPenalties
Auto Trait Implementations§
impl Freeze for FuzzyPenalties
impl RefUnwindSafe for FuzzyPenalties
impl Send for FuzzyPenalties
impl Sync for FuzzyPenalties
impl Unpin for FuzzyPenalties
impl UnsafeUnpin for FuzzyPenalties
impl UnwindSafe for FuzzyPenalties
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