Skip to content

Commit 3d62d7e

Browse files
author
Dany Ralantonisainana
committed
[encoding] add support for utf-8 and resolve bug fatal on french accent like éè@
1 parent f93f021 commit 3d62d7e

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Diff for: client.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# coding=utf-8
12
import json
23
from jsonrpc import ServerProxy, JsonRpc20, TransportTcpIp
34
from pprint import pprint

Diff for: corenlp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
# coding=utf-8
22
#
33
# corenlp - Python interface to Stanford Core NLP tools
44
# Copyright (c) 2014 Dustin Smith
@@ -72,7 +72,7 @@ def parse_parser_results(text):
7272
"""
7373
results = {"sentences": []}
7474
state = STATE_START
75-
for line in text.encode('utf-8').split("\n"):
75+
for line in text.split("\n"):
7676
line = line.strip()
7777

7878
if line.startswith("Sentence #"):

Diff for: jsonrpc.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/usr/bin/env python
2-
# -*- coding: ascii -*-
1+
# coding=utf-8
32
"""
43
JSON-RPC (remote procedure call).
54

0 commit comments

Comments
 (0)