From 669bd142130f3e3c66b253efd0df1dd7ce2ba3f4 Mon Sep 17 00:00:00 2001 From: gispk47 Date: Sat, 1 Jul 2017 13:12:00 +0800 Subject: [PATCH] Update __init__.py remove the empty string return from jieba.cut,this will cause the list of tokens cant be pushed assert error --- spacy/zh/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/zh/__init__.py b/spacy/zh/__init__.py index 1847a7d8d..0f407dec6 100644 --- a/spacy/zh/__init__.py +++ b/spacy/zh/__init__.py @@ -8,4 +8,5 @@ class Chinese(Language): def make_doc(self, text): import jieba words = list(jieba.cut(text, cut_all=True)) + words=[x for x in words if x] return Doc(self.vocab, words=words, spaces=[False]*len(words))