<commit_before># coding: utf8
from __future__ import unicode_literals

from ...language import Language
from ...tokens import Doc


class Chinese(Language):
    lang = 'zh'

    def make_doc(self, text):
        try:
            from jieba
        except ImportError:
            raise ImportError("The Chinese tokenizer requires the Jieba library: "
                              "https://github.com/fxsjy/jieba")
        words = list(jieba.cut(text, cut_all=True))
        words=[x for x in words if x]
        return Doc(self.vocab, words=words, spaces=[False]*len(words))


__all__ = ['Chinese']<commit_msg>Port over change from #1323 and tidy up<commit_after># coding: utf8
from __future__ import unicode_literals

from ...language import Language
from ...tokens import Doc


class Chinese(Language):
    lang = 'zh'

    def make_doc(self, text):
        try:
            from jieba
        except ImportError:
            raise ImportError("The Chinese tokenizer requires the Jieba library: "
                              "https://github.com/fxsjy/jieba")
        words = list(jieba.cut(text, cut_all=False))
        words = [x for x in words if x]
        return Doc(self.vocab, words=words, spaces=[False]*len(words))


__all__ = ['Chinese']
{'fraction_non_alphanumeric': 0.10311750599520383, 'fraction_numerical': 0.004796163069544364, 'mean_word_length': 2.458563535911602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4089228', 'n_tokens_mistral': 380, 'n_tokens_neox': 366, 'n_words': 111}