2017-07-23 13:51:31 +00:00
|
|
|
# coding: utf8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from .stop_words import STOP_WORDS
|
2017-07-23 23:17:07 +00:00
|
|
|
from .punctuation import TOKENIZER_SUFFIXES, TOKENIZER_PREFIXES, TOKENIZER_INFIXES
|
2017-08-20 06:43:21 +00:00
|
|
|
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
|
2017-07-23 15:54:49 +00:00
|
|
|
from .norm_exceptions import NORM_EXCEPTIONS
|
2017-07-27 03:51:15 +00:00
|
|
|
from .lemmatizer import LOOKUP
|
2017-07-23 13:51:31 +00:00
|
|
|
from .lex_attrs import LEX_ATTRS
|
2017-07-27 03:51:15 +00:00
|
|
|
from .syntax_iterators import SYNTAX_ITERATORS
|
2017-07-23 13:51:31 +00:00
|
|
|
|
|
|
|
from ..tokenizer_exceptions import BASE_EXCEPTIONS
|
2018-09-14 10:30:32 +00:00
|
|
|
from ..norm_exceptions import BASE_NORMS
|
2017-07-23 14:30:34 +00:00
|
|
|
from ...language import Language
|
2018-09-14 10:30:32 +00:00
|
|
|
from ...attrs import LANG, NORM
|
|
|
|
from ...util import update_exc, add_lookups
|
2017-07-23 13:51:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
class IndonesianDefaults(Language.Defaults):
|
|
|
|
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
|
|
|
lex_attr_getters[LANG] = lambda text: 'id'
|
|
|
|
lex_attr_getters.update(LEX_ATTRS)
|
2018-09-14 10:30:32 +00:00
|
|
|
lex_attr_getters[NORM] = add_lookups(Language.Defaults.lex_attr_getters[NORM],
|
|
|
|
BASE_NORMS, NORM_EXCEPTIONS)
|
2017-07-23 14:30:34 +00:00
|
|
|
tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS)
|
2017-10-11 13:34:55 +00:00
|
|
|
stop_words = STOP_WORDS
|
|
|
|
prefixes = TOKENIZER_PREFIXES
|
|
|
|
suffixes = TOKENIZER_SUFFIXES
|
|
|
|
infixes = TOKENIZER_INFIXES
|
|
|
|
syntax_iterators = SYNTAX_ITERATORS
|
|
|
|
lemma_lookup = LOOKUP
|
2017-07-23 13:51:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Indonesian(Language):
|
|
|
|
lang = 'id'
|
|
|
|
Defaults = IndonesianDefaults
|
|
|
|
|
|
|
|
|
|
|
|
__all__ = ['Indonesian']
|