Adds a new Word to the sentence. Other Sentence._do_[tag] functions assume a new word has just been appended.
(self, word, lemma=None, type=None)
| 764 | return chunk, relation, role |
| 765 | |
| 766 | def _do_word(self, word, lemma=None, type=None): |
| 767 | """ Adds a new Word to the sentence. |
| 768 | Other Sentence._do_[tag] functions assume a new word has just been appended. |
| 769 | """ |
| 770 | # Improve 3rd person singular "'s" lemma to "be", e.g., as in "he's fine". |
| 771 | if lemma == "'s" and type in ("VB", "VBZ"): |
| 772 | lemma = "be" |
| 773 | self.words.append(Word(self, word, lemma, type, index=len(self.words))) |
| 774 | |
| 775 | def _do_chunk(self, type, role=None, relation=None, iob=None): |
| 776 | """ Adds a new Chunk to the sentence, or adds the last word to the previous chunk. |