From 7692b8c071af51165c732474978b032ca85f262f Mon Sep 17 00:00:00 2001 From: Yu-chun Huang Date: Tue, 12 Sep 2017 16:23:47 +0800 Subject: [PATCH] Update __init__.py Set the "cut_all" parameter to False, or jieba will return ALL POSSIBLE word segmentations. --- spacy/zh/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/zh/__init__.py b/spacy/zh/__init__.py index 0f407dec6..bde0054b5 100644 --- a/spacy/zh/__init__.py +++ b/spacy/zh/__init__.py @@ -7,6 +7,6 @@ class Chinese(Language): def make_doc(self, text): import jieba - words = list(jieba.cut(text, cut_all=True)) + words = list(jieba.cut(text, cut_all=False)) words=[x for x in words if x] return Doc(self.vocab, words=words, spaces=[False]*len(words))