(text)
| 251 | # can fail in certain cases in which case we just return `orig_text`. |
| 252 | |
| 253 | def _strip_spaces(text): |
| 254 | ns_chars = [] |
| 255 | ns_to_s_map = collections.OrderedDict() |
| 256 | for (i, c) in enumerate(text): |
| 257 | if c == " ": |
| 258 | continue |
| 259 | ns_to_s_map[len(ns_chars)] = i |
| 260 | ns_chars.append(c) |
| 261 | ns_text = "".join(ns_chars) |
| 262 | return (ns_text, ns_to_s_map) |
| 263 | |
| 264 | # We first tokenize `orig_text`, strip whitespace from the result |
| 265 | # and `pred_text`, and check if they are the same length. If they are |
no test coverage detected