nanom commited on
Commit
1734d40
·
1 Parent(s): 4abd544
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -20,12 +20,12 @@ def postag(tk):
20
  def genFlatDepthTree(expr):
21
  doc = nlp(expr)
22
  root = next(doc.sents).root
23
- node = Node(root.text+": 0 (Root)"+postag(root), parent=None)
24
 
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+" :"+str(depth+1)+postag(ch), parent=last_node), depth+1)
29
 
30
  tree(root, node, 0)
31
  flat_tree = ""
 
20
  def genFlatDepthTree(expr):
21
  doc = nlp(expr)
22
  root = next(doc.sents).root
23
+ node = Node(root.text+"\t (Root)"+postag(root)+" - [0]", parent=None)
24
 
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 = ""