def test_combine1(self): sentence1 = "nice" sentence2 = "not nice" tree1 = text_to_trees(sentence1)[0] tree2 = text_to_trees(sentence2)[0] adj1 = Adjective(tree1) adj2 = Adjective(tree2) self.assertFalse(adj1.is_negated) self.assertTrue(adj2.is_negated) adj1.combine(adj2) self.assertTrue(adj1.is_negated)
def test_constructor(self): sentence = "nice" tree = text_to_trees(sentence)[0] expected_result = sentence adj = Adjective(tree) self.assertEqual(adj.__str__(), expected_result)
def test_combine2(self): sentence = "nice" tree = text_to_trees(sentence)[0] adj1 = Adjective(tree) adj2 = Adjective(tree) self.assertTrue(adj1.combine(adj2))