Commits

Hiroyoshi Komatsu committed 8462899 Merge

Merged in felix_remmel/corenlp-python (pull request #4)

Optional usage of environment variable and increased timeout

Comments (0)

Files changed (1)

corenlp/corenlp.py

 WORD_PATTERN = re.compile('\[([^\]]+)\]')
 CR_PATTERN = re.compile(r"\((\d*),(\d)*,\[(\d*),(\d*)\)\) -> \((\d*),(\d)*,\[(\d*),(\d*)\)\), that is: \"(.*)\" -> \"(.*)\"")
 
-DIRECTORY = "stanford-corenlp-full-2013-06-20"
-
+if os.environ.has_key("CORENLP"):
+    DIRECTORY = os.environ["CORENLP"]
+else:
+    DIRECTORY = "stanford-corenlp-full-2013-06-20"
 
 class bc:
     HEADER = '\033[95m'
     def _spawn_corenlp(self):
         if VERBOSE:
             print self.start_corenlp
-        self.corenlp = pexpect.spawn(self.start_corenlp, maxread=8192, searchwindowsize=80)
+        self.corenlp = pexpect.spawn(self.start_corenlp, timeout=60, maxread=8192, searchwindowsize=80)
 
         # show progress bar while loading the models
         if VERBOSE: