(s)
| 6 | |
| 7 | |
| 8 | def normalize_answer(s): |
| 9 | def remove_articles(text): |
| 10 | return re.sub(r"\b(a|an|the)\b", " ", text) |
| 11 | |
| 12 | def white_space_fix(text): |
| 13 | return " ".join(text.split()) |
| 14 | |
| 15 | def remove_punc(text): |
| 16 | exclude = set(string.punctuation) |
| 17 | return "".join(ch for ch in text if ch not in exclude) |
| 18 | |
| 19 | def lower(text): |
| 20 | return text.lower() |
| 21 | |
| 22 | return white_space_fix(remove_articles(remove_punc(lower(s)))) |
| 23 | |
| 24 | |
| 25 | def run_and_time(func, *args, **kwargs): |
no test coverage detected