mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 02:16:32 +03:00
13 lines
269 B
Python
13 lines
269 B
Python
import jieba
|
|
|
|
from ..language import Language
|
|
from ..tokens import Doc
|
|
|
|
|
|
class Chinese(Language):
|
|
lang = u'zh'
|
|
|
|
def make_doc(self, text):
|
|
words = list(jieba.cut(text, cut_all=True))
|
|
return Doc(self.vocab, words=words, spaces=[False]*len(words))
|