add ChineseDefaults class for pickling

This commit is contained in:
zqhZY 2017-12-28 17:13:58 +08:00
parent ff9fc945ab
commit f27859fa99

View File

@ -1,12 +1,19 @@
# coding: utf8
from __future__ import unicode_literals
from ...attrs import LANG
from ...language import Language
from ...tokens import Doc
class ChineseDefaults(Language.Defaults):
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
lex_attr_getters[LANG] = lambda text: 'zh' # for pickling
class Chinese(Language):
lang = 'zh'
Defaults = ChineseDefaults # override defaults
def make_doc(self, text):
try: