def test_wsj0087_8(self): tree = load_ccgbank_tree("munge/tests/wsj_0087.auto", 7) leaf = get_leaf(tree, 6, "backwards") self.assertEqual("to", leaf.lex) appls = list(applications(leaf)) self.assertEqual(["fwd_appl", "conj_absorb", "conjoin", "bwd_appl", "fwd_appl", "bwd_appl", "fwd_appl", "fwd_appl", "r_punct_absorb"], appls)
def test_wsj0003_1(self): tree = load_ccgbank_tree("munge/tests/wsj_0003.auto", 0) leaf = get_leaf(tree, 10, "forwards") self.assertEqual("filters", leaf.lex) appls = list(applications(leaf)) self.assertEqual(["fwd_appl", "fwd_appl", "np_typechange", "fwd_appl", "fwd_appl", "fwd_appl", "fwd_appl", "appositive_typechange", "bwd_appl", "bwd_appl", "bwd_appl", "r_punct_absorb" ], appls)
def accept_leaf(self, leaf): appls = applications(leaf) for appl in appls: self.counter[appl] += 1
def accept_leaf(self, leaf): appls = applications(leaf) for appl in appls: self.counter[ appl ] += 1