def match_tree(self, tree, mark=False): if util.is_leaf(tree): return False for daughter in tree: if self.query.match_tree(daughter, mark): return True return False
def match_tree(self, tree, mark=False): return util.is_leaf(tree) and tree.text == self.text