def discont_grammar_novert(discont_tree): gram = {} lex = {} grammar.extract(discont_tree, gram, lex) for func in gram: for lin in gram[func]: gram[func][lin] = {grammarconst.DEFAULT_VERT : \ sum(gram[func][lin].values())} return gram
def discont_lex(discont_tree): gram = {} lex = {} grammar.extract(discont_tree, gram, lex) return lex
def cont_grammar(cont_tree): gram = {} lex = {} grammar.extract(cont_tree, gram, lex) return gram