MCPcopy Index your code
hub / github.com/geekcomputers/Python / normalize_text

Function normalize_text

JARVIS/text_utils.py:4–16  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

2
3
4def normalize_text(text):
5 text = str(text).lower().strip()
6 replacements = {
7 "ı": "i",
8 "ğ": "g",
9 "ü": "u",
10 "ş": "s",
11 "ö": "o",
12 "ç": "c",
13 }
14 for old, new in replacements.items():
15 text = text.replace(old, new)
16 return re.sub(r"[^a-z0-9 .:/_-]+", " ", text).strip()
17
18
19def clean_assistant_output(text):

Callers 15

is_dangerous_requestFunction · 0.85
should_exitFunction · 0.85
wants_type_modeFunction · 0.85
wants_developer_modeFunction · 0.85
wants_normal_modeFunction · 0.85
handle_commandFunction · 0.85
voice_loopFunction · 0.85
typed_loopFunction · 0.85
is_safe_app_pathFunction · 0.85
build_application_indexFunction · 0.85
find_applicationFunction · 0.85
search_appsFunction · 0.85

Calls 1

subMethod · 0.80

Tested by

no test coverage detected