mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Port over change from #1323 and tidy up
This commit is contained in:
parent
d4ca6cef9e
commit
bd3da3d6fb
|
@ -14,8 +14,8 @@ class Chinese(Language):
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError("The Chinese tokenizer requires the Jieba library: "
|
raise ImportError("The Chinese tokenizer requires the Jieba library: "
|
||||||
"https://github.com/fxsjy/jieba")
|
"https://github.com/fxsjy/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]
|
words = [x for x in words if x]
|
||||||
return Doc(self.vocab, words=words, spaces=[False]*len(words))
|
return Doc(self.vocab, words=words, spaces=[False]*len(words))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user