pub struct Match<'t> { /* private fields */ }Expand description
A single match in the text.
Implementations§
Source§impl<'t> Match<'t>
impl<'t> Match<'t>
Sourcepub fn similarity(&self) -> f32
pub fn similarity(&self) -> f32
Get the similarity score (0.0 - 1.0).
Sourcepub fn edits(&self) -> &EditCounts
pub fn edits(&self) -> &EditCounts
Get the edit counts.
Sourcepub fn total_edits(&self) -> u8
pub fn total_edits(&self) -> u8
Get the total number of edits.
Sourcepub fn fuzzy_counts(&self) -> (u32, u32, u32)
pub fn fuzzy_counts(&self) -> (u32, u32, u32)
Get fuzzy counts as (insertions, deletions, substitutions).
This matches the API of mrab-regex’s fuzzy_counts property.
- insertions: characters in the text not in the pattern
- deletions: characters in the pattern not in the text
- substitutions: characters that differ between pattern and text
Sourcepub fn fuzzy_changes(&self) -> (Vec<usize>, Vec<usize>, Vec<usize>)
pub fn fuzzy_changes(&self) -> (Vec<usize>, Vec<usize>, Vec<usize>)
Get fuzzy changes as (insertions, deletions, substitutions).
This matches the API of mrab-regex’s fuzzy_changes property.
Returns positions within the matched text where edits occurred.
Note: This requires the original pattern to compute accurately. If the pattern was not provided during matching, returns empty vectors.
Trait Implementations§
Auto Trait Implementations§
impl<'t> Freeze for Match<'t>
impl<'t> RefUnwindSafe for Match<'t>
impl<'t> Send for Match<'t>
impl<'t> Sync for Match<'t>
impl<'t> Unpin for Match<'t>
impl<'t> UnsafeUnpin for Match<'t>
impl<'t> UnwindSafe for Match<'t>
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