Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from abhaga/master

Fix for the skipping of non alphanumeric words in a sentence
  • Loading branch information...
commit 14b63068ef2b802babe8fbcdeaee2d8267c98557 2 parents 29ee872 + 8ed7640
@dasmith authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 corenlp.py
View
5 corenlp.py
@@ -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]]
@@ -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"
Please sign in to comment.
Something went wrong with that request. Please try again.