Commits

Hiroyoshi Komatsu committed 03fa74f

Using jsonrpclib

  • Participants
  • Parent commits 6c3fced

Comments (0)

Files changed (1)

 import json
-from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
+# from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
+import jsonrpclib
 from pprint import pprint
 
+
 class StanfordNLP:
-    def __init__(self):
-        self.server = ServerProxy(JsonRpc20(),
-                                  TransportTcpIp(addr=("127.0.0.1", 8080)))
-    
+    def __init__(self, port_number=8080):
+        self.server = jsonrpclib.Server("http://localhost:%d" % port_number)
+
     def parse(self, text):
         return json.loads(self.server.parse(text))