mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 17:24:41 +03:00
add ChineseDefaults class for pickling
This commit is contained in:
parent
ff9fc945ab
commit
f27859fa99
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user