mirror of
https://github.com/nextlevelbuilder/ui-ux-pro-max-skill.git
synced 2026-11-28 22:30:32 +00:00
perf: skip synonym replacements when no rule matches (#593)
This commit is contained in:
parent
f823ab5fb9
commit
e8b065f0f3
@ -310,10 +310,17 @@ _SYNONYM_PATTERNS = [
|
||||
for variant, canonical in sorted(_SYNONYMS.items(), key=lambda item: len(item[0]), reverse=True)
|
||||
]
|
||||
|
||||
_SYNONYM_CANDIDATE_RE = re.compile(
|
||||
r"(?<!\w)(?:" + "|".join(map(re.escape, _SYNONYMS)) + r")(?!\w)",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
|
||||
def _normalize(text):
|
||||
"""Apply Arabic diacritic stripping and longest-first synonym substitution at token boundaries."""
|
||||
normalized = _ARABIC_DIACRITICS_RE.sub("", str(text))
|
||||
if not _SYNONYM_CANDIDATE_RE.search(normalized):
|
||||
return normalized
|
||||
for pattern, canonical in _SYNONYM_PATTERNS:
|
||||
normalized = pattern.sub(canonical, normalized)
|
||||
return normalized
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"schemaVersion": 1,
|
||||
"status": "provisional-baseline-regression-gate",
|
||||
"baselineRevision": "97eb2a2",
|
||||
"runtimeFingerprint": "1d07cd4f5994d613efe74c64d6f3a2c23e74364842d1781b6aa8c2e273154d5e",
|
||||
"runtimeFingerprint": "94da359a335caa9fb1532efc6b9792f01b559ae66b6500239e1e1f4c01204819",
|
||||
"oracleFingerprint": "02e7226428c64a995ec24ae104ce4d186f5f91bf0f062556e90ef9b0fcb6d67a",
|
||||
"approvingMaintainer": "repository maintainer approved Phase 1 testing checkpoint; second judgment review remains required before final-target promotion",
|
||||
"units": "All metrics are ratios in [0,1]. Precision treats missing ranks as non-relevant. Negative abstention is measured across the hard-negative by domain/stack cross-product.",
|
||||
|
||||
@ -310,10 +310,17 @@ _SYNONYM_PATTERNS = [
|
||||
for variant, canonical in sorted(_SYNONYMS.items(), key=lambda item: len(item[0]), reverse=True)
|
||||
]
|
||||
|
||||
_SYNONYM_CANDIDATE_RE = re.compile(
|
||||
r"(?<!\w)(?:" + "|".join(map(re.escape, _SYNONYMS)) + r")(?!\w)",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
|
||||
def _normalize(text):
|
||||
"""Apply Arabic diacritic stripping and longest-first synonym substitution at token boundaries."""
|
||||
normalized = _ARABIC_DIACRITICS_RE.sub("", str(text))
|
||||
if not _SYNONYM_CANDIDATE_RE.search(normalized):
|
||||
return normalized
|
||||
for pattern, canonical in _SYNONYM_PATTERNS:
|
||||
normalized = pattern.sub(canonical, normalized)
|
||||
return normalized
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"schemaVersion": 1,
|
||||
"status": "provisional-baseline-regression-gate",
|
||||
"baselineRevision": "97eb2a2",
|
||||
"runtimeFingerprint": "1d07cd4f5994d613efe74c64d6f3a2c23e74364842d1781b6aa8c2e273154d5e",
|
||||
"runtimeFingerprint": "94da359a335caa9fb1532efc6b9792f01b559ae66b6500239e1e1f4c01204819",
|
||||
"oracleFingerprint": "02e7226428c64a995ec24ae104ce4d186f5f91bf0f062556e90ef9b0fcb6d67a",
|
||||
"approvingMaintainer": "repository maintainer approved Phase 1 testing checkpoint; second judgment review remains required before final-target promotion",
|
||||
"units": "All metrics are ratios in [0,1]. Precision treats missing ranks as non-relevant. Negative abstention is measured across the hard-negative by domain/stack cross-product.",
|
||||
|
||||
@ -310,10 +310,17 @@ _SYNONYM_PATTERNS = [
|
||||
for variant, canonical in sorted(_SYNONYMS.items(), key=lambda item: len(item[0]), reverse=True)
|
||||
]
|
||||
|
||||
_SYNONYM_CANDIDATE_RE = re.compile(
|
||||
r"(?<!\w)(?:" + "|".join(map(re.escape, _SYNONYMS)) + r")(?!\w)",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
|
||||
def _normalize(text):
|
||||
"""Apply Arabic diacritic stripping and longest-first synonym substitution at token boundaries."""
|
||||
normalized = _ARABIC_DIACRITICS_RE.sub("", str(text))
|
||||
if not _SYNONYM_CANDIDATE_RE.search(normalized):
|
||||
return normalized
|
||||
for pattern, canonical in _SYNONYM_PATTERNS:
|
||||
normalized = pattern.sub(canonical, normalized)
|
||||
return normalized
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"schemaVersion": 1,
|
||||
"status": "provisional-baseline-regression-gate",
|
||||
"baselineRevision": "97eb2a2",
|
||||
"runtimeFingerprint": "1d07cd4f5994d613efe74c64d6f3a2c23e74364842d1781b6aa8c2e273154d5e",
|
||||
"runtimeFingerprint": "94da359a335caa9fb1532efc6b9792f01b559ae66b6500239e1e1f4c01204819",
|
||||
"oracleFingerprint": "02e7226428c64a995ec24ae104ce4d186f5f91bf0f062556e90ef9b0fcb6d67a",
|
||||
"approvingMaintainer": "repository maintainer approved Phase 1 testing checkpoint; second judgment review remains required before final-target promotion",
|
||||
"units": "All metrics are ratios in [0,1]. Precision treats missing ranks as non-relevant. Negative abstention is measured across the hard-negative by domain/stack cross-product.",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user