MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / normalize_text

Function normalize_text

metrics/string_match.py:10–15  ·  view source on GitHub ↗

Normalize text: remove punctuation, whitespace, convert to lowercase.

(text: str)

Source from the content-addressed store, hash-verified

8
9
10def normalize_text(text: str) -> str:
11 """Normalize text: remove punctuation, whitespace, convert to lowercase."""
12 punctuation = string.punctuation + ',。!?、;:""''()【】《》·…—~-–·'
13 text = text.translate(str.maketrans('', '', punctuation))
14 text = ''.join(text.split())
15 return text.strip().lower()
16
17
18def extract_option_letters(text: str) -> Set[str]:

Callers 2

computeMethod · 0.85
computeMethod · 0.85

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected