(text, dic)
| 380 | |
| 381 | |
| 382 | def normalize_with_dictionary(text, dic): |
| 383 | if any(key in text for key in dic.keys()): |
| 384 | pattern = re.compile("|".join(re.escape(key) for key in dic.keys())) |
| 385 | return pattern.sub(lambda x: dic[x.group()], text) |
| 386 | else: |
| 387 | return text |
| 388 | |
| 389 | |
| 390 | def normalize_english(text): |
no test coverage detected