MCPcopy Create free account
hub / github.com/FastLED/FastLED / _normalize_for_matching

Function _normalize_for_matching

ci/util/smart_selector.py:48–59  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

46
47
48def _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
62def _edit_distance(s1: str, s2: str) -> int:

Callers 1

_fuzzy_scoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected