betting_combat.normalizers.match
match.py — the one rule for a source that names a bout’s two fighters by name (today’s
rounds.identity.match.Matcher, kept exactly, on our catalog’s bouts instead of a frame).
window the bouts within ``days`` of the row's date (sources date some cards a day apart)names each of the row's two names to the window's fighters it can be, at the strongest level any reaches: 3 the same name (``canon_name``) as one of the fighter's spellings, 2 a spelling written otherwise (``variant``), 1 a word of three letters or more in commonpair exactly one (bout, order) of the window has the two names' candidates as its two fighters; none or several: no match, with the reasonresult a row stating its winner must name the bout's winnerOrientation is never the source’s order: a match says which of OUR fighters each name is.
Classes
Candidate
A bout the matcher may pair a row with.
Matcher
Today’s rule over bouts, each fighter known by spellings (fighter_id → names).
candidates
candidates(name: str, fighters: Iterable[str]) -> tuple[set[str], int]The fighters name can be, of fighters, at the strongest level reached.
pair
pair(day: dt.date | None, x: str | None, y: str | None, winner: str | None = None, days: int = 1, bouts: Sequence[Candidate] | None = None) -> PairMatch | strThe bout x v y is, else why not. winner: the row’s winner, ‘x’ or ‘y’;
bouts: the window itself (a live card’s bouts).
window
window(day: dt.date, days: int = 1) -> list[Candidate]PairMatch
The bout a row is, and which of its fighters each of the row’s names is.