MCPcopy Index your code
hub / github.com/clips/pattern / next

Method next

pattern/text/tree.py:417–424  ·  view source on GitHub ↗

Returns the next chunk in the sentence with the given type.

(self, type=None)

Source from the content-addressed store, hash-verified

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.

Callers 5

hierarchicalFunction · 0.45
cliqueFunction · 0.45
test_chunkMethod · 0.45
test_wikipedia_listMethod · 0.45
test_wikipedia_allMethod · 0.45

Calls 1

lenFunction · 0.85

Tested by 3

test_chunkMethod · 0.36
test_wikipedia_listMethod · 0.36
test_wikipedia_allMethod · 0.36