def tags(self): """List of TreeTagger POS tags of the tokens in the quote's :attr:`string`. Raises ------ ValueError If the quote's :attr:`string` is `None`. """ if self.string is None: raise ValueError('No string defined on this quote yet, ' "tags doesn't make sense.") from brainscopypaste import tagger return tagger.tags(self.string)
def test_tags(): assert tags(sentence) == ('VV', 'RB', 'SENT', 'PP', 'MD', 'RB', 'SENT', 'PP', 'VHP', 'VBN', 'RB', 'SENT', 'DT', 'NN', 'VVD', 'IN', 'DT', 'NN', 'CC', 'VVD', 'DT', 'NN')