feat: Add lore pack, UI adjustments, requirements.txt and INSTALL.md

This commit is contained in:
kobold-ai
2026-10-29 08:51:28 +01:00
parent fb789e8866
commit 6c62676d0d
14 changed files with 3281 additions and 2725 deletions
+18
View File
@@ -115,4 +115,22 @@ def is_answer_correct(user_input: str, canonical: str, accepted_raw: str | None
if dist <= max_allowed:
return True
# Support compound answers connected by 'und' / 'and' (e.g. "Mantikor und Feuerkrabbe")
for sep in (" und ", " and "):
if sep in target:
parts = [p.strip() for p in target.split(sep) if len(p.strip()) >= 3]
if len(parts) == 2:
u_words = u.split()
matched_both = True
for part in parts:
if part in u:
continue
# Check fuzzy match against tokens or reversed order
part_matched = any(levenshtein_distance(w, part) <= (1 if len(part) <= 6 else 2) for w in u_words)
if not part_matched:
matched_both = False
break
if matched_both:
return True
return False