nielklug commited on
Commit
42dc132
·
1 Parent(s): 48cafe5
Files changed (2) hide show
  1. app.py +1 -1
  2. parse.py +0 -1
app.py CHANGED
@@ -34,7 +34,7 @@ if text:
34
  parse_tree = parse(tokens)
35
 
36
  # Convert the bracket parse tree into an NLTK Tree
37
- mod_tree = str(parse_tree).replace("$(", "$LRB").replace("$)", "$RRB")
38
  print(mod_tree)
39
  # t = Tree.fromstring(re.sub(r'(-\w+)+', '', mod_tree))
40
  # t = Tree.fromstring(mod_tree)
 
34
  parse_tree = parse(tokens)
35
 
36
  # Convert the bracket parse tree into an NLTK Tree
37
+ mod_tree = str(parse_tree).replace("$\(", "$LRB").replace("$\)", "$RRB")
38
  print(mod_tree)
39
  # t = Tree.fromstring(re.sub(r'(-\w+)+', '', mod_tree))
40
  # t = Tree.fromstring(mod_tree)
parse.py CHANGED
@@ -13,6 +13,5 @@ def parse(words):
13
  # put the whole parse tree on a single line
14
  tree = re.sub(r'\s+', ' ', tree.strip())
15
  tree = re.sub(r' \(', '(', tree)
16
- tree = tree.replace("$(", "$LRB").replace("$)", "$RRB")
17
  return tree
18
 
 
13
  # put the whole parse tree on a single line
14
  tree = re.sub(r'\s+', ' ', tree.strip())
15
  tree = re.sub(r' \(', '(', tree)
 
16
  return tree
17