(answer: Optional[str])
| 8 | |
| 9 | |
| 10 | def normalize_answer(answer: Optional[str]) -> Optional[str]: |
| 11 | if answer is None: |
| 12 | return None |
| 13 | answer = answer.strip() |
| 14 | try: |
| 15 | # Remove enclosing `\text{}`. |
| 16 | m = re.search("^\\\\text\{(?P<text>.+?)\}$", answer) |
| 17 | if m is not None: |
| 18 | answer = m.group("text").strip() |
| 19 | return _strip_string(answer) |
| 20 | except: |
| 21 | return answer |
| 22 | |
| 23 | |
| 24 | def _fix_fracs(string): |
nothing calls this directly
no test coverage detected