Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    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)
Example #4
0
    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)