2019-08-05 08:22:27 +00:00
|
|
|
# coding: utf8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from .stop_words import STOP_WORDS
|
2019-08-22 09:43:07 +00:00
|
|
|
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
|
|
|
|
from .norm_exceptions import NORM_EXCEPTIONS
|
|
|
|
from .lex_attrs import LEX_ATTRS
|
2019-08-05 08:22:27 +00:00
|
|
|
from ..tokenizer_exceptions import BASE_EXCEPTIONS
|
|
|
|
from ..norm_exceptions import BASE_NORMS
|
|
|
|
from ...language import Language
|
|
|
|
from ...attrs import LANG, NORM
|
|
|
|
from ...util import update_exc, add_lookups
|
|
|
|
|
|
|
|
|
|
|
|
class SerbianDefaults(Language.Defaults):
|
|
|
|
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
2019-08-22 09:43:07 +00:00
|
|
|
lex_attr_getters.update(LEX_ATTRS)
|
2019-08-21 17:57:37 +00:00
|
|
|
lex_attr_getters[LANG] = lambda text: "sr"
|
2019-08-05 08:22:27 +00:00
|
|
|
lex_attr_getters[NORM] = add_lookups(
|
2019-08-22 09:43:07 +00:00
|
|
|
Language.Defaults.lex_attr_getters[NORM], BASE_NORMS, NORM_EXCEPTIONS
|
2019-08-05 08:22:27 +00:00
|
|
|
)
|
2019-08-22 09:43:07 +00:00
|
|
|
tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS)
|
2019-08-05 08:22:27 +00:00
|
|
|
stop_words = STOP_WORDS
|
|
|
|
|
|
|
|
|
|
|
|
class Serbian(Language):
|
2019-08-21 17:57:37 +00:00
|
|
|
lang = "sr"
|
2019-08-05 08:22:27 +00:00
|
|
|
Defaults = SerbianDefaults
|
|
|
|
|
|
|
|
|
|
|
|
__all__ = ["Serbian"]
|