nielklug commited on
Commit
1542342
·
1 Parent(s): 8778cfe
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -34,7 +34,8 @@ if text:
34
  parse_tree = parse(tokens)
35
 
36
  # Convert the bracket parse tree into an NLTK Tree
37
- t = Tree.fromstring(re.sub(r'-[^ )]*', '', parse_tree))
 
38
 
39
  tree_svg = TreePrettyPrinter(t).svg(nodecolor='black', leafcolor='black', funccolor='black')
40
 
 
34
  parse_tree = parse(tokens)
35
 
36
  # Convert the bracket parse tree into an NLTK Tree
37
+
38
+ t = Tree.fromstring(' '.join(word.split('-')[0] for word in parse_tree.split()))
39
 
40
  tree_svg = TreePrettyPrinter(t).svg(nodecolor='black', leafcolor='black', funccolor='black')
41