Skip to content

betting_combat.rounds.names

Fighter names across sources: Kalshi, UFCStats, Wikipedia, the sportsbook lines and the judge scores spell one fighter differently (‘Su Mudaerji’ / ‘Sumudaerji’, ‘Sergey Spivak’ / ‘Serghei Spivac’, ‘Seok Hyun Ko’ / ‘Seokhyeon Ko’).

The research matched two sources’ bouts by name words: each fighter sharing a word of three letters or more, on the card date +/- 1 day. That rule is kept as it is (every bout it matched is matched the same way). When it finds NO bout, :func:pair_fallback is tried:

pinned one of the two names shares a word with exactly one fighter of the window's
bouts, and is that fighter (:func:`variant`): the fighter is on one bout of
the card, so that bout is the fight
similar and the other name is that bout's other fighter spelt differently
(:func:`similar`: the same letters without spaces, the same words in another
order, one name's words inside the other's, or letters >= 80% alike)
result or, when a result is given (``winner``), the two sources' winners agree, both
fighters named: the opponent under another name ('Valesca Machado' / 'Tina
Black', 2026-09-26), accepted only on the agreeing result

The research’s rule is FALLBACK = False (the parity tests pin it); production matches with the fallback.

Words are compared after :func:canon_name: letters NFKD drops (ł, the dotless i, ø đ ß æ) are transliterated first, so ‘Łukasz’ is ‘lukasz’, not ‘ukasz’.

Classes

PairMatch

The fallback’s verdict for one pair: the bout (an index into the window), whether the first name is the bout’s first fighter, and the rule (‘similar’ / ‘result’).

Functions

ascii_name

ascii_name(s: Any) -> str

The name in ASCII: transliterated (TRANSLIT), then accents dropped.

canon_name

canon_name(s: Any) -> str

Lower-case ASCII words, punctuation and suffixes (jr, sr, ii, iii, iv) removed: ‘Michael Aswell Jr.’ -> ‘michael aswell’; ‘Łukasz Brzeski’ -> ‘lukasz brzeski’.

compact

compact(s: Any) -> str

The canonical name’s letters without spaces: ‘Su Mudaerji’ -> ‘sumudaerji’.

letters_alike

letters_alike(a: Any, b: Any) -> float

How alike the two names’ letters are (SequenceMatcher ratio of the compact names).

pair_fallback

pair_fallback(a: str, b: str, bouts: Sequence[tuple[str, str]], tokens: Any, winner: str | None = None, bout_winners: Sequence[int | None] | None = None) -> PairMatch | None

The bout of bouts (the window’s (fighter 1, fighter 2) names) that the pair a v b is, when the word rule found none (see the module doc); None when no bout or several qualify.

Args: tokens: the caller’s word rule (a name -> its set of words), so ‘shares a word’ is exactly the research’s test. winner: the pair’s winner, ‘a’ or ‘b’ (None: unknown, no result rule). bout_winners: per bout, its winning slot (1 or 2; None or 0: no winner).

similar

similar(a: Any, b: Any) -> bool

One fighter spelt two ways: the same letters without spaces (in any word order), the same words in another order, one name’s words all in the other’s (‘Norma Dumont’ / ‘Norma Dumont Viana’), or letters at least SIMILAR alike (‘Sergey Spivak’ / ‘Serghei Spivac’; of the given names when the surname is one: ‘Cy’ / ‘Carl Charlie’ are two people).

strictly_same

strictly_same(a: Any, b: Any) -> bool

One fighter’s two spellings by the strict rules only (the card loader’s on our ids, taking a name it cannot find exactly; similar’s looser rules are not enough there). Accents, case, punctuation and suffixes never count (canon_name: ‘José Mauro Delano’ is ‘jose mauro delano’). The rules:

  • the same letters in any word order (‘Ko Seok-hyeon’ / ‘Seokhyeon Ko’);
  • the same surname, the given names alike (_given_alike: ‘Phil’ / ‘Philip Rowe’, ‘Joe’ / ‘Joseph Kropschot’), the surname first or last in either (‘Lee Jeong-yeong’ / ‘Jung-Young Lee’);
  • the same first name and surname with middle names in one only (‘Jose Mauro Delano’ / ‘Jose Delano’, ‘Nina Nikolija Milosevic’ / ‘Nina Milosevic’);
  • the same first name with surnames at least STRICT_SURNAME alike (‘Daria Zheleznyakova’ / ‘Daria Zhelezniakova’). The loader takes a strict match only when it is ONE fighter, near the bout’s division (services.rounds_upcoming): ‘Bruno Silva’ and ‘Bruno Gustavo da Silva’, both on the roster, each match themselves exactly and a third spelling of either is refused.

variant

variant(a: Any, b: Any) -> bool

One fighter’s two given names: :func:similar, or the same surname with one first name the start (3 letters or more) of the other (‘Chris’ / ‘Christopher Padilla’, ‘Dan’ / ‘Daniel Hooker’, ‘Montse’ / ‘Montserrat Rendon’).