mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 12:18:04 +03:00
12 lines
276 B
Python
12 lines
276 B
Python
from ..language import Language
|
|
from ..tokens import Doc
|
|
|
|
|
|
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))
|