From 5571a0337a17aaa218a71453b3e138f86163a6ad Mon Sep 17 00:00:00 2001 From: walkskyer Date: Wed, 12 Nov 2014 22:33:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dstop=20words=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=9C=AA=E8=80=83=E8=99=91"\r"=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E6=AD=A3=E5=B8=B8=E5=8C=B9=E9=85=8D=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jieba/analyse/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jieba/analyse/__init__.py b/jieba/analyse/__init__.py index 95c5b14..af36149 100755 --- a/jieba/analyse/__init__.py +++ b/jieba/analyse/__init__.py @@ -54,7 +54,7 @@ def set_stop_words(stop_words_path): if not os.path.exists(abs_path): raise Exception("jieba: path does not exist: " + abs_path) content = open(abs_path,'rb').read().decode('utf-8') - lines = content.split('\n') + lines = content.replace("\r", "").split('\n') for line in lines: STOP_WORDS.add(line)