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..2e91266 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()) - + +pullword() 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',