Returns a tag for the word at the given index. The tag can be WORD, LEMMA, POS, CHUNK, PNP, RELATION, ROLE, ANCHOR or a custom word tag.
(self, index, tag=LEMMA)
| 858 | ch2.conjunctions.append(ch1, cc) |
| 859 | |
| 860 | def get(self, index, tag=LEMMA): |
| 861 | """ Returns a tag for the word at the given index. |
| 862 | The tag can be WORD, LEMMA, POS, CHUNK, PNP, RELATION, ROLE, ANCHOR or a custom word tag. |
| 863 | """ |
| 864 | if tag == WORD: |
| 865 | return self.words[index] |
| 866 | if tag == LEMMA: |
| 867 | return self.words[index].lemma |
| 868 | if tag == POS: |
| 869 | return self.words[index].type |
| 870 | if tag == CHUNK: |
| 871 | return self.words[index].chunk |
| 872 | if tag == PNP: |
| 873 | return self.words[index].pnp |
| 874 | if tag == REL: |
| 875 | ch = self.words[index].chunk; return ch and ch.relation |
| 876 | if tag == ROLE: |
| 877 | ch = self.words[index].chunk; return ch and ch.role |
| 878 | if tag == ANCHOR: |
| 879 | ch = self.words[index].pnp; return ch and ch.anchor |
| 880 | if tag in self.words[index].custom_tags: |
| 881 | return self.words[index].custom_tags[tag] |
| 882 | return None |
| 883 | |
| 884 | def loop(self, *tags): |
| 885 | """ Iterates over the tags in the entire Sentence, |