mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-13 13:17:06 +03:00
42 lines
904 B
Python
42 lines
904 B
Python
from typing import Set
|
|
from thinc.api import Config
|
|
|
|
from .tokenizer_exceptions import TOKENIZER_EXCEPTIONS
|
|
from .stop_words import STOP_WORDS
|
|
from ..tokenizer_exceptions import BASE_EXCEPTIONS
|
|
from ...language import Language
|
|
from ...util import update_exc, registry
|
|
|
|
|
|
DEFAULT_CONFIG = """
|
|
[nlp]
|
|
lang = "tr"
|
|
stop_words = {"@language_data": "spacy.tr.stop_words"}
|
|
|
|
[nlp.lemmatizer]
|
|
@lemmatizers = "spacy.Lemmatizer.v1"
|
|
|
|
[nlp.lemmatizer.data]
|
|
@language_data = "spacy-lookups-data"
|
|
lang = ${nlp:lang}
|
|
tables = ["lemma_lookup"]
|
|
"""
|
|
|
|
|
|
@registry.language_data("spacy.tr.stop_words")
|
|
def stop_words() -> Set[str]:
|
|
return STOP_WORDS
|
|
|
|
|
|
class TurkishDefaults(Language.Defaults):
|
|
tokenizer_exceptions = update_exc(BASE_EXCEPTIONS, TOKENIZER_EXCEPTIONS)
|
|
|
|
|
|
class Turkish(Language):
|
|
lang = "tr"
|
|
Defaults = TurkishDefaults
|
|
default_config = Config().from_str(DEFAULT_CONFIG)
|
|
|
|
|
|
__all__ = ["Turkish"]
|