| # data/text_utils.py β shared text helpers | |
| import re | |
| def normalize_question(q: str) -> str: | |
| """ | |
| Normalize Lao question: | |
| - lowercase | |
| - remove basic punctuation | |
| - collapse spaces | |
| """ | |
| q = q.lower() | |
| q = re.sub(r"[?!οΌοΌ\.\,\:\;\"ββ'ββ]", " ", q) | |
| q = re.sub(r"\s+", " ", q) | |
| return q.strip() | |