Return a view of the list of tokens from [i, j).
(self, i=None, j=None)
| 26 | return len(self.data) |
| 27 | |
| 28 | def slice(self, i=None, j=None): |
| 29 | """Return a view of the list of tokens from [i, j).""" |
| 30 | new_tokens = copy.copy(self) |
| 31 | new_tokens.data = self.data[i:j] |
| 32 | return new_tokens |
| 33 | |
| 34 | def untokenize(self): |
| 35 | """Returns the original text (with whitespace reinserted).""" |