From 4fe9329bfba009d626e1a442eeaeb094961a5817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavle=20Vidanovi=C4=87?= Date: Wed, 21 Aug 2019 19:57:37 +0200 Subject: [PATCH] Serbian language code update "rs" -> "sr" (#4159) * Serbian stopwords added. (cyrillic alphabet) * spaCy Contribution agreement included. * Test initialize updated * Serbian language code update. --bugfix --- spacy/lang/{rs => sr}/__init__.py | 4 ++-- spacy/lang/{rs => sr}/stop_words.py | 0 spacy/tests/lang/test_initialize.py | 4 ++-- website/meta/languages.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename spacy/lang/{rs => sr}/__init__.py (91%) rename spacy/lang/{rs => sr}/stop_words.py (100%) diff --git a/spacy/lang/rs/__init__.py b/spacy/lang/sr/__init__.py similarity index 91% rename from spacy/lang/rs/__init__.py rename to spacy/lang/sr/__init__.py index 4228fb193..99090be3b 100644 --- a/spacy/lang/rs/__init__.py +++ b/spacy/lang/sr/__init__.py @@ -12,7 +12,7 @@ from ...util import update_exc, add_lookups class SerbianDefaults(Language.Defaults): lex_attr_getters = dict(Language.Defaults.lex_attr_getters) - lex_attr_getters[LANG] = lambda text: "rs" + lex_attr_getters[LANG] = lambda text: "sr" lex_attr_getters[NORM] = add_lookups( Language.Defaults.lex_attr_getters[NORM], BASE_NORMS ) @@ -21,7 +21,7 @@ class SerbianDefaults(Language.Defaults): class Serbian(Language): - lang = "rs" + lang = "sr" Defaults = SerbianDefaults diff --git a/spacy/lang/rs/stop_words.py b/spacy/lang/sr/stop_words.py similarity index 100% rename from spacy/lang/rs/stop_words.py rename to spacy/lang/sr/stop_words.py diff --git a/spacy/tests/lang/test_initialize.py b/spacy/tests/lang/test_initialize.py index f6938c252..9b01340e3 100644 --- a/spacy/tests/lang/test_initialize.py +++ b/spacy/tests/lang/test_initialize.py @@ -10,8 +10,8 @@ from spacy.util import get_lang_class # excluded: ja, ru, th, uk, vi, zh LANGUAGES = ["af", "ar", "bg", "bn", "ca", "cs", "da", "de", "el", "en", "es", "et", "fa", "fi", "fr", "ga", "he", "hi", "hr", "hu", "id", "is", - "it", "kn", "lt", "lv", "nb", "nl", "pl", "pt", "ro", "rs", "si", - "sk", "sl", "sq", "sv", "ta", "te", "tl", "tr", "tt", "ur"] + "it", "kn", "lt", "lv", "nb", "nl", "pl", "pt", "ro", "si", "sk", + "sl", "sq", "sr", "sv", "ta", "te", "tl", "tr", "tt", "ur"] # fmt: on diff --git a/website/meta/languages.json b/website/meta/languages.json index 8f91698ec..0a54efead 100644 --- a/website/meta/languages.json +++ b/website/meta/languages.json @@ -127,7 +127,7 @@ { "code": "is", "name": "Icelandic" }, { "code": "lt", "name": "Lithuanian" }, { "code": "lv", "name": "Latvian" }, - { "code": "rs", "name": "Serbian" }, + { "code": "sr", "name": "Serbian" }, { "code": "sk", "name": "Slovak" }, { "code": "sl", "name": "Slovenian" }, {