/** * The scripts `foldName` and `normalize` keep, alongside `[a-z0-9]`, instead * of collapsing to a space/dropping. **The one source both import from** — do * not inline this pattern a second time, for the same reason `fold-name.ts` * itself warns against a second private fold: a table difference between * copies turns a match into a conflict. * * ## Why an allowlist and not `\p{L}\p{N}` * * Three variants were measured against every stored Team/League/Venue/City * name (57,747 Team/League/Venue names, 274,101 City names): * * | variant | Latin folds that change | * |---|---| * | `\p{L}\p{N}` + NFD | 13 — `\p{L}` matches `º`, so `1º de Maio` folds to * `"1 de maio"` losing the `º` as a space rather than keeping it attached; * `\p{N}` matches `³` in `MAC³PARK` | * | `\p{L}\p{N}` + NFKD | 13 — better (`º` → `o`) but still a change | * | **this allowlist** | **0** | * * A general Unicode-letter class touches punctuation-like letters (ordinal * indicators, superscripts) that happen to be classified `\p{L}`/`\p{N}` but * are not part of a name the way a script's own letters are. An explicit * allowlist only ever ADDS scripts we deliberately chose, so it cannot * regress a fold that already works — which is what makes it safe to widen a * function with over a dozen consumers (`league-aliases`, `country-matcher`, * `opta-league-match`, `opta-team-match`, `venue-claim-verification`, * `team-duplicate-guard`, city matching, …). * * ## Why these ten scripts and no others * * They cover the 18 locales the UI ships (`weekendgoals-ui-next/src/i18n/ * request.ts`) plus Thai and Devanagari, where GeoNames' alternate-name * coverage is dense enough to be worth keeping. **Do not add a script * speculatively** — every script added is index entries in every locale, on * every Team/League/Venue/City row. */ /** * `゙゚` — the Katakana-Hiragana voiced/semi-voiced sound marks * (dakuten/handakuten) — are listed by codepoint, not as a script. * `normalize("NFD")` decomposes a precomposed kana like バ (ba) into * `30CF 3099` (ハ + dakuten) before this pattern runs, and Unicode classifies * every combining mark as `\p{Script=Inherited}` regardless of which script * it visually modifies — NOT as `\p{Script=Katakana}`. Adding * `\p{Script=Inherited}` wholesale was tried and reverted: it also admits * the zero-width joiner/non-joiner (U+200C/200D) used inside Latin * transliterations of Pashto/Dari administrative names (e.g. GeoNames' * `ʿlaqh‌dary`), which glued two words together with an invisible character * instead of the space this allowlist used to leave — a real Latin * regression the exhaustive check below caught. Listing just the two * codepoints Japanese needs avoids that: without them `バルセロナ` silently * becomes `ハルセロナ` — a different word, not a lost accent, since バ→ハ is * a change of consonant, not of accent. Latin accents need no such carve-out: * they are already gone by the time this pattern runs, stripped by the * dedicated `̀-ͯ` pass both `fold-name.ts` and `normalize.ts` * run first. (Arabic's harakat are `Inherited` too and remain unhandled — * they were already stripped before this change, by both the old code and * the new, so leaving them out is unchanged behaviour, not a regression.) */ /** * **The safety measurement, re-run 2026-08-27 after the allowlist moved from * two Japanese codepoints to `\p{Mn}\p{Mc}` plus U+30FC.** * * Over 1,131,171 distinct names across Teams, Leagues, Venues and Cities — * 802,869 of them Latin-only — **2 Latin folds change**, and 301,371 non-Latin * names gain a fold they did not have. * * The two are `ga׳leg׳wleyah` and `nyz׳ny stwdny`: GeoNames romanisations that * use the Hebrew geresh (U+05F3) as a word separator, where it now survives * instead of becoming a space. The mark is kept deliberately — in Hebrew the * geresh is word-INTERNAL, forming letters Hebrew has no glyph for (ג׳ = "j") * — so this is a real trade rather than an oversight: two obscure Latin * transliterations against every Hebrew name that contains one. An earlier * pass claimed zero; do not restate that number without re-running the count. */ export declare const SCRIPT_ALLOWLIST: string; //# sourceMappingURL=script-allowlist.d.ts.map