mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
a341b4ef09
* Create lex_attrs.py Hello, I am missing a CZECH language in SpaCy. So I would like to help to push it a little. This file is base on others lex_attrs.py files just with translation to Czech. * Update __init__.py Updated for use with new Czech Lex_attrs file * Update stop_words.py * Create test_text.py Co-authored-by: Vladimír Holubec <vholubec@arcdata.cz>
23 lines
495 B
Python
23 lines
495 B
Python
# coding: utf8
|
|
from __future__ import unicode_literals
|
|
|
|
from .stop_words import STOP_WORDS
|
|
from ...language import Language
|
|
from ...attrs import LANG
|
|
from .lex_attrs import LEX_ATTRS
|
|
|
|
|
|
class CzechDefaults(Language.Defaults):
|
|
lex_attr_getters = dict(Language.Defaults.lex_attr_getters)
|
|
lex_attr_getters.update(LEX_ATTRS)
|
|
lex_attr_getters[LANG] = lambda text: "cs"
|
|
stop_words = STOP_WORDS
|
|
|
|
|
|
class Czech(Language):
|
|
lang = "cs"
|
|
Defaults = CzechDefaults
|
|
|
|
|
|
__all__ = ["Czech"]
|