move category to config
This commit is contained in:
parent
ddfa0f920b
commit
cb906fb82b
@ -8,6 +8,7 @@ import auth
|
|||||||
|
|
||||||
app_config = auth.return_app_config()
|
app_config = auth.return_app_config()
|
||||||
BASE_DIR = os.path.realpath(app_config['BASE_DIR'])
|
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)
|
log_db = sqlite3.connect("access_log.db", check_same_thread=False)
|
||||||
|
|
||||||
@ -87,21 +88,6 @@ def extract_structure_from_string(input_string):
|
|||||||
except:
|
except:
|
||||||
# first part not a number
|
# first part not a number
|
||||||
pass
|
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
|
# walk the dict in your desired priority order
|
||||||
category = None
|
category = None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user