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

Class Group

pattern/text/search.py:1009–1028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1007#--- PATTERN MATCH GROUP ---------------------------------------------------------------------------
1008
1009class Group(list):
1010
1011 def __init__(self, match, words):
1012 list.__init__(self, words)
1013 self.match = match
1014
1015 @property
1016 def words(self):
1017 return list(self)
1018
1019 @property
1020 def start(self):
1021 return self and self[0].index or None
1022 @property
1023 def stop(self):
1024 return self and self[-1].index+1 or None
1025
1026 @property
1027 def string(self):
1028 return " ".join(w.string for w in self)
1029
1030#from en import Sentence, parse
1031#s = Sentence(parse("I was looking at the big cat, and the big cat was staring back", lemmata=True))

Callers 1

groupMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…