From ca444fb4da7ffa5a83919656a28b495bd3eeace0 Mon Sep 17 00:00:00 2001 From: imzhengzx Date: Sat, 15 Sep 2018 11:59:01 +0800 Subject: [PATCH] fix the error about imoprting ChineseAnalyzer 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()