mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 01:16:28 +03:00
Import Jieba inside zh.make_doc
This commit is contained in:
parent
f292f7f0e6
commit
532318e80b
|
@ -1,5 +1,3 @@
|
|||
import jieba
|
||||
|
||||
from ..language import Language
|
||||
from ..tokens import Doc
|
||||
|
||||
|
@ -8,5 +6,6 @@ class Chinese(Language):
|
|||
lang = u'zh'
|
||||
|
||||
def make_doc(self, text):
|
||||
import jieba
|
||||
words = list(jieba.cut(text, cut_all=True))
|
||||
return Doc(self.vocab, words=words, spaces=[False]*len(words))
|
||||
|
|
Loading…
Reference in New Issue
Block a user