mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
Merge pull request #200 from skyerown/master
修复stop words处理未考虑"\r"导致不能正常匹配的问题。
This commit is contained in:
commit
3eea28d6f4
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user