Jul-29-2019, 01:15 PM
(This post was last modified: Jul-29-2019, 01:15 PM by constantin01.)
Hi
I am working on parser for Russian and I would like to have visualization of abstract syntax tree. I want to see it in following way:
I have my tree class:
[Image: tree_display_sample.png]
How I can implement it?
I am working on parser for Russian and I would like to have visualization of abstract syntax tree. I want to see it in following way:
I have my tree class:
class Node: def __init__(self, word=None, tag=None, grammemes=None, leaf=False): self.word = word; self.tag = tag; self.grammemes = grammemes; self.leaf = leaf; self.l = None; self.r = None; self.p = None; class Tree: def __init__(self, grammar): self.grammar = grammar; self.root = None; self.nodes = list();I build it from given sentence and then I write:
my_tree.draw()And here is pop-up window (as tkinter) with my tree. Like this:
[Image: tree_display_sample.png]
How I can implement it?