Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ def genFlatDepthTree(expr):
|
|
25 |
def tree(tk, last_node, depth):
|
26 |
if tk.n_lefts + tk.n_rights > 0:
|
27 |
for ch in tk.children:
|
28 |
-
tree(ch, Node(ch.text+"\t"+postag(ch)
|
29 |
|
30 |
tree(root, node, 0)
|
31 |
flat_tree = ""
|
|
|
25 |
def tree(tk, last_node, depth):
|
26 |
if tk.n_lefts + tk.n_rights > 0:
|
27 |
for ch in tk.children:
|
28 |
+
tree(ch, Node(ch.text+"\t"+postag(ch)+" - ["+str(depth+1)+"]", parent=last_node), depth+1)
|
29 |
|
30 |
tree(root, node, 0)
|
31 |
flat_tree = ""
|