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

Function get_lang

Scripts/ButSystem.py:2902–2913  ·  view source on GitHub ↗

get_lang. Internal helper function. This docstring was added automatically to improve maintainability. Returns: Varies.

()

Source from the content-addressed store, hash-verified

2900 # English -> Greek
2901 el_word_keys = [k for k in TRANSLATIONS_EL.keys() if _SIMPLE_WORD_EN_RE.fullmatch(k or "")]
2902 el_phrase_keys = [k for k in TRANSLATIONS_EL.keys() if k not in el_word_keys]
2903 _EL_PHRASE_KEYS = sorted(el_phrase_keys, key=len, reverse=True)
2904 if el_word_keys:
2905 _EL_WORD_RE = re.compile(r"\b(" + "|".join(sorted(map(re.escape, el_word_keys), key=len, reverse=True)) + r")\b")
2906 else:
2907 _EL_WORD_RE = None
2908
2909 # Greek -> English (reverse)
2910 en_word_keys = [k for k in TRANSLATIONS_EN.keys() if _SIMPLE_WORD_UNI_RE.fullmatch(k or "")]
2911 en_phrase_keys = [k for k in TRANSLATIONS_EN.keys() if k not in en_word_keys]
2912 _EN_PHRASE_KEYS = sorted(en_phrase_keys, key=len, reverse=True)
2913 if en_word_keys:
2914 _EN_WORD_RE = re.compile(r"\b(" + "|".join(sorted(map(re.escape, en_word_keys), key=len, reverse=True)) + r")\b", re.UNICODE)
2915 else:
2916 _EN_WORD_RE = None

Callers 7

_set_lang_on_gFunction · 0.70
toggle_languageFunction · 0.70
_Function · 0.70
_translate_html_responseFunction · 0.70
newsFunction · 0.70
api_newsFunction · 0.70
_bounty_currency_symbolFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected