Iterates over the tags in the entire Sentence, For example, Sentence.loop(POS, LEMMA) yields tuples of the part-of-speech tags and lemmata. Possible tags: WORD, LEMMA, POS, CHUNK, PNP, RELATION, ROLE, ANCHOR or a custom word tag. Any order or combination of tags
(self, *tags)
| 882 | return None |
| 883 | |
| 884 | def loop(self, *tags): |
| 885 | """ Iterates over the tags in the entire Sentence, |
| 886 | For example, Sentence.loop(POS, LEMMA) yields tuples of the part-of-speech tags and lemmata. |
| 887 | Possible tags: WORD, LEMMA, POS, CHUNK, PNP, RELATION, ROLE, ANCHOR or a custom word tag. |
| 888 | Any order or combination of tags can be supplied. |
| 889 | """ |
| 890 | for i in range(len(self.words)): |
| 891 | yield tuple([self.get(i, tag=tag) for tag in tags]) |
| 892 | |
| 893 | def indexof(self, value, tag=WORD): |
| 894 | """ Returns the indices of tokens in the sentence where the given token tag equals the string. |