Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions corenlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ def parse_parser_results(text):
print line
raise Exception("Parse error. Could not find [Text=")
tmp['words'] = []
exp = re.compile('\[([a-zA-Z0-9=. ]+)\]')
exp = re.compile('\[([^\]]+)\]')
matches = exp.findall(line)
for s in matches:
print s
# split into attribute-value list
av = re.split("=| ", s)
# make [ignore,ignore,a,b,c,d] into [[a,b],[c,d]]
Expand Down Expand Up @@ -137,7 +138,7 @@ def __init__(self):
sys.exit(1)

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

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