opennlp-python icon indicating copy to clipboard operation
opennlp-python copied to clipboard

how to send non-ascii code with the client?

Open luvwinnie opened this issue 6 years ago • 0 comments

i have tried with the opennlp.py and client.py

I wish to use different languages model with Japanese language. But when i send the non-ascii character it show this error, does anyone know how to solve this?

Traceback (most recent call last): File "/Users/cheesiang_leow/.conda/envs/tensorflow-env/lib/python3.6/site-packages/jsonrpclib/SimpleJSONRPCServer.py", line 460, in do_POST data, getattr(self, '_dispatch', None), self.path) File "/Users/cheesiang_leow/.conda/envs/tensorflow-env/lib/python3.6/site-packages/jsonrpclib/SimpleJSONRPCServer.py", line 280, in _marshaled_dispatch return jsonrpclib.jdumps(response, self.encoding) File "/Users/cheesiang_leow/.conda/envs/tensorflow-env/lib/python3.6/site-packages/jsonrpclib/jsonrpc.py", line 164, in jdumps return json.dumps(obj) File "/Users/cheesiang_leow/.conda/envs/tensorflow-env/lib/python3.6/json/__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "/Users/cheesiang_leow/.conda/envs/tensorflow-env/lib/python3.6/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/Users/cheesiang_leow/.conda/envs/tensorflow-env/lib/python3.6/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/Users/cheesiang_leow/.conda/envs/tensorflow-env/lib/python3.6/json/encoder.py", line 180, in default o.__class__.__name__) TypeError: Object of type 'bytes' is not JSON serializable

luvwinnie avatar Feb 12 '19 23:02 luvwinnie