def test_get_adjective_match1(self): adj_str = "sweet" noun_str = "pig" adj_tree = text_to_trees(adj_str)[0] noun_tree = text_to_trees(noun_str)[0] adj = Adjective(adj_tree) noun = Noun(noun_tree) noun.add_adjective(adj) adj_match = noun.get_adjective_match(adj) self.assertEqual(adj, adj_match)
def test_get_adjective_match2(self): adj_str1 = "sweet" adj_str2 = "not " + adj_str1 noun_str = "pig" adj_tree1 = text_to_trees(adj_str1)[0] adj_tree2 = text_to_trees(adj_str2)[0] noun_tree = text_to_trees(noun_str)[0] adj1 = Adjective(adj_tree1) adj2 = Adjective(adj_tree2) noun = Noun(noun_tree) noun.add_adjective(adj2) adj_match = noun.get_adjective_match(adj1) self.assertTrue(adj_match.is_negated)