Normalize a string for fuzzy matching by treating spaces, underscores, and hyphens as equivalent. Args: s: String to normalize Returns: Normalized string with spaces/underscores/hyphens removed
(s: str)
| 46 | |
| 47 | |
| 48 | def _normalize_for_matching(s: str) -> str: |
| 49 | """Normalize a string for fuzzy matching by treating spaces, underscores, and hyphens as equivalent. |
| 50 | |
| 51 | Args: |
| 52 | s: String to normalize |
| 53 | |
| 54 | Returns: |
| 55 | Normalized string with spaces/underscores/hyphens removed |
| 56 | """ |
| 57 | # Replace common separators with empty string for matching |
| 58 | # This allows "string interner" to match "string_interner" |
| 59 | return s.replace(" ", "").replace("_", "").replace("-", "") |
| 60 | |
| 61 | |
| 62 | def _edit_distance(s1: str, s2: str) -> int: |