Exemplo n.º 1
0
 def view(self, s):
     s = re.sub(r"set\(\[([\d, ]*)\]\)", r"{\g<1>}", s)
     print s
     #tree = ParentedTree.parse(s, node_pattern=r"\w*?\[.*?\]", parse_node=buildfeatstruct)
     tree = ParentedTree.parse(s,
                               node_pattern=r"\w*?\[.*?\]",
                               parse_node=FeatStruct)
     tree.draw()
Exemplo n.º 2
0
 def view(self, s):
     s = re.sub(r"set\(\[([\d, ]*)\]\)", r"{\g<1>}", s)
     print s
     #tree = ParentedTree.parse(s, node_pattern=r"\w*?\[.*?\]", parse_node=buildfeatstruct)
     tree = ParentedTree.parse(s, node_pattern=r"\w*?\[.*?\]", parse_node=FeatStruct)
     tree.draw()
Exemplo n.º 3
0
 def __init__(self, tree_repr):
     self.tree = ParentedTree.parse(tree_repr)