mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
Move SpanishDefaults out of Language class, for pickle
This commit is contained in:
parent
2713041571
commit
8815507f8e
|
@ -13,20 +13,22 @@ from ...attrs import LANG
|
||||||
from ...util import update_exc
|
from ...util import update_exc
|
||||||
|
|
||||||
|
|
||||||
|
class SpanishDefaults(Language.Defaults):
|
||||||
|
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
||||||
|
lex_attr_getters[LANG] = lambda text: 'es'
|
||||||
|
|
||||||
|
tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS)
|
||||||
|
tag_map = dict(TAG_MAP)
|
||||||
|
stop_words = set(STOP_WORDS)
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def create_lemmatizer(cls, nlp=None):
|
||||||
|
return Lemmatizer(LOOKUP)
|
||||||
|
|
||||||
|
|
||||||
class Spanish(Language):
|
class Spanish(Language):
|
||||||
lang = 'es'
|
lang = 'es'
|
||||||
|
|
||||||
class Defaults(Language.Defaults):
|
Defaults = SpanishDefaults
|
||||||
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
|
||||||
lex_attr_getters[LANG] = lambda text: 'es'
|
|
||||||
|
|
||||||
tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS)
|
|
||||||
tag_map = dict(TAG_MAP)
|
|
||||||
stop_words = set(STOP_WORDS)
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def create_lemmatizer(cls, nlp=None):
|
|
||||||
return Lemmatizer(LOOKUP)
|
|
||||||
|
|
||||||
|
|
||||||
__all__ = ['Spanish']
|
__all__ = ['Spanish']
|
||||||
|
|
Loading…
Reference in New Issue
Block a user