1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
From: imzhengzx <imzhengzx@gmail.com>
Date: Sat, 15 Sep 2018 11:59:01 +0800
Subject: fix the error about imoprting ChineseAnalyzer
Applied-Upstream: https://github.com/fxsjy/jieba/commit/ca444fb4da7ffa5a83919656a28b495bd3eeace0
Because of the interface change about ChineseAnlayzer , the code 'from jieba.analyse import Chinese Analyzer' in this test file would report an ImportError like 'cannot import name 'ChineseAnalyzer'. Just change import code to 'from jieba.analyse.analyzer import ChineseAnalyzer' can fix it.
---
test/test_whoosh.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test_whoosh.py b/test/test_whoosh.py
index ee17fc6..615f5b1 100644
--- a/test/test_whoosh.py
+++ b/test/test_whoosh.py
@@ -6,7 +6,7 @@ from whoosh.index import create_in,open_dir
from whoosh.fields import *
from whoosh.qparser import QueryParser
-from jieba.analyse import ChineseAnalyzer
+from jieba.analyse.analyzer import ChineseAnalyzer
analyzer = ChineseAnalyzer()
|