From c91642efd5dc0d5424af7b3095392bd9d441451a Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 1 Jul 2017 11:43:54 +0200 Subject: [PATCH] Port over changes from #1168 --- spacy/lang/zh/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spacy/lang/zh/__init__.py b/spacy/lang/zh/__init__.py index d63323b4e..3f68336f8 100644 --- a/spacy/lang/zh/__init__.py +++ b/spacy/lang/zh/__init__.py @@ -15,6 +15,7 @@ class Chinese(Language): raise ImportError("The Chinese tokenizer requires the Jieba library: " "https://github.com/fxsjy/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))