mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-14 13:47:13 +03:00
d97661d18b
Tamil language support to spaCy Description Hereby, creating new PR to add support for Tamil language in spaCy added stop words, examples and numerical attributes <--Working on other language data--> Types of change Enhancement Checklist [ x] I have submitted the spaCy Contributor Agreement. [x ] I ran the tests, and all new and existing tests passed. [ x] My changes don't require a change to the documentation, or if they do, I've added all required information.
25 lines
828 B
Python
25 lines
828 B
Python
# import language-specific data
|
||
from .stop_words import STOP_WORDS
|
||
from .lex_attrs import LEX_ATTRS
|
||
|
||
from ..tokenizer_exceptions import BASE_EXCEPTIONS
|
||
from ...language import Language
|
||
from ...attrs import LANG
|
||
from ...util import update_exc
|
||
|
||
# create Defaults class in the module scope (necessary for pickling!)
|
||
class TamilDefaults(Language.Defaults):
|
||
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
||
lex_attr_getters[LANG] = lambda text: 'ta' # language ISO code
|
||
|
||
# optional: replace flags with custom functions, e.g. like_num()
|
||
lex_attr_getters.update(LEX_ATTRS)
|
||
|
||
# create actual Language class
|
||
class Tamil(Language):
|
||
lang = 'ta' # language ISO code
|
||
Defaults = TamilDefaults # override defaults
|
||
|
||
# set default export – this allows the language class to be lazy-loaded
|
||
__all__ = ['Tamil']
|