(self, text)
| 256 | return " ".join(text.split()) |
| 257 | |
| 258 | def _remove_punc(self, text): |
| 259 | exclude = set(string.punctuation) |
| 260 | if not self._is_number(text): |
| 261 | return "".join(ch for ch in text if ch not in exclude) |
| 262 | else: |
| 263 | return text |
| 264 | |
| 265 | def _fix_number(self, text): |
| 266 | return str(float(text)) if self._is_number(text) else text |