Commits

Anonymous committed c7d3d53

made path to CoreNLP jars a variable to be easily edited

Comments (0)

Files changed (1)

                 "jgraph.jar",
                 "jgrapht.jar",
                 "xom.jar"]
-
+       
+        # if CoreNLP libraries are in a different directory,
+        # change the corenlp_path variable to point to them
+        corenlp_path = ""
+        java_path = "java"
         classname = "edu.stanford.nlp.pipeline.StanfordCoreNLP"
-        javapath = "java"
         # include the properties file, so you can change defaults
         # but any changes in output format will break parse_parser_results() 
         props = "-props default.properties" 
 
+        # add and check classpaths
+        jars = [corenlp_path + jar for jar in jars]
         for jar in jars:
             if not os.path.exists(jar):
                 print "Error! Cannot locate %s" % jar
                 sys.exit(1)
         
         # spawn the server
-        self._server = pexpect.spawn("%s -Xmx3g -cp %s %s %s" % (javapath, ':'.join(jars), classname, props))
+        self._server = pexpect.spawn("%s -Xmx3g -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"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.