コード例 #1
0
ファイル: db.py プロジェクト: wehlutyk/brainscopypaste
    def lemmas(self):
        """List of the lemmas 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, '
                             "lemmas doesn't make sense.")
        from brainscopypaste import tagger
        return tagger.lemmas(self.string)
コード例 #2
0
def test_lemmas():
    assert lemmas(sentence) == ('do', "n't", '!', 'i', 'would', "n't", '.',
                                'i', 'have', 'be', 'there', '.', 'the', 'cat',
                                'jump', 'over', 'the', 'fox', 'and', 'eat',
                                'the', 'rat')