(m)
| 2874 | |
| 2875 | This docstring was expanded to make future maintenance easier. |
| 2876 | |
| 2877 | Args: |
| 2878 | m: Parameter. |
| 2879 | |
| 2880 | Returns: |
| 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 | |
| 2896 | def _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 |
nothing calls this directly
no test coverage detected