| 1007 | #--- PATTERN MATCH GROUP --------------------------------------------------------------------------- |
| 1008 | |
| 1009 | class 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)) |
no outgoing calls
no test coverage detected
searching dependent graphs…