modified: app.py
This commit is contained in:
4
app.py
4
app.py
@@ -29,7 +29,7 @@ def similarity(a, b):
|
||||
return SequenceMatcher(None, a.lower(), b.lower()).ratio()
|
||||
|
||||
def clean_title(title):
|
||||
# Entfernt (feat. ...), [Remix ...], (Remix), [xyz], usw.
|
||||
# Entfernt alles in () oder []
|
||||
return re.sub(r"(\s*[\(\[][^)\]]*[\)\]])", "", title).strip()
|
||||
|
||||
@app.route("/")
|
||||
@@ -159,7 +159,7 @@ def check_answer():
|
||||
correct_answer = data.get('correct_answer', '').lower()
|
||||
game_mode = data.get('game_mode', 'artist')
|
||||
|
||||
# Titel ggf. bereinigen
|
||||
# Beim Titelmodus Klammerzusätze entfernen
|
||||
if game_mode == 'title':
|
||||
guess = clean_title(guess)
|
||||
correct_answer = clean_title(correct_answer)
|
||||
|
||||
Reference in New Issue
Block a user