8000 Fix the regex to capture all the words of the sentence. · JHnlp/stanford-corenlp-python@8ed7640 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8ed7640

Browse files
committed
Fix the regex to capture all the words of the sentence.
1 parent 29ee872 commit 8ed7640

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

corenlp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ def parse_parser_results(text):
4848
print line
4949
raise Exception("Parse error. Could not find [Text=")
5050
tmp['words'] = []
51-
exp = re.compile('\[([a-zA-Z0-9=. ]+)\]')
51+
exp = re.compile('\[([^\]]+)\]')
5252
matches = exp.findall(line)
5353
for s in matches:
54+
print s
5455
# split into attribute-value list
5556
av = re.split("=| ", s)
5657
# make [ignore,ignore,a,b,c,d] into [[a,b],[c,d]]
@@ -137,7 +138,7 @@ def __init__(self):
137138
sys.exit(1)
138139

139140
# spawn the server
140-
self._server = pexpect.spawn("%s -Xmx3g -cp %s %s %s" % (java_path, ':'.join(jars), classname, props))
141+
self._server = pexpect.spawn("%s -Xmx1800m -cp %s %s %s" % (java_path, ':'.join(jars), classname, props))
141142

142143
print "Starting the Stanford Core NLP parser."
143144
self.state = "plays hard to get, smiles from time to time"

0 commit comments

Comments
 (0)
0