Merge pull request #1323 from galaxyh/master

Set the "cut_all" parameter in jieba.cut() to False, or jieba will return ALL POSSIBLE word segmentations.
This commit is contained in:
Ines Montani 2017-09-14 15:23:41 +02:00 committed by GitHub
commit 4bee26188d

View File

@ -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))