def size(self): return sum(tree_size(t) for t in self.trees)
def normalized_simple_tree_match(t1, t2): t1size = tree_size(t1) t2size = tree_size(t2) return _simple_tree_match(t1, t2) / (2.0 * (t1size + t2size))