Expand description
String distance/similarity calculation utilities
This module provides wrappers around strsim algorithms for fuzzy matching.
It is the measurement layer under the repair stage: every rename and
enum-value correction is scored here, and only candidates at or above
FuzzyOptions::min_similarity are applied.
§Choosing an algorithm
Algorithm | Characteristics | Best for |
|---|---|---|
Algorithm::JaroWinkler (default) | Prefix-weighted, handles transpositions | General LLM typos |
Algorithm::Levenshtein | Uniform insert/delete/substitute cost | Edit-distance semantics |
Algorithm::DamerauLevenshtein | Levenshtein + transpositions | Transposition-heavy typos |
All similarities are normalized to 0.0..=1.0 (1.0 = identical), so the
same threshold works across algorithms.
Structs§
- Match
- Match result with similarity score
Enums§
- Algorithm
- Algorithm for similarity calculation
Functions§
- find_
all_ matches - Find all matches above the minimum similarity threshold
- find_
closest - Find the closest match from a list of candidates
- similarity
- Calculate similarity between two strings