Lowercase, strip extra whitespace, remove control characters.
(text: str)
| 10 | |
| 11 | |
| 12 | def normalize_text(text: str) -> str: |
| 13 | """Lowercase, strip extra whitespace, remove control characters.""" |
| 14 | text = text.lower().strip() |
| 15 | text = re.sub(r"\s+", " ", text) |
| 16 | text = re.sub(r"[^\x20-\x7e]", "", text) |
| 17 | return text |
| 18 | |
| 19 | |
| 20 | def extract_keywords(text: str) -> list: |
no outgoing calls
no test coverage detected