@weekendgoals/weekendgoals-common 1.2156.31300919521 → 1.2157.31304778746
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/matching/league-aliases.d.ts +12 -0
- package/dist/matching/league-aliases.d.ts.map +1 -1
- package/dist/matching/league-aliases.js +5 -5
- package/dist/matching/league-aliases.js.map +1 -1
- package/dist/matching/league-display-names.d.ts +132 -0
- package/dist/matching/league-display-names.d.ts.map +1 -0
- package/dist/matching/league-display-names.js +221 -0
- package/dist/matching/league-display-names.js.map +1 -0
- package/dist/matching/normalize.d.ts +9 -0
- package/dist/matching/normalize.d.ts.map +1 -1
- package/dist/matching/normalize.js +28 -4
- package/dist/matching/normalize.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,18 @@ export declare const ALIAS_MIN_LENGTH = 4;
|
|
|
7
7
|
* three independent wikis chose is not one. Two is too low: `zh`, `zh-min-nan`
|
|
8
8
|
* and `wuu` routinely carry the same string. */
|
|
9
9
|
export declare const MULTI_LANGUAGE_SUPPORT = 3;
|
|
10
|
+
/** A year, or the word for one. A Wikipedia redirect set is full of season
|
|
11
|
+
* articles, and a season is not the competition. */
|
|
12
|
+
export declare const SEASON_PATTERN: RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* A title that names something ABOUT the competition rather than the
|
|
15
|
+
* competition. Every one of these is a real Wikipedia redirect into a league
|
|
16
|
+
* article we hold — `FA Cup Player of the Month`, `Premier League Top Scorers`,
|
|
17
|
+
* `List of English Isthmian League Premier teams`, `Premierleague.com`,
|
|
18
|
+
* `Major League Soccer's most valuable teams`. As an alias each is a search
|
|
19
|
+
* term that returns the league for a query that did not ask for it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SUB_TOPIC_PATTERN: RegExp;
|
|
10
22
|
export declare function tierTokens(name: string): string[];
|
|
11
23
|
/** The name forms of one Wikidata entity, split by how much they are worth.
|
|
12
24
|
* `english` are curated on the entity itself — the label and its `aliases`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-aliases.d.ts","sourceRoot":"","sources":["../../src/matching/league-aliases.ts"],"names":[],"mappings":"AAqBA;+EAC+E;AAC/E,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;iDAIiD;AACjD,eAAO,MAAM,sBAAsB,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"league-aliases.d.ts","sourceRoot":"","sources":["../../src/matching/league-aliases.ts"],"names":[],"mappings":"AAqBA;+EAC+E;AAC/E,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC;;;;iDAIiD;AACjD,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;qDACqD;AACrD,eAAO,MAAM,cAAc,QAA2C,CAAC;AAEvE;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,QAuB7B,CAAC;AA6EF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAsBjD;AAKD;;;;sBAIsB;AACtB,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe,GACtB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,CAqBvC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAK7D;AAED,yEAAyE;AACzE,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,YAAY,GACZ,aAAa,GACb,cAAc,GACd,yBAAyB,GACzB,eAAe,GACf,QAAQ,GACR,WAAW,GACX,WAAW,GACX,SAAS,GACT,gBAAgB,GAChB,oBAAoB,GACpB,mBAAmB,GACnB,yBAAyB,CAAC;AAE9B,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAC;IACjB,6CAA6C;IAC7C,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,gEAAgE;IAChE,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC;;;kEAG8D;IAC9D,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB;;kEAE8D;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;4EACwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,YAAY,GAChB,cAAc,GAAG,SAAS,CAiE5B;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,GAAE,MAAM,EAAO,GACtB,OAAO,CAKT"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MULTI_LANGUAGE_SUPPORT = exports.ALIAS_MIN_LENGTH = void 0;
|
|
3
|
+
exports.SUB_TOPIC_PATTERN = exports.SEASON_PATTERN = exports.MULTI_LANGUAGE_SUPPORT = exports.ALIAS_MIN_LENGTH = void 0;
|
|
4
4
|
exports.tierTokens = tierTokens;
|
|
5
5
|
exports.entityNameForms = entityNameForms;
|
|
6
6
|
exports.splitSportsDbAlternates = splitSportsDbAlternates;
|
|
@@ -37,7 +37,7 @@ exports.ALIAS_MIN_LENGTH = 4;
|
|
|
37
37
|
exports.MULTI_LANGUAGE_SUPPORT = 3;
|
|
38
38
|
/** A year, or the word for one. A Wikipedia redirect set is full of season
|
|
39
39
|
* articles, and a season is not the competition. */
|
|
40
|
-
|
|
40
|
+
exports.SEASON_PATTERN = /\b(1[89]\d{2}|20\d{2})\b|\bseasons?\b/i;
|
|
41
41
|
/**
|
|
42
42
|
* A title that names something ABOUT the competition rather than the
|
|
43
43
|
* competition. Every one of these is a real Wikipedia redirect into a league
|
|
@@ -46,7 +46,7 @@ const SEASON_PATTERN = /\b(1[89]\d{2}|20\d{2})\b|\bseasons?\b/i;
|
|
|
46
46
|
* `Major League Soccer's most valuable teams`. As an alias each is a search
|
|
47
47
|
* term that returns the league for a query that did not ask for it.
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
exports.SUB_TOPIC_PATTERN = new RegExp([
|
|
50
50
|
"\\blists? of\\b",
|
|
51
51
|
"\\bhistory of\\b",
|
|
52
52
|
"\\btop scorers?\\b",
|
|
@@ -259,9 +259,9 @@ function rejectionOf(candidate, ctx) {
|
|
|
259
259
|
// the rows that share it all match.
|
|
260
260
|
// Checked BEFORE the tier rule, which would otherwise claim most of them: a
|
|
261
261
|
// season title carries its year, and a year is a number.
|
|
262
|
-
if (SEASON_PATTERN.test(value))
|
|
262
|
+
if (exports.SEASON_PATTERN.test(value))
|
|
263
263
|
return "season";
|
|
264
|
-
if (SUB_TOPIC_PATTERN.test(value))
|
|
264
|
+
if (exports.SUB_TOPIC_PATTERN.test(value))
|
|
265
265
|
return "sub-topic";
|
|
266
266
|
if (QUALIFIED_PATTERN.test(value))
|
|
267
267
|
return "qualified";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"league-aliases.js","sourceRoot":"","sources":["../../src/matching/league-aliases.ts"],"names":[],"mappings":";;;AAgJA,gCAsBC;AAsBD,0CAuBC;AASD,0DAKC;AAmDD,kCAoEC;AAUD,0CASC;AA3WD;;;;;;;;;;;;;;;;;GAiBG;AACH,iEAAiE;AACjE,2CAAuC;AAEvC;+EAC+E;AAClE,QAAA,gBAAgB,GAAG,CAAC,CAAC;AAElC;;;;iDAIiD;AACpC,QAAA,sBAAsB,GAAG,CAAC,CAAC;AAExC;qDACqD;
|
|
1
|
+
{"version":3,"file":"league-aliases.js","sourceRoot":"","sources":["../../src/matching/league-aliases.ts"],"names":[],"mappings":";;;AAgJA,gCAsBC;AAsBD,0CAuBC;AASD,0DAKC;AAmDD,kCAoEC;AAUD,0CASC;AA3WD;;;;;;;;;;;;;;;;;GAiBG;AACH,iEAAiE;AACjE,2CAAuC;AAEvC;+EAC+E;AAClE,QAAA,gBAAgB,GAAG,CAAC,CAAC;AAElC;;;;iDAIiD;AACpC,QAAA,sBAAsB,GAAG,CAAC,CAAC;AAExC;qDACqD;AACxC,QAAA,cAAc,GAAG,wCAAwC,CAAC;AAEvE;;;;;;;GAOG;AACU,QAAA,iBAAiB,GAAG,IAAI,MAAM,CACzC;IACE,iBAAiB;IACjB,kBAAkB;IAClB,oBAAoB;IACpB,yCAAyC;IACzC,eAAe;IACf,oBAAoB;IACpB,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,qBAAqB;IACrB,eAAe;IACf,4BAA4B;IAC5B,+EAA+E;IAC/E,6BAA6B;CAC9B,CAAC,IAAI,CAAC,GAAG,CAAC,EACX,GAAG,CACJ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ;IAC1E,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU;IACxE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU;IAC1E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS;CAClE,CAAC,C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ME_MIN_LENGTH = 4;
|
|
3
|
+
/**
|
|
4
|
+
* The article title behind a stored `metadata.wikipediaUrl`.
|
|
5
|
+
*
|
|
6
|
+
* The stored form is `encodeURIComponent` of the underscored title (LEA-12), so
|
|
7
|
+
* both have to be undone. A URL that is not an article link yields "" rather
|
|
8
|
+
* than a guess.
|
|
9
|
+
*/
|
|
10
|
+
export declare function articleTitleFromUrl(url: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* The display name an article title proposes.
|
|
13
|
+
*
|
|
14
|
+
* Wikipedia disambiguates with a trailing parenthetical — `National League
|
|
15
|
+
* (English football)`, `Premier League (Ghana)` — which is the article
|
|
16
|
+
* system's own bookkeeping and not part of the name. Nobody searches with it,
|
|
17
|
+
* and LEA-11 refuses an alias that carries one for the same reason.
|
|
18
|
+
*
|
|
19
|
+
* Only a TRAILING parenthetical is stripped. A parenthesis in the middle of a
|
|
20
|
+
* title is part of the name as written, and a title that is nothing but a
|
|
21
|
+
* parenthetical is not a name at all.
|
|
22
|
+
*/
|
|
23
|
+
export declare function displayNameFromTitle(title: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* How a proposal relates to the name we hold.
|
|
26
|
+
*
|
|
27
|
+
* - `same` — nothing to do.
|
|
28
|
+
* - `qualifies` — the name we hold survives inside the proposal, which only
|
|
29
|
+
* adds the context it lacked: `Cup` → `Ukrainian Cup`,
|
|
30
|
+
* `Premier League` → `Egyptian Premier League`. This is the
|
|
31
|
+
* disambiguation the ticket exists for, and it is the class
|
|
32
|
+
* where the authority can be wrong only about the qualifier.
|
|
33
|
+
* - `replaces` — a different name altogether: `Superliga` → `Kategoria
|
|
34
|
+
* Superiore`, but also `Liga Nacional` → `Liga Bantrab` (a
|
|
35
|
+
* sponsor) and `Liga 1` → `Super League` (less identifying
|
|
36
|
+
* than what we hold). Many are correct and none is safe to
|
|
37
|
+
* apply mechanically, so the two classes are reported apart.
|
|
38
|
+
*
|
|
39
|
+
* Comparison is on folded tokens, so `Türkiye Kupası` and `Turkiye Kupasi` are
|
|
40
|
+
* the same name and an accent is never a rename.
|
|
41
|
+
*/
|
|
42
|
+
export type RenameKind = "same" | "qualifies" | "replaces";
|
|
43
|
+
export declare function renameKind(current: string, proposed: string): RenameKind;
|
|
44
|
+
export type RenameRejection =
|
|
45
|
+
/** Nothing to propose — no entity, no article, or an empty title. */
|
|
46
|
+
"no-authority"
|
|
47
|
+
/** The proposal all but vanishes in the fold, so `searchNames` could never
|
|
48
|
+
* match it and every guard here would pass it vacuously. */
|
|
49
|
+
| "unfoldable" | "too-short"
|
|
50
|
+
/** Another row in the SAME country already displays this name. The unique
|
|
51
|
+
* `{country, name}` index would reject the write, so this must be caught
|
|
52
|
+
* before it is attempted rather than thrown by the driver. */
|
|
53
|
+
| "collides-in-country"
|
|
54
|
+
/** Another row anywhere displays this name. Renaming into it would add to
|
|
55
|
+
* the 289-row collision this ticket exists to reduce. */
|
|
56
|
+
| "is-another-leagues-name"
|
|
57
|
+
/** Two or more of our rows hold this entity, so the article names the thing
|
|
58
|
+
* they have in common and not this row. Spain's 19 Tercera rows are one
|
|
59
|
+
* competition (LEA-5's `section-family`), the three Austrian Regionalligas
|
|
60
|
+
* are a wrong shared link — either way the article is not this row's name. */
|
|
61
|
+
| "shared-entity"
|
|
62
|
+
/** The row is one of several the supplier split a competition across, so its
|
|
63
|
+
* name carries the part that distinguishes it (`Serie C - Girone C`,
|
|
64
|
+
* `Kakkonen - Lohko A`). The article is the family's. Naming a family is one
|
|
65
|
+
* decision about all of its rows and LEA-5 owns the grouping; a per-row
|
|
66
|
+
* rename here collapses siblings onto one name. */
|
|
67
|
+
| "in-a-family"
|
|
68
|
+
/** Play-offs, qualification and promotion rounds — explicitly out of this
|
|
69
|
+
* ticket's scope, and the rows whose entity LEA-5 was still deciding. */
|
|
70
|
+
| "stage-row"
|
|
71
|
+
/** The article states a tier ours does not, or a different one. It is the
|
|
72
|
+
* whole difference between `Tunisian Ligue 1` and `Tunisian Ligue 3`, and
|
|
73
|
+
* the tell for a link that went to the wrong tier. */
|
|
74
|
+
| "tier-mismatch" | "contradicts-gender" | "contradicts-squad"
|
|
75
|
+
/** A season article, or an article about something ABOUT the competition. */
|
|
76
|
+
| "season" | "sub-topic"
|
|
77
|
+
/** The article is a different sport's competition. */
|
|
78
|
+
| "other-sport";
|
|
79
|
+
export interface RenameContext {
|
|
80
|
+
/** The row's own display name. */
|
|
81
|
+
leagueName: string;
|
|
82
|
+
/** The row's `_id`, so its own name is never read as another league's. */
|
|
83
|
+
leagueId: string;
|
|
84
|
+
/** The row's supplier country string, for the unique-index check. */
|
|
85
|
+
country: string;
|
|
86
|
+
/** Folded display name → the ids of the leagues called that. */
|
|
87
|
+
nameOwners: Map<string, string[]>;
|
|
88
|
+
/** Folded `country|name` → the ids of the leagues called that in that
|
|
89
|
+
* country. This is the unique index, expressed. */
|
|
90
|
+
countryNameOwners: Map<string, string[]>;
|
|
91
|
+
/** How many of our rows hold the entity this proposal came from. */
|
|
92
|
+
entityClaimants: number;
|
|
93
|
+
/** How many rows share this row's `competitionGroup`. 1, or 0 for a row in
|
|
94
|
+
* no family, means the row stands alone. */
|
|
95
|
+
familySize: number;
|
|
96
|
+
competitionRole?: string;
|
|
97
|
+
gender?: string;
|
|
98
|
+
squad?: string;
|
|
99
|
+
}
|
|
100
|
+
/** The `{country, name}` key the unique index is built on, folded so a rename
|
|
101
|
+
* differing only by accent is still caught. */
|
|
102
|
+
export declare function countryNameKey(country: string, name: string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Why this row may not be renamed to this name, or `undefined` if it may.
|
|
105
|
+
*
|
|
106
|
+
* Order matters only for which reason is reported. `collides-in-country` is
|
|
107
|
+
* checked before the softer rules because it is the one that would otherwise
|
|
108
|
+
* surface as a driver error mid-apply.
|
|
109
|
+
*/
|
|
110
|
+
export declare function renameRejectionOf(proposed: string, ctx: RenameContext): RenameRejection | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* The `LEAGUE_ALIASES` targets that a collection of leagues would no longer
|
|
113
|
+
* answer to — the check a rename has to survive.
|
|
114
|
+
*
|
|
115
|
+
* That table rewrites an Opta league name into **our display name**, and the
|
|
116
|
+
* Opta rankings ingest then resolves it by one exact lookup on
|
|
117
|
+
* `normalize(name)::normalizeCountry(country)`. A miss is not retried: the row
|
|
118
|
+
* goes to `notFound` and is absent from the payload posted to
|
|
119
|
+
* `/ingest/leagues/classify`, so `rating` and `globalRank` quietly stop being
|
|
120
|
+
* refreshed for that league — and `globalRank` orders every homepage section.
|
|
121
|
+
*
|
|
122
|
+
* Renaming a league is the one thing that breaks a target silently, which is
|
|
123
|
+
* why the check belongs beside the rename rather than in the ingest: three of
|
|
124
|
+
* the 38 targets named rows LEA-6 renamed, and nothing would have said so.
|
|
125
|
+
*
|
|
126
|
+
* Pass the names the collection will hold **after** the renames are applied.
|
|
127
|
+
*/
|
|
128
|
+
export declare function staleLeagueAliasTargets(leagues: {
|
|
129
|
+
name?: string;
|
|
130
|
+
country?: string;
|
|
131
|
+
}[]): string[];
|
|
132
|
+
//# sourceMappingURL=league-display-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"league-display-names.d.ts","sourceRoot":"","sources":["../../src/matching/league-display-names.ts"],"names":[],"mappings":"AAgCA,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAUvD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAI1D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAC;AAE3D,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,CAMxE;AAaD,MAAM,MAAM,eAAe;AACzB,qEAAqE;AACnE,cA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,EAAE,CAOV"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DISPLAY_NAME_MIN_LENGTH = void 0;
|
|
4
|
+
exports.articleTitleFromUrl = articleTitleFromUrl;
|
|
5
|
+
exports.displayNameFromTitle = displayNameFromTitle;
|
|
6
|
+
exports.renameKind = renameKind;
|
|
7
|
+
exports.countryNameKey = countryNameKey;
|
|
8
|
+
exports.renameRejectionOf = renameRejectionOf;
|
|
9
|
+
exports.staleLeagueAliasTargets = staleLeagueAliasTargets;
|
|
10
|
+
/**
|
|
11
|
+
* LEA-6 — what a league should be CALLED, and every reason a proposed name
|
|
12
|
+
* must be refused.
|
|
13
|
+
*
|
|
14
|
+
* 291 of our 1,239 rows shared a display name with another row when this was
|
|
15
|
+
* written; `Cup` was 37 different competitions and `Super Cup` 52. The
|
|
16
|
+
* supplier names a row by what the competition is called *within* its country,
|
|
17
|
+
* which is exactly the context a list of leagues from every country does not
|
|
18
|
+
* have. Applying these rules took it to 123 rows across 30 names.
|
|
19
|
+
*
|
|
20
|
+
* **The authority is the English Wikipedia article title of the row's linked
|
|
21
|
+
* entity**, with Wikidata's official name (`P1448`) as corroborating evidence.
|
|
22
|
+
* That is VEN-7's policy for venues, unchanged: Wikipedia's naming policy has
|
|
23
|
+
* already made these judgement calls — it uses the common name, and it
|
|
24
|
+
* disambiguates by country precisely where we need it to (`Ukrainian Cup`,
|
|
25
|
+
* `Egyptian Premier League`, `Cymru Premier`).
|
|
26
|
+
*
|
|
27
|
+
* The authority is not applied blind. Every rule below refuses a proposal that
|
|
28
|
+
* a measured row would have got wrong, and the two that do the most work are
|
|
29
|
+
* not about the name at all — they are about whether the row is the only thing
|
|
30
|
+
* claiming its entity, and whether it is one of several rows the supplier split
|
|
31
|
+
* a competition across.
|
|
32
|
+
*/
|
|
33
|
+
const squad_gender_1 = require("../classification/squad-gender");
|
|
34
|
+
const fold_name_1 = require("./fold-name");
|
|
35
|
+
const normalize_1 = require("./normalize");
|
|
36
|
+
const league_aliases_1 = require("./league-aliases");
|
|
37
|
+
/** Shorter than this is not a display name. Matches the alias floor. */
|
|
38
|
+
exports.DISPLAY_NAME_MIN_LENGTH = 4;
|
|
39
|
+
/**
|
|
40
|
+
* The article title behind a stored `metadata.wikipediaUrl`.
|
|
41
|
+
*
|
|
42
|
+
* The stored form is `encodeURIComponent` of the underscored title (LEA-12), so
|
|
43
|
+
* both have to be undone. A URL that is not an article link yields "" rather
|
|
44
|
+
* than a guess.
|
|
45
|
+
*/
|
|
46
|
+
function articleTitleFromUrl(url) {
|
|
47
|
+
const raw = String(url !== null && url !== void 0 ? url : "").trim();
|
|
48
|
+
const match = /\/wiki\/([^?#]+)/.exec(raw);
|
|
49
|
+
if (!match)
|
|
50
|
+
return "";
|
|
51
|
+
try {
|
|
52
|
+
return decodeURIComponent(match[1]).replace(/_/g, " ").trim();
|
|
53
|
+
}
|
|
54
|
+
catch (_a) {
|
|
55
|
+
// A malformed percent-escape is not a title.
|
|
56
|
+
return "";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The display name an article title proposes.
|
|
61
|
+
*
|
|
62
|
+
* Wikipedia disambiguates with a trailing parenthetical — `National League
|
|
63
|
+
* (English football)`, `Premier League (Ghana)` — which is the article
|
|
64
|
+
* system's own bookkeeping and not part of the name. Nobody searches with it,
|
|
65
|
+
* and LEA-11 refuses an alias that carries one for the same reason.
|
|
66
|
+
*
|
|
67
|
+
* Only a TRAILING parenthetical is stripped. A parenthesis in the middle of a
|
|
68
|
+
* title is part of the name as written, and a title that is nothing but a
|
|
69
|
+
* parenthetical is not a name at all.
|
|
70
|
+
*/
|
|
71
|
+
function displayNameFromTitle(title) {
|
|
72
|
+
const value = String(title !== null && title !== void 0 ? title : "").trim();
|
|
73
|
+
const stripped = value.replace(/\s*\([^()]*\)\s*$/, "").trim();
|
|
74
|
+
return stripped || value;
|
|
75
|
+
}
|
|
76
|
+
function renameKind(current, proposed) {
|
|
77
|
+
const ours = (0, fold_name_1.foldName)(current);
|
|
78
|
+
const theirs = (0, fold_name_1.foldName)(proposed);
|
|
79
|
+
if (!ours || !theirs)
|
|
80
|
+
return "replaces";
|
|
81
|
+
if (ours === theirs)
|
|
82
|
+
return "same";
|
|
83
|
+
return containsTokens(theirs, ours) ? "qualifies" : "replaces";
|
|
84
|
+
}
|
|
85
|
+
/** Whether `haystack` contains `needle` as a run of whole folded tokens. */
|
|
86
|
+
function containsTokens(haystack, needle) {
|
|
87
|
+
const h = haystack.split(" ");
|
|
88
|
+
const n = needle.split(" ");
|
|
89
|
+
if (!n.length || n.length > h.length)
|
|
90
|
+
return false;
|
|
91
|
+
for (let i = 0; i + n.length <= h.length; i++) {
|
|
92
|
+
if (n.every((t, j) => h[i + j] === t))
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
/** The `{country, name}` key the unique index is built on, folded so a rename
|
|
98
|
+
* differing only by accent is still caught. */
|
|
99
|
+
function countryNameKey(country, name) {
|
|
100
|
+
return `${(0, fold_name_1.foldName)(country)}|${(0, fold_name_1.foldName)(name)}`;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* An age code is not a tier, and it is the one place the two are confusable.
|
|
104
|
+
*
|
|
105
|
+
* `U19 Bundesliga` and `Under 19 Bundesliga` are the same competition written
|
|
106
|
+
* two ways, and only the second leaves a bare `19` for `tierTokens` to read as
|
|
107
|
+
* a fourth division — LEA-12 measured exactly this asymmetry from the other
|
|
108
|
+
* side. Both names are stripped of their age codes before their tiers are
|
|
109
|
+
* compared, so the age axis is left to `markersFromName`, which is what
|
|
110
|
+
* understands it.
|
|
111
|
+
*/
|
|
112
|
+
const AGE_CODE = /\b(u|under|sub|u-)\s*-?\s*(\d{2})\b/gi;
|
|
113
|
+
function withoutAgeCodes(name) {
|
|
114
|
+
return String(name !== null && name !== void 0 ? name : "").replace(AGE_CODE, " ");
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A sport that is not association football.
|
|
118
|
+
*
|
|
119
|
+
* LEA-7 gates a *match* on the entity being a football competition, but it
|
|
120
|
+
* retained 171 pre-existing links it could not verify, and one of them is
|
|
121
|
+
* Northern Ireland's `Championship` (468 fixtures) pointing at the **Rugby
|
|
122
|
+
* Football League Championship**. A name is the loudest possible symptom of
|
|
123
|
+
* that and the cheapest place to catch it: our collection is association
|
|
124
|
+
* football only — no row of the 1,239 names any of these sports — so a
|
|
125
|
+
* proposal that does is about a different competition.
|
|
126
|
+
*/
|
|
127
|
+
const OTHER_SPORT = /\b(rugby|cricket|basketball|handball|volleyball|baseball|netball|futsal|hockey|athletics|esports?|motorsport)\b/i;
|
|
128
|
+
/**
|
|
129
|
+
* Why this row may not be renamed to this name, or `undefined` if it may.
|
|
130
|
+
*
|
|
131
|
+
* Order matters only for which reason is reported. `collides-in-country` is
|
|
132
|
+
* checked before the softer rules because it is the one that would otherwise
|
|
133
|
+
* surface as a driver error mid-apply.
|
|
134
|
+
*/
|
|
135
|
+
function renameRejectionOf(proposed, ctx) {
|
|
136
|
+
var _a, _b;
|
|
137
|
+
const value = String(proposed !== null && proposed !== void 0 ? proposed : "").trim();
|
|
138
|
+
if (!value)
|
|
139
|
+
return "no-authority";
|
|
140
|
+
if (ctx.competitionRole === "stage")
|
|
141
|
+
return "stage-row";
|
|
142
|
+
if (ctx.entityClaimants > 1)
|
|
143
|
+
return "shared-entity";
|
|
144
|
+
if (ctx.familySize > 1)
|
|
145
|
+
return "in-a-family";
|
|
146
|
+
if (value.length < exports.DISPLAY_NAME_MIN_LENGTH)
|
|
147
|
+
return "too-short";
|
|
148
|
+
const folded = (0, fold_name_1.foldName)(value);
|
|
149
|
+
const foldedLetters = folded.replace(/ /g, "");
|
|
150
|
+
const rawLetters = value.replace(/\s/g, "");
|
|
151
|
+
if (foldedLetters.length < exports.DISPLAY_NAME_MIN_LENGTH)
|
|
152
|
+
return "unfoldable";
|
|
153
|
+
// A name that loses more than half of itself in the fold is one `searchNames`
|
|
154
|
+
// cannot represent — `Серыя A` folds to the letter `a`.
|
|
155
|
+
if (foldedLetters.length * 2 < rawLetters.length)
|
|
156
|
+
return "unfoldable";
|
|
157
|
+
const inCountry = ((_a = ctx.countryNameOwners.get(countryNameKey(ctx.country, value))) !== null && _a !== void 0 ? _a : []).filter((id) => id !== ctx.leagueId);
|
|
158
|
+
if (inCountry.length)
|
|
159
|
+
return "collides-in-country";
|
|
160
|
+
const anywhere = ((_b = ctx.nameOwners.get(folded)) !== null && _b !== void 0 ? _b : []).filter((id) => id !== ctx.leagueId);
|
|
161
|
+
if (anywhere.length)
|
|
162
|
+
return "is-another-leagues-name";
|
|
163
|
+
if (league_aliases_1.SEASON_PATTERN.test(value))
|
|
164
|
+
return "season";
|
|
165
|
+
// Both of the next two are SYMMETRIC: a token the row already carries in its
|
|
166
|
+
// own name cannot be evidence that the proposal is about something else.
|
|
167
|
+
// Without that, `FA Trophy` [Malta] was refused its own article because the
|
|
168
|
+
// alias rule reads `trophy` as a sub-topic (`Premier League Trophy`), and
|
|
169
|
+
// `Fotbolti.net Cup A` was refused because `.net` reads as a website. Asked
|
|
170
|
+
// symmetrically the rule still refuses what it is for — `Kvindeliga` →
|
|
171
|
+
// *Football in Denmark* is an article about the country's football, and our
|
|
172
|
+
// name says nothing of the kind.
|
|
173
|
+
if (league_aliases_1.SUB_TOPIC_PATTERN.test(value) &&
|
|
174
|
+
!league_aliases_1.SUB_TOPIC_PATTERN.test(ctx.leagueName)) {
|
|
175
|
+
return "sub-topic";
|
|
176
|
+
}
|
|
177
|
+
if (OTHER_SPORT.test(value) && !OTHER_SPORT.test(ctx.leagueName)) {
|
|
178
|
+
return "other-sport";
|
|
179
|
+
}
|
|
180
|
+
const ourTier = (0, league_aliases_1.tierTokens)(withoutAgeCodes(ctx.leagueName));
|
|
181
|
+
const theirTier = (0, league_aliases_1.tierTokens)(withoutAgeCodes(value));
|
|
182
|
+
if (theirTier.length &&
|
|
183
|
+
(theirTier.length !== ourTier.length ||
|
|
184
|
+
!theirTier.every((t, i) => t === ourTier[i]))) {
|
|
185
|
+
return "tier-mismatch";
|
|
186
|
+
}
|
|
187
|
+
const markers = (0, squad_gender_1.markersFromName)(value);
|
|
188
|
+
if (markers.gender && ctx.gender && markers.gender !== ctx.gender) {
|
|
189
|
+
return "contradicts-gender";
|
|
190
|
+
}
|
|
191
|
+
// Only `youth` is checked: `markersFromName` never asserts `senior`, so
|
|
192
|
+
// silence about age is not a claim of adulthood (LEA-9).
|
|
193
|
+
if (markers.squad === "youth" && ctx.squad && ctx.squad !== "youth") {
|
|
194
|
+
return "contradicts-squad";
|
|
195
|
+
}
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The `LEAGUE_ALIASES` targets that a collection of leagues would no longer
|
|
200
|
+
* answer to — the check a rename has to survive.
|
|
201
|
+
*
|
|
202
|
+
* That table rewrites an Opta league name into **our display name**, and the
|
|
203
|
+
* Opta rankings ingest then resolves it by one exact lookup on
|
|
204
|
+
* `normalize(name)::normalizeCountry(country)`. A miss is not retried: the row
|
|
205
|
+
* goes to `notFound` and is absent from the payload posted to
|
|
206
|
+
* `/ingest/leagues/classify`, so `rating` and `globalRank` quietly stop being
|
|
207
|
+
* refreshed for that league — and `globalRank` orders every homepage section.
|
|
208
|
+
*
|
|
209
|
+
* Renaming a league is the one thing that breaks a target silently, which is
|
|
210
|
+
* why the check belongs beside the rename rather than in the ingest: three of
|
|
211
|
+
* the 38 targets named rows LEA-6 renamed, and nothing would have said so.
|
|
212
|
+
*
|
|
213
|
+
* Pass the names the collection will hold **after** the renames are applied.
|
|
214
|
+
*/
|
|
215
|
+
function staleLeagueAliasTargets(leagues) {
|
|
216
|
+
const held = new Set(leagues
|
|
217
|
+
.filter((l) => l.name && l.country)
|
|
218
|
+
.map((l) => { var _a, _b; return `${(0, normalize_1.normalize)((_a = l.name) !== null && _a !== void 0 ? _a : "")}::${(0, normalize_1.normalizeCountry)((_b = l.country) !== null && _b !== void 0 ? _b : "")}`; }));
|
|
219
|
+
return (0, normalize_1.leagueAliasTargets)().filter((target) => !held.has(target));
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=league-display-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"league-display-names.js","sourceRoot":"","sources":["../../src/matching/league-display-names.ts"],"names":[],"mappings":";;;AA0CA,kDAUC;AAcD,oDAIC;AAsBD,gCAMC;AA6ED,wCAEC;AAuCD,8CAuEC;AAmBD,0DASC;AA3TD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,iEAAiE;AACjE,2CAAuC;AACvC,2CAA8E;AAC9E,qDAI0B;AAE1B,wEAAwE;AAC3D,QAAA,uBAAuB,GAAG,CAAC,CAAC;AAEzC;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3C,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAChE,CAAC;IAAC,WAAM,CAAC;QACP,6CAA6C;QAC7C,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,oBAAoB,CAAC,KAAa;IAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,QAAQ,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,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -33,4 +33,13 @@ export declare function resolveLeagueAlias(normName: string, normCountry: string
|
|
|
33
33
|
name: string;
|
|
34
34
|
country: string;
|
|
35
35
|
} | null;
|
|
36
|
+
/**
|
|
37
|
+
* Every distinct `normalizedName::normalizedCountry` this table rewrites TO.
|
|
38
|
+
*
|
|
39
|
+
* Exposed so a rename can be checked against it before it is applied: each one
|
|
40
|
+
* has to name a league we actually hold, and a rename is the only thing that
|
|
41
|
+
* silently makes one stop doing so. `staleLeagueAliasTargets` in
|
|
42
|
+
* `matching/league-display-names` is the check.
|
|
43
|
+
*/
|
|
44
|
+
export declare function leagueAliasTargets(): string[];
|
|
36
45
|
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/matching/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS9C;AAkCD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxD;AA6DD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAK1C;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,QACyT,CAAC;AAEpV,eAAO,MAAM,aAAa,QACmI,CAAC;AAE9J;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAI1D;
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/matching/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6CAA6C,CAAC;AAEvE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAS9C;AAkCD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGxD;AA6DD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAK1C;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,QACyT,CAAC;AAEpV,eAAO,MAAM,aAAa,QACmI,CAAC;AAE9J;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAI1D;AA0ED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAK1C;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C"}
|
|
@@ -6,6 +6,7 @@ exports.normalizeCountry = normalizeCountry;
|
|
|
6
6
|
exports.resolveTeamAlias = resolveTeamAlias;
|
|
7
7
|
exports.inferCategory = inferCategory;
|
|
8
8
|
exports.resolveLeagueAlias = resolveLeagueAlias;
|
|
9
|
+
exports.leagueAliasTargets = leagueAliasTargets;
|
|
9
10
|
function normalize(name) {
|
|
10
11
|
return name
|
|
11
12
|
.normalize("NFD") // decompose accents: "ä" → "a" + combining diaeresis
|
|
@@ -139,6 +140,18 @@ function inferCategory(leagueName) {
|
|
|
139
140
|
* Maps Opta league names to our DB names when they differ (sponsor names, abbreviations).
|
|
140
141
|
* Key: "normalizedOptaName::normalizedCountry"
|
|
141
142
|
* Value: "normalizedDbName::normalizedDbCountry"
|
|
143
|
+
*
|
|
144
|
+
* **The value is our display name, so renaming a league invalidates it.** The
|
|
145
|
+
* Opta rankings ingest resolves a league by one exact lookup on
|
|
146
|
+
* `normalize(name)::normalizeCountry(country)`, and a miss is not retried — the
|
|
147
|
+
* row goes to `notFound` and is simply absent from the payload posted to
|
|
148
|
+
* `/ingest/leagues/classify`, so `rating` and `globalRank` silently stop being
|
|
149
|
+
* refreshed for that league. LEA-6 renamed 188 rows and three targets here
|
|
150
|
+
* pointed at names that no longer existed (Saudi Arabia's `Pro League`,
|
|
151
|
+
* Ireland's `Premier Division`, Malta's `Premier League`). Any ticket that
|
|
152
|
+
* renames a league checks this table in the same commit; the check is
|
|
153
|
+
* `api-gateway/test/unit/league-aliases.spec.ts`, which asserts every target
|
|
154
|
+
* is a name some league actually holds.
|
|
142
155
|
*/
|
|
143
156
|
const LEAGUE_ALIASES = {
|
|
144
157
|
// Sponsor / commercial names vs generic names
|
|
@@ -146,7 +159,7 @@ const LEAGUE_ALIASES = {
|
|
|
146
159
|
"primera division::spain": "la liga::spain",
|
|
147
160
|
"mls::usa": "major league soccer::usa",
|
|
148
161
|
"mls::canada": "major league soccer::usa",
|
|
149
|
-
"saudi league::saudi arabia": "pro league::saudi arabia",
|
|
162
|
+
"saudi league::saudi arabia": "saudi pro league::saudi arabia",
|
|
150
163
|
"nike liga::slovakia": "super liga::slovakia",
|
|
151
164
|
"psl::south africa": "premier soccer league::south africa",
|
|
152
165
|
"lpf::panama": "liga panamena de futbol::panama",
|
|
@@ -164,7 +177,7 @@ const LEAGUE_ALIASES = {
|
|
|
164
177
|
"croatia prva hnl::croatia": "hnl::croatia",
|
|
165
178
|
"czech first league::czech republic": "czech liga::czech republic",
|
|
166
179
|
"cypriot division 1::cyprus": "1 division::cyprus",
|
|
167
|
-
"saudi arabian league::saudi arabia": "pro league::saudi arabia",
|
|
180
|
+
"saudi arabian league::saudi arabia": "saudi pro league::saudi arabia",
|
|
168
181
|
"chile primera::chile": "primera division::chile",
|
|
169
182
|
"slovenia prvaliga::slovenia": "1 snl::slovenia",
|
|
170
183
|
"azerbaijan premier league::azerbaijan": "premyer liqa::azerbaijan",
|
|
@@ -172,12 +185,12 @@ const LEAGUE_ALIASES = {
|
|
|
172
185
|
"south africa psl::south africa": "premier soccer league::south africa",
|
|
173
186
|
"german 3rd liga::germany": "3 liga::germany",
|
|
174
187
|
"albanian kategoria superiore::albania": "superliga::albania",
|
|
175
|
-
"irish premier league::ireland": "premier division::ireland",
|
|
188
|
+
"irish premier league::ireland": "league of ireland premier division::ireland",
|
|
176
189
|
"nigerian premier league::nigeria": "npfl::nigeria",
|
|
177
190
|
"norwegian 1 divisjon::norway": "1 division::norway",
|
|
178
191
|
"icelandic besta deild::iceland": "urvalsdeild::iceland",
|
|
179
192
|
"georgian premier league::georgia": "erovnuli liga::georgia",
|
|
180
|
-
"maltese league::malta": "premier league::malta",
|
|
193
|
+
"maltese league::malta": "maltese premier league::malta",
|
|
181
194
|
// Women's
|
|
182
195
|
"english womens super league::england": "fa wsl::england",
|
|
183
196
|
"national womens soccer league::usa": "nwsl women::usa",
|
|
@@ -202,4 +215,15 @@ function resolveLeagueAlias(normName, normCountry) {
|
|
|
202
215
|
const sep = alias.indexOf("::");
|
|
203
216
|
return { name: alias.substring(0, sep), country: alias.substring(sep + 2) };
|
|
204
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Every distinct `normalizedName::normalizedCountry` this table rewrites TO.
|
|
220
|
+
*
|
|
221
|
+
* Exposed so a rename can be checked against it before it is applied: each one
|
|
222
|
+
* has to name a league we actually hold, and a rename is the only thing that
|
|
223
|
+
* silently makes one stop doing so. `staleLeagueAliasTargets` in
|
|
224
|
+
* `matching/league-display-names` is the check.
|
|
225
|
+
*/
|
|
226
|
+
function leagueAliasTargets() {
|
|
227
|
+
return [...new Set(Object.values(LEAGUE_ALIASES))];
|
|
228
|
+
}
|
|
205
229
|
//# sourceMappingURL=normalize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/matching/normalize.ts"],"names":[],"mappings":";;;AAEA,8BASC;AAqCD,4CAGC;AAiED,4CAQC;AAkBD,sCAIC;
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/matching/normalize.ts"],"names":[],"mappings":";;;AAEA,8BASC;AAqCD,4CAGC;AAiED,4CAQC;AAkBD,sCAIC;AA8ED,gDAQC;AAUD,gDAEC;AAlPD,SAAgB,SAAS,CAAC,IAAY;IACpC,OAAO,IAAI;SACR,SAAS,CAAC,KAAK,CAAC,CAAc,qDAAqD;SACnF,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC,oCAAoC;SACpE,WAAW,EAAE;SACb,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;SACrB,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;SAC1B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,eAAe,GAA2B;IAC9C,kDAAkD;IAClD,SAAS,EAAE,QAAQ;IACnB,sBAAsB;IACtB,SAAS,EAAE,gBAAgB;IAC3B,UAAU,EAAE,OAAO;IACnB,gBAAgB,EAAE,aAAa;IAC/B,WAAW,EAAE,aAAa;IAC1B,qBAAqB,EAAE,SAAS;IAChC,yCAAyC;IACzC,cAAc,EAAE,aAAa;IAC7B,wBAAwB,EAAE,QAAQ;IAClC,YAAY,EAAE,oBAAoB;IAClC,mBAAmB,EAAE,QAAQ;IAC7B,wEAAwE;IACxE,qBAAqB,EAAE,qBAAqB;IAC5C,uBAAuB,EAAE,qBAAqB;IAC9C,8BAA8B;IAC9B,SAAS,EAAE,SAAS;IACpB,8BAA8B;IAC9B,SAAS,EAAE,SAAS;IAEpB,wBAAwB;IACxB,SAAS,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