From c5dec4c83b366d08e9b97a0520b03f1a707f1942 Mon Sep 17 00:00:00 2001 From: Mathieu Date: Thu, 14 Oct 2021 08:52:56 +0200 Subject: [PATCH] Moved languages.json and spacy.json to utils/config/ as they do not need to be user-modifiable --- jarvis/{ => utils}/config/languages.json | 0 jarvis/{ => utils}/config/spacy.json | 0 jarvis/utils/languages_utils.py | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) rename jarvis/{ => utils}/config/languages.json (100%) rename jarvis/{ => utils}/config/spacy.json (100%) diff --git a/jarvis/config/languages.json b/jarvis/utils/config/languages.json similarity index 100% rename from jarvis/config/languages.json rename to jarvis/utils/config/languages.json diff --git a/jarvis/config/spacy.json b/jarvis/utils/config/spacy.json similarity index 100% rename from jarvis/config/spacy.json rename to jarvis/utils/config/spacy.json diff --git a/jarvis/utils/languages_utils.py b/jarvis/utils/languages_utils.py index fda9c4b..8e3894f 100644 --- a/jarvis/utils/languages_utils.py +++ b/jarvis/utils/languages_utils.py @@ -21,11 +21,11 @@ def get_language_only_country(): def get_language_full_name(name=None): """ - Return for exemple french for fr-fr, english for en-en, etc (savec in languages.json in the config folder) + Return for exemple french for fr-fr, english for en-en, etc (saved in languages.json in the config folder) Return english if the language isn't found in the languages.json file """ - config_json = json.load(open(path + "/config/languages.json", encoding='utf-8', mode='r')) + config_json = json.load(open(path + "/utils/config/languages.json", encoding='utf-8', mode='r')) if name is None: name = get_language() @@ -37,7 +37,7 @@ def get_language_full_name(name=None): def get_spacy_model(language=None): - spacy_model = json.load(open(path + "/config/spacy.json", encoding='utf-8', mode='r')) + spacy_model = json.load(open(path + "/utils/config/spacy.json", encoding='utf-8', mode='r')) if language is None: language = get_language()