def read_internal_node(self, toks, parent): shift_and_check( 'T', toks ) cat_string, head_index, child_count = \ toks.next(), toks.next(), toks.next() cat = parse_category(cat_string) #head_index = int(head_index) return self.node_factory.node_class(cat, head_index, child_count, parent)
def read_leaf_node(self, toks, parent=None): shift_and_check( 'L', toks ) cat_string, pos1, pos2, lex, catfix = \ toks.next(), toks.next(), \ toks.next(), toks.next(), toks.next() cat = parse_category(cat_string) return self.node_factory.leaf_class(cat, pos1, pos2, lex, catfix, parent)
def read_internal_node(self, toks, parent): shift_and_check('T', toks) cat_string, head_index, child_count = \ toks.next(), toks.next(), toks.next() cat = parse_category(cat_string) #head_index = int(head_index) return self.node_factory.node_class(cat, head_index, child_count, parent)
def read_leaf_node(self, toks, parent=None): shift_and_check('L', toks) cat_string, pos1, pos2, lex, catfix = \ toks.next(), toks.next(), \ toks.next(), toks.next(), toks.next() cat = parse_category(cat_string) return self.node_factory.leaf_class(cat, pos1, pos2, lex, catfix, parent)