feat: scaffold FastAPI backend with ports-and-adapters layout

This commit is contained in:
Justin Visser 2026-08-09 20:58:10 +02:00
parent adcf4b9df6
commit 1f40d064ad
25 changed files with 973 additions and 22 deletions

View file

@ -0,0 +1,13 @@
"""Fuzzy grounding: decide whether a search hit matches an LLM candidate."""
from difflib import SequenceMatcher
def normalize(text: str) -> str:
"""Lowercase and strip decorations that vary across releases."""
return text.lower().strip()
def title_similarity(candidate_title: str, catalog_title: str) -> float:
"""Ratio in [0, 1] between a proposed title and a catalog title."""
return SequenceMatcher(None, normalize(candidate_title), normalize(catalog_title)).ratio()