/** Shorter than this is not a name, it is an abbreviation that collides. The * team-side alias audit flagged `<= 3` characters for exactly this reason. */ export declare const ALIAS_MIN_LENGTH = 4; /** How many language editions must share a title before it counts as a name * rather than a translation of one. Wikidata's per-language forms are mostly * translations — the venue epic learned that the expensive way — and a title * three independent wikis chose is not one. Two is too low: `zh`, `zh-min-nan` * and `wuu` routinely carry the same string. */ export declare const MULTI_LANGUAGE_SUPPORT = 3; /** A year, or the word for one. A Wikipedia redirect set is full of season * articles, and a season is not the competition. */ export declare const SEASON_PATTERN: RegExp; /** * A title that names something ABOUT the competition rather than the * competition. Every one of these is a real Wikipedia redirect into a league * article we hold — `FA Cup Player of the Month`, `Premier League Top Scorers`, * `List of English Isthmian League Premier teams`, `Premierleague.com`, * `Major League Soccer's most valuable teams`. As an alias each is a search * term that returns the league for a query that did not ask for it. */ export declare const SUB_TOPIC_PATTERN: RegExp; export declare function tierTokens(name: string): string[]; /** The name forms of one Wikidata entity, split by how much they are worth. * `english` are curated on the entity itself — the label and its `aliases`, * which are the "also known as" a human typed. `perLanguage` are the article * titles of every language edition, which are mostly translations and are only * usable in bulk. */ export interface EntityNameForms { english: string[]; perLanguage: Record; } /** * Every distinct form of an entity's name, with the number of language editions * behind each. English label and aliases come back with a count of * `MULTI_LANGUAGE_SUPPORT` so a caller applying the support threshold keeps * them — they are not translations, and demanding cross-language support of a * hand-written English alias would drop `Premiership` and `EPL`. */ export declare function entityNameForms(entity: EntityNameForms): { name: string; languages: number; }[]; /** * TheSportsDB's `strLeagueAlternate` is comma-separated when it is separated at * all — `"Bundesliga, Fußball-Bundesliga"` but also * `"Brazil Brasileirão Série A Brasileiro"`, which is three names run together * with no delimiter. Splitting is all that can be done honestly; the run-on * survives as one candidate and is caught, if at all, by the guards below. */ export declare function splitSportsDbAlternates(raw: string): string[]; /** The alias reasons, as written into the proposal's `reason` column. */ export type AliasRejection = "too-short" | "unfoldable" | "is-own-name" | "already-held" | "is-another-leagues-name" | "tier-mismatch" | "season" | "sub-topic" | "qualified" | "generic" | "is-a-team-name" | "contradicts-gender" | "contradicts-squad" | "unsupported-translation"; export interface AliasContext { /** The row's own display name. */ leagueName: string; /** The row's `_id`, so a name it owns itself is not read as a collision. */ leagueId: string; /** Aliases the row already holds, folded. */ heldFolded: Set; /** Folded display name → the ids of the leagues called that. */ nameOwners: Map; /** Folded names of every club we hold. A Wikipedia redirect set contains * clubs whose own article was merged into a league's — `SV Rugenbergen` * redirects to the Oberliga Hamburg — and a club name on a league is how * Chile's Segunda División came to answer to `colo colo`. */ teamNames?: Set; /** What the row is, as LEA-10 left it. A candidate carrying the OPPOSITE * marker is a different competition; a candidate carrying none is silent, * which LEA-7 learned the hard way is not the same thing. */ gender?: string; squad?: string; /** How many language editions carry this candidate, when it came from a * per-language source. Omit for a source that is not a translation. */ languages?: number; } /** * Why this candidate may not be added, or `undefined` if it may. * * The order matters only for which reason gets reported; the checks are * independent. The one that does the work is `is-another-leagues-name`: it is * the guard the venue epic states outright, and the reason "World Cup" must * never sit on the AFC Cup even if some source offers it. */ export declare function rejectionOf(candidate: string, ctx: AliasContext): AliasRejection | undefined; /** * Whether an alias the row holds came from an entity it no longer holds. * * `oldForms` are the name forms of the replaced or cleared entity, `newForms` * those of the entity the row holds now. An alias supported by the current * entity is kept whatever the old one said — the two competitions can share a * name form, and the alias is then no longer evidence of the wrong match. */ export declare function contaminationOf(alias: string, oldForms: string[], newForms?: string[]): boolean; //# sourceMappingURL=league-aliases.d.ts.map