diff --git a/helperfunctions.py b/helperfunctions.py index 7ad94b1..ca8ab6c 100644 --- a/helperfunctions.py +++ b/helperfunctions.py @@ -8,6 +8,7 @@ import auth app_config = auth.return_app_config() BASE_DIR = os.path.realpath(app_config['BASE_DIR']) +CATEGORY_KEYWORDS = os.path.realpath(app_config['CATEGORY_KEYWORDS']) log_db = sqlite3.connect("access_log.db", check_same_thread=False) @@ -87,21 +88,6 @@ def extract_structure_from_string(input_string): except: # first part not a number pass - - # define your mapping: category → list of trigger-words - CATEGORY_KEYWORDS = { - 'Predigt': ['predig', 'thema'], - 'Vorwort': ['wort', 'einladung', 'begrüßung', 'ansprache', 'einleitung', 'aufruf zum', 'zuruf zum'], - 'Kinderchor': ['kinderchor'], - 'Jugendchor': ['jugendchor'], - 'Orchester': ['orchester', 'sinfonie', 'symphonie'], - 'Chor': ['chor'], - 'Gemeinsamer Gesang': ['gemeinsam', 'gemeindelied', 'gemeinsamer gesang'], - 'Gruppenlied': ['gruppenlied', 'jugend', 'lied', 'musikgruppe'], - 'Gedicht': ['gedicht'], - 'Erzählung': ['vortrag', 'erzä', 'program'], - 'Instrumental': ['instrumental', 'musikstück', 'harfenstück'], - } # walk the dict in your desired priority order category = None