MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / _attr_repl

Function _attr_repl

Scripts/ButSystem.py:2876–2896  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

2874
2875This docstring was expanded to make future maintenance easier.
2876
2877Args:
2878 m: Parameter.
2879
2880Returns:
2881 Varies.
2882"""
2883 w = m.group(1)
2884 return mapping.get(w, w)
2885 return _WORD_RE.sub(repl, s)
2886
2887
2888_SIMPLE_WORD_EN_RE = re.compile(r"^[A-Za-z0-9]+$")
2889_SIMPLE_WORD_UNI_RE = re.compile(r"^[\w]+$", re.UNICODE)
2890
2891_EL_PHRASE_KEYS: List[str] = []
2892_EN_PHRASE_KEYS: List[str] = []
2893_EL_WORD_RE = None
2894_EN_WORD_RE = None
2895
2896def _compile_safe_phrase_maps():
2897 """Compile safe replacement helpers to avoid substring misspellings (e.g., Add -> Address)."""
2898 global _EL_PHRASE_KEYS, _EN_PHRASE_KEYS, _EL_WORD_RE, _EN_WORD_RE
2899

Callers

nothing calls this directly

Calls 1

_apply_phrase_mapFunction · 0.70

Tested by

no test coverage detected