Beispiel #1
0
    def test_add_element_not_present(self):
        tags = Tags()
        new_tags = tags.add(WordTag.PAST)

        self.assertEqual(tags.to_list(), [])
        self.assertEqual(new_tags.to_list(), [WordTag.PAST])

        new_tags = new_tags.add(WordTag.DEFINITE)

        self.assertEqual(new_tags.to_list(), [WordTag.DEFINITE, WordTag.PAST])
Beispiel #2
0
 def proper_noun(cls, value, plural=False):
     tags = Tags([WordTag.PROPER])
     if plural:
         tags = tags.add(WordTag.PLURAL)
     return cls(value, '', '', tags)
Beispiel #3
0
 def test_add_element_already_present(self):
     tags = Tags([WordTag.PAST])
     new = tags.add(WordTag.PAST)
     self.assertEqual(new.to_list(), [WordTag.PAST])