Returns the next chunk in the sentence with the given type.
(self, type=None)
| 415 | return candidate |
| 416 | |
| 417 | def next(self, type=None): |
| 418 | """ Returns the next chunk in the sentence with the given type. |
| 419 | """ |
| 420 | i = self.stop |
| 421 | while i < len(self.sentence): |
| 422 | if self.sentence[i].chunk is not None and type in (self.sentence[i].chunk.type, None): |
| 423 | return self.sentence[i].chunk |
| 424 | i += 1 |
| 425 | |
| 426 | def previous(self, type=None): |
| 427 | """ Returns the next previous chunk in the sentence with the given type. |