Commits

Anonymous committed 99112bb

update

  • Participants
  • Parent commits 8acc107

Comments (0)

Files changed (1)

     Serve the given object via json-rpc (http://json-rpc.org/)
     """
     def __init__(self):	
-	print "Initializing Server"
-    jars = ["stanford-corenlp-2010-11-12.jar", "stanford-corenlp-models-2010-11-06.jar",
-    "stanford-corenlp-src-2010-11-06.jar","jgraph.jar", "jgrapht.jar", "xom.jar"]
-    classname = "edu.stanford.nlp.pipeline.StanfordCoreNLP"
-
-    self._server = subprocess.Popen("java -Xmx3g -cp %s %s" % (':'.join(jars), classname),
-            stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
-            shell=True)
-    self._server.wait()
-
-    if not self._server.returncode == 0:
-        print "Server could not start. Error: "
-        for line in self._server.stderr.readlines(): print "\t", line
-    else:
-        for line in self._server.stdout.readlines(): print "\t", line
-	print "Server", self._server
+        print "Initializing Server"
+        jars = ["stanford-corenlp-2010-11-12.jar", "stanford-corenlp-models-2010-11-06.jar",
+        "stanford-corenlp-src-2010-11-06.jar","jgraph.jar", "jgrapht.jar", "xom.jar"]
+        classname = "edu.stanford.nlp.pipeline.StanfordCoreNLP"
+
+        self._server = subprocess.Popen("java -Xmx3g -cp %s %s" % (':'.join(jars), classname),
+                stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+                shell=True)
+        self._server.wait()
+
+        if not self._server.returncode == 0:
+            print "Server could not start. Error: "
+            for line in self._server.stderr.readlines(): print "\t", line
+        else:
+            for line in self._server.stdout.readlines(): print "\t", line
+        print "Server", self._server
     
     def __call__(self, environ, start_response):
         req = Request(environ)
 
 
 if __name__ == '__main__':
-    pass
-
-if False:
     parser = optparse.OptionParser(
         usage="%prog [OPTIONS] MODULE:EXPRESSION")
     parser.add_option(