From b1e4a1c48d0fe2dcb67a99061015909f30dd8780 Mon Sep 17 00:00:00 2001 From: siqyka <36783192+siqyka@users.noreply.github.com> Date: Fri, 31 Aug 2018 13:36:00 +0800 Subject: [PATCH 1/3] for python3 Modify the code to adapt to python3 --- example/example.py | 6 +++--- pullword/pullword.py | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/example/example.py b/example/example.py index 6d60a90..94116f5 100644 --- a/example/example.py +++ b/example/example.py @@ -2,6 +2,6 @@ # coding=utf-8 from pullword import pullword -print pullword(u"华中科技大学") -print pullword(u"华中科技大学", debug=0) -print pullword(u"华中科技大学", threshold=1) +print(pullword(u"华中科技大学")) +print(pullword(u"华中科技大学", debug=0)) +print(pullword(u"华中科技大学", threshold=1)) diff --git a/pullword/pullword.py b/pullword/pullword.py index 503e8b3..1cae7be 100644 --- a/pullword/pullword.py +++ b/pullword/pullword.py @@ -22,10 +22,11 @@ def split_word(words): def pullword(source="", threshold=0, debug=1): payload = {"source":source.encode("utf8"), "param1":threshold, "param2":debug} pw = requests.post(post_url, data=payload) - print pw.url + print(pw.url) if pw.status_code != 200: raise ServerError("server return %s"%pw.status_code) - print pw.content - return split_word(pw.content) + print(pw.content) + return split_word(pw.content.decode()) + From 7a8e965bf971aa61d6dfef26d77530824662e291 Mon Sep 17 00:00:00 2001 From: siqyka <36783192+siqyka@users.noreply.github.com> Date: Tue, 4 Sep 2018 12:25:49 +0800 Subject: [PATCH 2/3] up --- pullword/pullword.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pullword/pullword.py b/pullword/pullword.py index 1cae7be..2e91266 100644 --- a/pullword/pullword.py +++ b/pullword/pullword.py @@ -29,4 +29,4 @@ def pullword(source="", threshold=0, debug=1): return split_word(pw.content.decode()) - +pullword() From b03932692b848792fbe21bf719ac2f9cc2c92d1e Mon Sep 17 00:00:00 2001 From: Shiqyka Date: Sat, 15 Aug 2020 01:05:48 +0800 Subject: [PATCH 3/3] Update setup.py up --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a561d61..ae86fd6 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name = 'pullword', - version = '0.0.1', + version = '0.0.2', keywords = ('pullword'), description = 'the sdk for pullword.com -- a free online Chinese text segmentation platform', license = 'MIT License',