2019-01-14 14:32:30 +00:00
|
|
|
|
# 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)
|
2019-02-07 20:00:04 +00:00
|
|
|
|
lex_attr_getters[LANG] = lambda text: "ta" # language ISO code
|
2019-01-14 14:32:30 +00:00
|
|
|
|
|
|
|
|
|
# optional: replace flags with custom functions, e.g. like_num()
|
|
|
|
|
lex_attr_getters.update(LEX_ATTRS)
|
|
|
|
|
|
2019-02-07 20:00:04 +00:00
|
|
|
|
|
2019-01-14 14:32:30 +00:00
|
|
|
|
# create actual Language class
|
|
|
|
|
class Tamil(Language):
|
2019-02-07 20:00:04 +00:00
|
|
|
|
lang = "ta" # language ISO code
|
|
|
|
|
Defaults = TamilDefaults # override defaults
|
|
|
|
|
|
2019-01-14 14:32:30 +00:00
|
|
|
|
|
|
|
|
|
# set default export – this allows the language class to be lazy-loaded
|
2019-02-07 20:00:04 +00:00
|
|
|
|
__all__ = ["Tamil"]
|