mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46: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 ..language import Language
|
||||||
from ..tokens import Doc
|
from ..tokens import Doc
|
||||||
|
|
||||||
|
@ -8,5 +6,6 @@ class Chinese(Language):
|
||||||
lang = u'zh'
|
lang = u'zh'
|
||||||
|
|
||||||
def make_doc(self, text):
|
def make_doc(self, text):
|
||||||
|
import jieba
|
||||||
words = list(jieba.cut(text, cut_all=True))
|
words = list(jieba.cut(text, cut_all=True))
|
||||||
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