Merge pull request #200 from skyerown/master

修复stop words处理未考虑"\r"导致不能正常匹配的问题。
This commit is contained in:
Sun Junyi 2014-11-13 10:10:07 +08:00
commit 3eea28d6f4

View File

@ -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)