@finbheara/names 0.9.2 → 0.11.0

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.
Files changed (40) hide show
  1. package/README.md +38 -1
  2. package/dist/chunks/{index-0vg56t5v.js → index-61wk7v9c.js} +3 -3
  3. package/dist/chunks/{index-0qptxnwh.js → index-7vvt5hhy.js} +13 -2
  4. package/dist/chunks/{index-0qptxnwh.js.map → index-7vvt5hhy.js.map} +2 -2
  5. package/dist/chunks/index-ebebeamh.js +446 -0
  6. package/dist/chunks/index-ebebeamh.js.map +10 -0
  7. package/dist/chunks/{index-fzzq5txh.js → index-jx97zxtz.js} +4 -4
  8. package/dist/chunks/{index-fzzq5txh.js.map → index-jx97zxtz.js.map} +3 -3
  9. package/dist/chunks/{index-2fsdvhaf.js → index-kw6gbrnq.js} +2 -2
  10. package/dist/chunks/{index-knrkej0f.js → index-n4t288kj.js} +72 -8
  11. package/dist/chunks/{index-knrkej0f.js.map → index-n4t288kj.js.map} +5 -3
  12. package/dist/chunks/{index-d4wr471g.js → index-pncn9y2r.js} +2 -2
  13. package/dist/chunks/index-qsznkk4s.js +3 -0
  14. package/dist/chunks/index-qsznkk4s.js.map +9 -0
  15. package/dist/chunks/{index-852w8w1s.js → index-r5fp3znj.js} +3 -3
  16. package/dist/chunks/phrase-672g18kw.js +11 -0
  17. package/dist/classifier/index.js +3 -3
  18. package/dist/cli/census.js +4 -4
  19. package/dist/index.js +25 -8
  20. package/dist/index.js.map +1 -1
  21. package/dist/lexicon/index.js +1 -1
  22. package/dist/measure/index.js +4 -4
  23. package/dist/normalize/index.js +17 -5
  24. package/dist/normalize/index.js.map +1 -1
  25. package/dist/phonetic/index.js +10 -0
  26. package/dist/phonetic/index.js.map +9 -0
  27. package/dist/types/index.d.ts +2 -0
  28. package/dist/types/normalize/block-keys.d.ts +53 -0
  29. package/dist/types/normalize/index.d.ts +2 -0
  30. package/dist/types/normalize/name-columns.d.ts +51 -0
  31. package/dist/types/phonetic/double-metaphone.d.ts +25 -0
  32. package/dist/types/phonetic/index.d.ts +11 -0
  33. package/names.txt +11 -0
  34. package/package.json +8 -2
  35. package/dist/chunks/phrase-dczgr4vs.js +0 -11
  36. /package/dist/chunks/{index-0vg56t5v.js.map → index-61wk7v9c.js.map} +0 -0
  37. /package/dist/chunks/{index-2fsdvhaf.js.map → index-kw6gbrnq.js.map} +0 -0
  38. /package/dist/chunks/{index-d4wr471g.js.map → index-pncn9y2r.js.map} +0 -0
  39. /package/dist/chunks/{index-852w8w1s.js.map → index-r5fp3znj.js.map} +0 -0
  40. /package/dist/chunks/{phrase-dczgr4vs.js.map → phrase-672g18kw.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/normalize/name-scrub.ts", "../src/normalize/name-fold.ts", "../src/normalize/name-placeholder.ts", "../src/normalize/compound-surnames.ts", "../src/normalize/name-split.ts", "../src/normalize/cell-verdict.ts", "../src/normalize/name-case.ts", "../src/normalize/person-display.ts", "../src/normalize/person-name.ts", "../src/normalize/factory.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * name-scrub.ts — the three-phase treatment a printed person-name cell gets\n * before anything splits it.\n *\n * The rules, in the words that set them —\n *\n * > if there are dangling pairs (a single `\"` or `)` or `(` ) then those get\n * > replaced after the pairs are fixed\n *\n * > the credentials should probably be stripped. fix the initials (two periods\n * > are different than one). it must run on adjudicators. They are people.\n *\n * ## THE PHASE ORDER IS PART OF THE RULE\n *\n * REPAIR, then STRIP, then REFUSE. The reason is mechanical: `Samantha 0 Connor`\n * carries a digit, so a refusal that ran first would throw away a print the\n * repair can fix. Every rule below names its phase and the phases run in that\n * order, once, top to bottom.\n *\n * ## It moves AWAY from the print\n *\n * Everything here is a reading applied on the way into a derived store; it never\n * rewrites the transcription. The transcription keeps what the page printed, and\n * a consumer should keep the printed value beside the scrubbed one. Nothing here\n * is an erratum: an erratum repairs a transcription toward the page, and the\n * phase-1 repairs below are downstream readings of a print that is not being\n * re-rendered.\n *\n * ## The refusal is a value, not an exception\n *\n * A cell that cannot be a person's name scrubs to `NAME_REFUSED`, spelled\n * `!!!INVALID`. It is deliberately not a name-shaped string: it can never be\n * mistaken for a rendered `Last<<First`, it sorts and greps out of the way, and\n * a consumer that forgets to check it produces visible nonsense rather than a\n * plausible dancer. A consumer should count it, so the population is reported\n * rather than silently absorbed.\n *\n * ## What is NOT here\n *\n * - **Casing, ASCII folding, splitting.** `./name-case.ts`,\n * `../lexicon/ascii-approx.ts` and `./name-split.ts` own those and run after\n * this.\n * - **The comma.** It is the `Last, First` order separator and is read against\n * the producing document's `meta.nameFormat` by `./name-split.ts`. The one\n * comma this file touches is the credential delimiter of `Maxwell, ADCRG`,\n * which is not an order separator and would otherwise make `ADCRG` a given\n * name.\n * - **A printed status qualifier fused into the cell** (`- WMH`) — a separate\n * fact for the caller, held aside here only so the spaced-hyphen rule does\n * not close it up into a surname.\n * - **A lost byte printing as `?`** (`Jystarvard, M?jaillell`) — an erratum toward the\n * page, corrected in the transcription rather than guessed at here. The bare\n * `???` names nobody and is refused here.\n * - **A trailing `Á'` that is really in the source bytes.** Where the source file\n * itself carries `0xC1 0x27` and it is decoded faithfully, with no OCR in the\n * path, the question is whether the source is accurate, not a mis-decode this\n * layer may read through.\n */\n\nimport { canonicalTeamName } from \"./team-name.ts\";\n\n/**\n * The refusal value: a cell that cannot be a person's name.\n *\n * ONE SPELLING, EVERYWHERE. Phase 3 says the cell \"is `!!!INVALID`\", and no\n * other spelling of the refusal exists anywhere in the tree.\n */\nexport const NAME_REFUSED = \"!!!INVALID\";\n\n/** Which rule fired. Stable strings — a census and a report quote them. */\nexport type ScrubRule =\n\t// ── phase 1, repair ──────────────────────────────────────────────────────\n\t/** `0` leading a name token read back as `O`: `JESSICA 0'SULLIVAN`. */\n\t| \"ocr-zero-for-o\"\n\t/** `;` between letters read back as `i`: `KESTR;A-ROSE` → `KESTRIA-ROSE`. */\n\t| \"ocr-semicolon-for-i\"\n\t/** A standalone U+00B4 ACUTE dropped: `Fa´inne` → `Fainne`. */\n\t| \"ocr-stray-acute\"\n\t// ── phase 2, strip ───────────────────────────────────────────────────────\n\t/** A parenthesised alias removed: `Lena (Xiaoyu) Zumock` → `Lena Zumock`. */\n\t| \"strip-parens\"\n\t/** A quoted nickname removed: `Pundeallina \"Katie\" Foxe` → `Pundeallina Foxe`. */\n\t| \"strip-quotes\"\n\t/** A `(`, `)` or `\"` left over once the pairs are gone, replaced by a space. */\n\t| \"strip-dangling\"\n\t/** A trailing teaching credential removed: `Maxwell, ADCRG` → `Maxwell`. */\n\t| \"strip-credential\"\n\t/** A `.` that is not part of an initials token, replaced by a space. */\n\t| \"strip-period\"\n\t/** An initials token held together and spelled compactly: `K. T.` → `K.T.`. */\n\t| \"join-initials\"\n\t/** A literal `\\'` read back as the apostrophe it escapes: `O\\'Brien` → `O'Brien`. */\n\t| \"unescape-apostrophe\"\n\t/** `/` or `\\` replaced by a space: `MAKAYLA\\ FONNAILLOW`. */\n\t| \"strip-slash\"\n\t/** A hyphen with whitespace beside it closed up: `GRACE- OSYRNIA` → `GRACE-OSYRNIA`. */\n\t| \"close-spaced-hyphen\"\n\t/** Trailing non-letters removed: `Annika Walter,` → `Annika Walter`. */\n\t| \"strip-trailing-punct\"\n\t// ── phase 3, refuse ──────────────────────────────────────────────────────\n\t/** A digit survived phase 1: `KELSEY PEARRAILLINA - BN2018`. */\n\t| \"refuse-digit\"\n\t/** A location trailer: `London Hryniuk Lyrunnett : Western Region, Canada`. */\n\t| \"refuse-location-trailer\"\n\t/**\n\t * A parenthesised or quoted aside the `ParentheticalHandler` refused. A handler\n\t * may name its own `refuse-…` rule instead (e.g. `refuse-location-alias`).\n\t */\n\t| \"refuse-parenthetical\"\n\t| `refuse-${string}`\n\t/** One token cannot be both a surname and a given name: `Saunders`, `???`. */\n\t| \"refuse-single-token\"\n\t/**\n\t * A team designation in its canonical format, exempted from the refusals\n\t * below it: `Team`, `Team A`. The EIGHTEENTH rule, added after the others: a\n\t * team designation has a canonical format (`./team-name.ts`), which takes\n\t * `Team` out of `refuse-single-token`'s population. It repairs nothing and\n\t * strips nothing; it is recorded so the census can count the exemption rather\n\t * than report a silent gap in the refusals.\n\t */\n\t| \"accept-team\";\n\n/**\n * What an aside set apart by `( … )` or `\" … \"` in a name cell means.\n *\n * Asked once per pair, inside-out, with the trimmed text between the delimiters.\n * `\"strip\"` removes the pair (the aside is a nickname or alias:\n * `Lena (Xiaoyu) Zumock` → `Lena Zumock`). `\"refuse\"` refuses the whole cell as no\n * person's name, under `refuse-parenthetical`; `{ refuse: \"refuse-<rule>\" }`\n * refuses it under a rule the caller names.\n *\n * ASKED ONLY INSIDE THE DELIMITERS, never of a bare token: `Victoria` and\n * `London` are good given names in the open.\n */\nexport type ParentheticalHandler = (\n\taside: string,\n\tcontext: { readonly print: string; readonly delimiter: \"()\" | '\"\"' },\n) => \"strip\" | \"refuse\" | { readonly refuse: `refuse-${string}` };\n\n/** The default: every aside is an alias, and is stripped. */\nexport const stripEveryAside: ParentheticalHandler = () => \"strip\";\n\n/** Options for `scrubNameDetail`. */\nexport interface ScrubOptions {\n\t/** default: `stripEveryAside` */\n\treadonly parenthetical?: ParentheticalHandler;\n}\n\nexport interface ScrubResult {\n\t/** The scrubbed print, or `NAME_REFUSED`. */\n\tvalue: string;\n\t/** True when `value` is `NAME_REFUSED`. */\n\trefused: boolean;\n\t/** Every rule that fired, in the order the phases ran them. */\n\trules: ScrubRule[];\n}\n\n/**\n * Teaching credentials, stripped; generational suffixes, kept.\n *\n * The split is that of an earlier Java implementation, which ran over this corpus\n * for years: it lists `TCRG`, `ADCRG`, `BG`, `PHD` beside `Jr`, `II`, `III`,\n * `IV`, and only the first group is stripped (\"the credentials should probably\n * be stripped\"). `SDCRG` is added because the corpus prints it (17 panel seats)\n * and\n * it is the same kind of thing — a CLRG teaching qualification, not part of\n * anybody's name. A generational suffix IS part of the name and stays, which is\n * why `./name-split.ts`'s `NAME_SUFFIXES` still carries both groups: it has to\n * recognize what it must not make a surname.\n */\nconst CREDENTIALS: ReadonlySet<string> = new Set([\"tcrg\", \"adcrg\", \"sdcrg\", \"bg\", \"phd\"]);\n\n/**\n * The `strip-credential` rule, on its own, so the one implementation serves\n * every caller.\n *\n * TRAILING POSITION ONLY. The regex is end-anchored, which is the whole\n * content of the rule: `Bg` *inside* a name is untouched, and a bare `ADCRG`\n * with nothing before it is not a credential to strip — it is all there is.\n * The separator may be a comma or a space, because a source prints both\n * (`Claire Maxted, ADCRG` and `Alice Gellane-O'Luthindby ADCRG`), and an optional\n * full stop is allowed after the token. It loops, so `Dr. Irene Brustirley, PhD,\n * ADCRG` loses both.\n *\n * IT TAKES A PRINTED NAME *OR* A FOLDED KEY. Both are handled by the same\n * anchor: a fold key is lower-case with single spaces, so `carol quarnell\n * adcrg` matches on the space exactly as the printed form matches on the\n * comma. An adjudicator fold is the typical second caller, and a second copy of\n * these five lines is precisely what lets the two drift — a positionless\n * `split(\" \").filter(...)` copy once lost `phd` from its vocabulary, and its\n * positionlessness was then cited as the reason the fold could not use it.\n *\n * Not exported through the phase pipeline's `ScrubRule` accounting: a caller\n * that wants the rule NAMED as it fires calls `scrubNameDetail`.\n */\nexport function stripTrailingCredentials(s: string): string {\n\tlet next = s;\n\tfor (;;) {\n\t\tconst m = /[,\\s]+([\\p{L}]+)\\.?$/u.exec(next);\n\t\tif (m === null || !CREDENTIALS.has((m[1] as string).toLocaleLowerCase())) break;\n\t\tnext = next.slice(0, m.index);\n\t}\n\treturn next;\n}\n\n/**\n * A trailing token that is a printed STATUS QUALIFIER rather than half of a\n * double-barrelled name.\n *\n * IT IS HELD ASIDE, NOT STRIPPED. The marker carries the world-qualifier fact,\n * which is the caller's to read; all this set does is stop `close-spaced-hyphen`\n * from welding `ELLA McVeanaivard - WMH` into the surname `McVeanaivard-WMH`. The codes\n * are the printed status-qualifier vocabulary, listed here because this package\n * is a leaf with no dependencies.\n *\n * The qualification-CODE shape (`BN2018`, `AI2015`, `AS2015`, `BN24`, `2017`)\n * needs no list: it carries a digit, so phase 3 refuses the cell anyway.\n */\nconst STATUS_QUALIFIERS: ReadonlySet<string> = new Set([\n\t\"WQ\",\n\t\"WMH\",\n\t\"NQ\",\n\t\"REC\",\n\t\"OS\",\n\t\"R\",\n\t\"FTC\",\n\t\"HM\",\n]);\n\n/** Collapse runs of whitespace and trim. Every rule leaves its own spaces behind. */\nfunction tidy(s: string): string {\n\treturn s.replace(/\\s+/gu, \" \").trim();\n}\n\n/**\n * An INITIALS token: two or more single letters, each a separate initial, at\n * least one of them carrying a period.\n *\n * THE RULE IS THAT TWO PERIODS ARE DIFFERENT FROM ONE. `T.J. Quellane`\n * prints one given name that is spelled with two initials; `Kathryn C.\n * Komythith` prints a given name and a separate middle initial. Splitting the\n * first on its periods invents a second given name that nobody has, so the run\n * is held together as one token while `strip-period` runs, then spelled back\n * compactly — `K. T.` and `T.J` both reach `K.T.` and `T.J.`, which is what\n * makes one dancer's several prints converge instead of fragmenting.\n *\n * A MULTI-LETTER ABBREVIATION IS NOT AN INITIAL, which is the whole boundary:\n * `St. John`, `St.Furaimue` and `SARAH C.NUTTINGDALE` all fail the single-letter unit\n * and take `strip-period` like any other cell.\n *\n * AN APOSTROPHE ENDS THE RUN, and leaving it out is a live defect this caught:\n * `Patrick J. O'Hare` read `J. O` as a two-initial run, since `O` is followed by\n * `'` rather than by a letter, and the seat rendered `Patrick J.O.'Hare`. An\n * apostrophe-join particle is the head of the surname it governs, never an\n * initial.\n */\nconst INITIALS_RUN =\n\t/(?<![\\p{L}\\p{N}.])(?:\\p{L}\\.\\s*){2,}(?![\\p{L}\\p{N}'\\u2019\\u0060])|(?<![\\p{L}\\p{N}.])\\p{L}\\.\\s*\\p{L}(?![\\p{L}\\p{N}'\\u2019\\u0060])/gu;\n\n/** `K. T.` → `K.T.`; `T.J` → `T.J.`. Each letter keeps exactly one period. */\nfunction joinInitials(run: string): string {\n\treturn (run.match(/\\p{L}/gu) ?? []).map((c) => `${c}.`).join(\"\");\n}\n\n/** U+E000 — a private-use marker, so a protected initials token cannot collide. */\nconst HOLD = \"\";\n\n/**\n * Strip one balanced-delimiter aside, or refuse the cell where the\n * `ParentheticalHandler` says the aside makes it no person's name.\n *\n * Shared by `strip-parens` and `strip-quotes` because the two are the same\n * shape — quotes behave as parens — while staying two rules: the caller\n * supplies its own pattern and its own rule name, so each has its own\n * population, its own tests and its own place in the order.\n */\nfunction stripAlias(\n\ts: string,\n\tpattern: RegExp,\n\trule: ScrubRule,\n\trules: ScrubRule[],\n\thandler: ParentheticalHandler,\n\tprint: string,\n): string | null {\n\tconst delimiter = rule === \"strip-quotes\" ? '\"\"' : \"()\";\n\tlet out = s;\n\tlet fired = false;\n\tfor (;;) {\n\t\tconst m = pattern.exec(out);\n\t\tpattern.lastIndex = 0;\n\t\tif (m === null) break;\n\t\tconst inner = (m[1] ?? \"\").trim();\n\t\tif (inner !== \"\") {\n\t\t\tconst verdict = handler(inner, { print, delimiter });\n\t\t\tif (verdict !== \"strip\") {\n\t\t\t\trules.push(verdict === \"refuse\" ? \"refuse-parenthetical\" : verdict.refuse);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\tout = `${out.slice(0, m.index)} ${out.slice(m.index + m[0].length)}`;\n\t\tfired = true;\n\t}\n\tif (fired) rules.push(rule);\n\treturn out;\n}\n\n/**\n * Scrub one printed person-name cell. Total: it returns a value for every input,\n * and that value is `NAME_REFUSED` exactly where the cell names no person.\n *\n * An empty print is returned empty and unrefused — \"no name was printed\" is a\n * different fact from \"this is not a name\", and a caller should flag each\n * separately.\n */\nexport function scrubNameDetail(printed: string, options: ScrubOptions = {}): ScrubResult {\n\tconst handler = options.parenthetical ?? stripEveryAside;\n\tconst rules: ScrubRule[] = [];\n\tlet s = tidy(printed);\n\tif (s === \"\") return { value: \"\", refused: false, rules };\n\n\t// ── PHASE 1 — repair, toward what the page meant ─────────────────────────\n\n\t// `0` READ BACK AS `O`, AND IT RUNS FIRST so the four zero-for-O prints never\n\t// reach the digit refusal. It fires only where the `0` LEADS a token and a\n\t// letter or an apostrophe follows, which is the shape of an Irish `O'`\n\t// surname and of nothing else in the corpus: the `0` inside `BN2018` is\n\t// preceded by a digit and the `2017` of a bare-year qualifier does not start\n\t// with one. `../particles/particle-vocabulary.ts` already keys `\"0\"` as an O particle\n\t// with an apostrophe join, so the splitter agrees with this reading.\n\t{\n\t\tconst next = s.replace(/(?<=^|\\s)0(?=['’`]\\p{L}|\\s\\p{L}|\\p{L})/gu, \"O\");\n\t\tif (next !== s) rules.push(\"ocr-zero-for-o\");\n\t\ts = next;\n\t}\n\n\t// `;` READ BACK AS `i`, between letters only: *\"Bad OCR for KESTRIA (lower\n\t// case I)\"*. The replacement takes the case of the letter before it,\n\t// so an all-caps print stays all-caps and the casing rule downstream still\n\t// sees one consistent run.\n\t{\n\t\tconst next = s.replace(/(?<=\\p{L});(?=\\p{L})/gu, (_m, ...a) => {\n\t\t\tconst at = a[a.length - 2] as number;\n\t\t\tconst prev = s[at - 1] as string;\n\t\t\treturn prev === prev.toLocaleUpperCase() && prev !== prev.toLocaleLowerCase() ? \"I\" : \"i\";\n\t\t});\n\t\tif (next !== s) rules.push(\"ocr-semicolon-for-i\");\n\t\ts = next;\n\t}\n\n\t// A STANDALONE U+00B4 IS NOT A LETTER AND NOT AN APOSTROPHE. It is a spacing\n\t// acute the renderer emitted where the page carried an accent, and it is\n\t// dropped rather than re-combined: `Fa´inne` → `Fainne`. Combining it would\n\t// guess which letter it belonged to, which is a question for the page.\n\tif (s.includes(\"´\")) {\n\t\ts = tidy(s.replace(/´/gu, \"\"));\n\t\trules.push(\"ocr-stray-acute\");\n\t}\n\n\t// ── PHASE 2 — strip the junk, keep the name ──────────────────────────────\n\n\t// PARENS FIRST, THEN QUOTES, THEN WHATEVER IS LEFT OVER. The order is the\n\t// rule: the pairs are fixed, and only then is a surviving single delimiter replaced.\n\t{\n\t\tconst next = stripAlias(s, /\\(([^()]*)\\)/u, \"strip-parens\", rules, handler, printed);\n\t\tif (next === null) return { value: NAME_REFUSED, refused: true, rules };\n\t\ts = tidy(next);\n\t}\n\t{\n\t\tconst next = stripAlias(s, /\"([^\"]*)\"/u, \"strip-quotes\", rules, handler, printed);\n\t\tif (next === null) return { value: NAME_REFUSED, refused: true, rules };\n\t\ts = tidy(next);\n\t}\n\tif (/[()\"]/u.test(s)) {\n\t\ts = tidy(s.replace(/[()\"]/gu, \" \"));\n\t\trules.push(\"strip-dangling\");\n\t}\n\n\t// A CREDENTIAL COMES OFF BEFORE ANYTHING READS THE COMMA. The comma of\n\t// `Claire Maxted, ADCRG` is a credential delimiter, not the `Last, First`\n\t// order separator, and handing it to the splitter unguarded parses the\n\t// surname as `Claire Maxted` and the given name as `ADCRG`.\n\t{\n\t\tconst next = stripTrailingCredentials(s);\n\t\tif (next !== s) rules.push(\"strip-credential\");\n\t\ts = tidy(next);\n\t}\n\n\t// AN INITIALS RUN IS HELD OUT OF `strip-period`, then spelled back compactly.\n\tconst held: string[] = [];\n\t{\n\t\tconst next = s.replace(INITIALS_RUN, (run) => {\n\t\t\theld.push(joinInitials(run));\n\t\t\treturn `${HOLD}${held.length - 1}${HOLD}`;\n\t\t});\n\t\tif (held.length > 0) rules.push(\"join-initials\");\n\t\ts = next;\n\t}\n\tif (s.includes(\".\")) {\n\t\ts = s.replace(/\\./gu, \" \");\n\t\trules.push(\"strip-period\");\n\t}\n\t// A LITERAL `\\'` IS AN ESCAPED APOSTROPHE, AND IT RUNS BEFORE `strip-slash`,\n\t// or `O\\'Brien` becomes `O ' Brien` and the surname breaks in two. The earlier\n\t// Java implementation unescaped it; `../lexicon/irish.ts` folds glyph SHAPE\n\t// only, so without this rule the backslash would survive. Zero cells carry\n\t// the shape in the measured corpus — its one backslash is\n\t// `MAKAYLA\\ FONNAILLOW`, a slash before a space — and the rule is still owed,\n\t// because the escape is a property of the producing tool and the next source\n\t// may print it.\n\tif (s.includes(\"\\\\'\")) {\n\t\ts = s.replace(/\\\\'/gu, \"'\");\n\t\trules.push(\"unescape-apostrophe\");\n\t}\n\tif (/[/\\\\]/u.test(s)) {\n\t\ts = s.replace(/[/\\\\]/gu, \" \");\n\t\trules.push(\"strip-slash\");\n\t}\n\ts = tidy(s);\n\n\t// A HYPHEN WITH WHITESPACE BESIDE IT CLOSES UP. `GRACE- OSYRNIA JERLEY` and\n\t// `Maistow - Marie Gallowmere` print one double-barrelled name each, and the space is\n\t// the sheet's, not the name's.\n\t//\n\t// A STATUS QUALIFIER IS HELD ASIDE FIRST, or this rule welds `ELLA McVeanaivard\n\t// - WMH` into the surname `McVeanaivard-WMH`. It is put back untouched: the\n\t// marker carries the world-qualifier fact and that is the caller's to read.\n\t{\n\t\tconst q = /\\s+-\\s*([\\p{Lu}]+)$/u.exec(s);\n\t\tconst trailer = q !== null && STATUS_QUALIFIERS.has(q[1] as string) ? q[0] : \"\";\n\t\tconst head = trailer === \"\" ? s : s.slice(0, s.length - trailer.length);\n\t\tconst closed = head.replace(/\\s+-\\s*|\\s*-\\s+/gu, \"-\");\n\t\tif (closed !== head) rules.push(\"close-spaced-hyphen\");\n\t\ts = closed + trailer;\n\t}\n\n\t// TRAILING NON-LETTERS COME OFF, as the earlier Java implementation's\n\t// `removeTrailingPunct` did. Unicode-aware, unlike a plain `[A-Za-z]` test,\n\t// which would eat the `é` off a name that ends in one. A held initials token\n\t// is restored afterwards, so a name ending in `T.J.` keeps its period.\n\t{\n\t\tconst next = s.replace(/[^\\p{L}\\p{N}]+$/u, \"\");\n\t\tif (next !== s) rules.push(\"strip-trailing-punct\");\n\t\ts = next;\n\t}\n\n\ts = tidy(\n\t\ts.replace(new RegExp(`${HOLD}(\\\\d+)${HOLD}`, \"gu\"), (_m, i) => held[Number(i)] as string),\n\t);\n\n\t// ── PHASE 3 — refuse ─────────────────────────────────────────────────────\n\n\t// A DIGIT, AFTER THE ZERO-FOR-O REPAIR. Nobody's name carries one, and the\n\t// corpus population is a registration or qualification code fused into the\n\t// cell — `- BN2018`, `- AI2015`, `- AS2015`, `- BN24`, the bare year `- 2017`.\n\tif (/\\p{Nd}/u.test(s)) {\n\t\trules.push(\"refuse-digit\");\n\t\treturn { value: NAME_REFUSED, refused: true, rules };\n\t}\n\n\t// A LOCATION TRAILER: *\"need location trailer detection to trigger\n\t// !!!INVALID\"*. The `:` is the signal and it is the only one: the cells are\n\t// a name, a school and a region fused into one field, and there is\n\t// no name in there to recover without deciding where the school begins.\n\t//\n\t// A TRAILING `, <place>` IS NOT THIS RULE AND MUST NOT BE. `Jovindane,\n\t// Katarina Victoria` is a surname-first print whose given name happens to be\n\t// a place name — which is why asides are judged only inside a paired\n\t// delimiter, by the `ParentheticalHandler`.\n\tif (s.includes(\":\")) {\n\t\trules.push(\"refuse-location-trailer\");\n\t\treturn { value: NAME_REFUSED, refused: true, rules };\n\t}\n\n\t// A TEAM DESIGNATION IS NOT A PERSON AND IS NOT A DEFECT. The designation\n\t// has one canonical spelling, `Team`, adorned with at most one upper-case\n\t// letter. The bare form is one whitespace token, so without this exemption\n\t// `refuse-single-token` below would refuse it and a legitimate team cell\n\t// with no letter would be reported as an invalid name.\n\t//\n\t// IT SITS BELOW `refuse-digit` DELIBERATELY. A digit is not a legal\n\t// designator, so `Team 1` must keep refusing and this\n\t// exemption must not be able to reach it. Ordering is the whole guarantee:\n\t// the rule above has already returned by the time this is asked.\n\t//\n\t// THE VALUE IS NOT CANONICALIZED HERE. Casing is `./name-case.ts`'s and runs\n\t// after this file (§ *What is NOT here*), so `TEAM A` leaves this function\n\t// spelled as the sheet spelled it and reaches the canonical `Team A` at the\n\t// renderer, exactly as it did before.\n\tif (canonicalTeamName(s) !== null) {\n\t\trules.push(\"accept-team\");\n\t\treturn { value: s, refused: false, rules };\n\t}\n\n\t// ONE TOKEN CANNOT BE BOTH A SURNAME AND A GIVEN NAME. The earlier Java\n\t// implementation refused it outright, and here the same print scrubs to\n\t// `!!!INVALID` — `KESTRELDUNMERE`, `CHLOE`, `Saunders`, `???`. The bare `???`\n\t// names nobody and lands here too, having no letters at all. A bare `Team`\n\t// would too, but the team exemption above has already accepted it.\n\tif (s.split(\" \").filter((t) => t !== \"\").length < 2) {\n\t\trules.push(\"refuse-single-token\");\n\t\treturn { value: NAME_REFUSED, refused: true, rules };\n\t}\n\n\treturn { value: s, refused: false, rules };\n}\n\n/** `scrubNameDetail`'s value alone, for the callers that do not count rules. */\nexport function scrubName(printed: string): string {\n\treturn scrubNameDetail(printed).value;\n}\n",
5
+ "/**\n * name-scrub.ts — the three-phase treatment a printed person-name cell gets\n * before anything splits it.\n *\n * The rules, in the words that set them —\n *\n * > if there are dangling pairs (a single `\"` or `)` or `(` ) then those get\n * > replaced after the pairs are fixed\n *\n * > the credentials should probably be stripped. fix the initials (two periods\n * > are different than one). it must run on adjudicators. They are people.\n *\n * ## THE PHASE ORDER IS PART OF THE RULE\n *\n * REPAIR, then STRIP, then REFUSE. The reason is mechanical: `Samantha 0 Connor`\n * carries a digit, so a refusal that ran first would throw away a print the\n * repair can fix. Every rule below names its phase and the phases run in that\n * order, once, top to bottom.\n *\n * ## It moves AWAY from the print\n *\n * Everything here is a reading applied on the way into a derived store; it never\n * rewrites the transcription. The transcription keeps what the page printed, and\n * a consumer should keep the printed value beside the scrubbed one. Nothing here\n * is an erratum: an erratum repairs a transcription toward the page, and the\n * phase-1 repairs below are downstream readings of a print that is not being\n * re-rendered.\n *\n * ## The refusal is a value, not an exception\n *\n * A cell that cannot be a person's name scrubs to `NAME_REFUSED`, spelled\n * `!!!INVALID`. It is deliberately not a name-shaped string: it can never be\n * mistaken for a rendered `Last<<First`, it sorts and greps out of the way, and\n * a consumer that forgets to check it produces visible nonsense rather than a\n * plausible dancer. A consumer should count it, so the population is reported\n * rather than silently absorbed.\n *\n * ## What is NOT here\n *\n * - **Casing, ASCII folding, splitting.** `./name-case.ts`,\n * `../lexicon/ascii-approx.ts` and `./name-split.ts` own those and run after\n * this.\n * - **The comma.** It is the `Last, First` order separator and is read against\n * the producing document's `meta.nameFormat` by `./name-split.ts`. The one\n * comma this file touches is the credential delimiter of `Maxwell, ADCRG`,\n * which is not an order separator and would otherwise make `ADCRG` a given\n * name.\n * - **A printed status qualifier fused into the cell** (`- WMH`) — a separate\n * fact for the caller, held aside here only so the spaced-hyphen rule does\n * not close it up into a surname.\n * - **A lost byte printing as `?`** (`Jystarvard, M?jaillell`) — an erratum toward the\n * page, corrected in the transcription rather than guessed at here. The bare\n * `???` names nobody and is refused here.\n * - **A trailing `Á'` that is really in the source bytes.** Where the source file\n * itself carries `0xC1 0x27` and it is decoded faithfully, with no OCR in the\n * path, the question is whether the source is accurate, not a mis-decode this\n * layer may read through.\n */\n\nimport { canonicalTeamName } from \"./team-name.ts\";\n\n/**\n * The refusal value: a cell that cannot be a person's name.\n *\n * ONE SPELLING, EVERYWHERE. Phase 3 says the cell \"is `!!!INVALID`\", and no\n * other spelling of the refusal exists anywhere in the tree.\n */\nexport const NAME_REFUSED = \"!!!INVALID\";\n\n/** Which rule fired. Stable strings — a census and a report quote them. */\nexport type ScrubRule =\n\t// ── phase 1, repair ──────────────────────────────────────────────────────\n\t/** `0` leading a name token read back as `O`: `JESSICA 0'SULLIVAN`. */\n\t| \"ocr-zero-for-o\"\n\t/** `;` between letters read back as `i`: `KESTR;A-ROSE` → `KESTRIA-ROSE`. */\n\t| \"ocr-semicolon-for-i\"\n\t/** A standalone U+00B4 ACUTE dropped: `Fa´inne` → `Fainne`. */\n\t| \"ocr-stray-acute\"\n\t// ── phase 2, strip ───────────────────────────────────────────────────────\n\t/** A parenthesised alias removed: `Lena (Xiaoyu) Zumock` → `Lena Zumock`. */\n\t| \"strip-parens\"\n\t/** A quoted nickname removed: `Pundeallina \"Katie\" Foxe` → `Pundeallina Foxe`. */\n\t| \"strip-quotes\"\n\t/** A `(`, `)` or `\"` left over once the pairs are gone, replaced by a space. */\n\t| \"strip-dangling\"\n\t/** A trailing teaching credential removed: `Maxwell, ADCRG` → `Maxwell`. */\n\t| \"strip-credential\"\n\t/** A `.` that is not part of an initials token, replaced by a space. */\n\t| \"strip-period\"\n\t/** An initials token held together and spelled compactly: `K. T.` → `K.T.`. */\n\t| \"join-initials\"\n\t/** A literal `\\'` read back as the apostrophe it escapes: `O\\'Brien` → `O'Brien`. */\n\t| \"unescape-apostrophe\"\n\t/** `/` or `\\` replaced by a space: `MAKAYLA\\ FONNAILLOW`. */\n\t| \"strip-slash\"\n\t/** A hyphen with whitespace beside it closed up: `GRACE- OSYRNIA` → `GRACE-OSYRNIA`. */\n\t| \"close-spaced-hyphen\"\n\t/** Trailing non-letters removed: `Annika Walter,` → `Annika Walter`. */\n\t| \"strip-trailing-punct\"\n\t// ── phase 3, refuse ──────────────────────────────────────────────────────\n\t/** A digit survived phase 1: `KELSEY PEARRAILLINA - BN2018`. */\n\t| \"refuse-digit\"\n\t/** A location trailer: `London Hryniuk Lyrunnett : Western Region, Canada`. */\n\t| \"refuse-location-trailer\"\n\t/**\n\t * A parenthesised or quoted aside the `ParentheticalHandler` refused. A handler\n\t * may name its own `refuse-…` rule instead (e.g. `refuse-location-alias`).\n\t */\n\t| \"refuse-parenthetical\"\n\t| `refuse-${string}`\n\t/** One token cannot be both a surname and a given name: `Saunders`, `???`. */\n\t| \"refuse-single-token\"\n\t/**\n\t * A team designation in its canonical format, exempted from the refusals\n\t * below it: `Team`, `Team A`. The EIGHTEENTH rule, added after the others: a\n\t * team designation has a canonical format (`./team-name.ts`), which takes\n\t * `Team` out of `refuse-single-token`'s population. It repairs nothing and\n\t * strips nothing; it is recorded so the census can count the exemption rather\n\t * than report a silent gap in the refusals.\n\t */\n\t| \"accept-team\";\n\n/**\n * What an aside set apart by `( … )` or `\" … \"` in a name cell means.\n *\n * Asked once per pair, inside-out, with the trimmed text between the delimiters.\n * `\"strip\"` removes the pair (the aside is a nickname or alias:\n * `Lena (Xiaoyu) Zumock` → `Lena Zumock`). `\"refuse\"` refuses the whole cell as no\n * person's name, under `refuse-parenthetical`; `{ refuse: \"refuse-<rule>\" }`\n * refuses it under a rule the caller names.\n *\n * ASKED ONLY INSIDE THE DELIMITERS, never of a bare token: `Victoria` and\n * `London` are good given names in the open.\n */\nexport type ParentheticalHandler = (\n\taside: string,\n\tcontext: { readonly print: string; readonly delimiter: \"()\" | '\"\"' },\n) => \"strip\" | \"refuse\" | { readonly refuse: `refuse-${string}` };\n\n/** The default: every aside is an alias, and is stripped. */\nexport const stripEveryAside: ParentheticalHandler = () => \"strip\";\n\n/** Options for `scrubNameDetail`. */\nexport interface ScrubOptions {\n\t/** default: `stripEveryAside` */\n\treadonly parenthetical?: ParentheticalHandler;\n}\n\nexport interface ScrubResult {\n\t/** The scrubbed print, or `NAME_REFUSED`. */\n\tvalue: string;\n\t/** True when `value` is `NAME_REFUSED`. */\n\trefused: boolean;\n\t/** Every rule that fired, in the order the phases ran them. */\n\trules: ScrubRule[];\n}\n\n/**\n * Teaching credentials, stripped; generational suffixes, kept.\n *\n * The split is that of an earlier Java implementation, which ran over this corpus\n * for years: it lists `TCRG`, `ADCRG`, `BG`, `PHD` beside `Jr`, `II`, `III`,\n * `IV`, and only the first group is stripped (\"the credentials should probably\n * be stripped\"). `SDCRG` is added because the corpus prints it (17 panel seats)\n * and\n * it is the same kind of thing — a CLRG teaching qualification, not part of\n * anybody's name. A generational suffix IS part of the name and stays, which is\n * why `./name-split.ts`'s `NAME_SUFFIXES` still carries both groups: it has to\n * recognize what it must not make a surname.\n */\nconst CREDENTIALS: ReadonlySet<string> = new Set([\"tcrg\", \"adcrg\", \"sdcrg\", \"bg\", \"phd\"]);\n\n/**\n * The `strip-credential` rule, on its own, so the one implementation serves\n * every caller.\n *\n * TRAILING POSITION ONLY. The regex is end-anchored, which is the whole\n * content of the rule: `Bg` *inside* a name is untouched, and a bare `ADCRG`\n * with nothing before it is not a credential to strip — it is all there is.\n * The separator may be a comma or a space, because a source prints both\n * (`Claire Maxted, ADCRG` and `Alice Gellane-O'Luthindby ADCRG`), and an optional\n * full stop is allowed after the token. It loops, so `Dr. Irene Brustirley, PhD,\n * ADCRG` loses both.\n *\n * IT TAKES A PRINTED NAME *OR* A FOLDED KEY. Both are handled by the same\n * anchor: a fold key is lower-case with single spaces, so `carol quarnell\n * adcrg` matches on the space exactly as the printed form matches on the\n * comma. An adjudicator fold is the typical second caller, and a second copy of\n * these five lines is precisely what lets the two drift — a positionless\n * `split(\" \").filter(...)` copy once lost `phd` from its vocabulary, and its\n * positionlessness was then cited as the reason the fold could not use it.\n *\n * Not exported through the phase pipeline's `ScrubRule` accounting: a caller\n * that wants the rule NAMED as it fires calls `scrubNameDetail`.\n */\nexport function stripTrailingCredentials(s: string): string {\n\tlet next = s;\n\tfor (;;) {\n\t\tconst m = /[,\\s]+([\\p{L}]+)\\.?$/u.exec(next);\n\t\tif (m === null || !CREDENTIALS.has((m[1] as string).toLocaleLowerCase())) break;\n\t\tnext = next.slice(0, m.index);\n\t}\n\treturn next;\n}\n\n/**\n * A trailing token that is a printed STATUS QUALIFIER rather than half of a\n * double-barrelled name.\n *\n * IT IS HELD ASIDE, NOT STRIPPED. The marker carries the world-qualifier fact,\n * which is the caller's to read; all this set does is stop `close-spaced-hyphen`\n * from welding `ELLA McVeanaivard - WMH` into the surname `McVeanaivard-WMH`. The codes\n * are the printed status-qualifier vocabulary, listed here because this package\n * is a leaf with no dependencies.\n *\n * The qualification-CODE shape (`BN2018`, `AI2015`, `AS2015`, `BN24`, `2017`)\n * needs no list: it carries a digit, so phase 3 refuses the cell anyway.\n */\nconst STATUS_QUALIFIERS: ReadonlySet<string> = new Set([\n\t\"WQ\",\n\t\"WMH\",\n\t\"NQ\",\n\t\"REC\",\n\t\"OS\",\n\t\"R\",\n\t\"FTC\",\n\t\"HM\",\n]);\n\n/** Collapse runs of whitespace and trim. Every rule leaves its own spaces behind. */\nfunction tidy(s: string): string {\n\treturn s.replace(/\\s+/gu, \" \").trim();\n}\n\n/**\n * An INITIALS token: two or more single letters, each a separate initial, at\n * least one of them carrying a period.\n *\n * THE RULE IS THAT TWO PERIODS ARE DIFFERENT FROM ONE. `T.J. Quellane`\n * prints one given name that is spelled with two initials; `Kathryn C.\n * Komythith` prints a given name and a separate middle initial. Splitting the\n * first on its periods invents a second given name that nobody has, so the run\n * is held together as one token while `strip-period` runs, then spelled back\n * compactly — `K. T.` and `T.J` both reach `K.T.` and `T.J.`, which is what\n * makes one dancer's several prints converge instead of fragmenting.\n *\n * A MULTI-LETTER ABBREVIATION IS NOT AN INITIAL, which is the whole boundary:\n * `St. John`, `St.Furaimue` and `SARAH C.NUTTINGDALE` all fail the single-letter unit\n * and take `strip-period` like any other cell.\n *\n * AN APOSTROPHE ENDS THE RUN, and leaving it out is a live defect this caught:\n * `Patrick J. O'Hare` read `J. O` as a two-initial run, since `O` is followed by\n * `'` rather than by a letter, and the seat rendered `Patrick J.O.'Hare`. An\n * apostrophe-join particle is the head of the surname it governs, never an\n * initial.\n */\nconst INITIALS_RUN =\n\t/(?<![\\p{L}\\p{N}.])(?:\\p{L}\\.\\s*){2,}(?![\\p{L}\\p{N}'\\u2019\\u0060])|(?<![\\p{L}\\p{N}.])\\p{L}\\.\\s*\\p{L}(?![\\p{L}\\p{N}'\\u2019\\u0060])/gu;\n\n/** `K. T.` → `K.T.`; `T.J` → `T.J.`. Each letter keeps exactly one period. */\nfunction joinInitials(run: string): string {\n\treturn (run.match(/\\p{L}/gu) ?? []).map((c) => `${c}.`).join(\"\");\n}\n\n/** U+E000 — a private-use marker, so a protected initials token cannot collide. */\nconst HOLD = \"\";\n\n/**\n * Strip one balanced-delimiter aside, or refuse the cell where the\n * `ParentheticalHandler` says the aside makes it no person's name.\n *\n * Shared by `strip-parens` and `strip-quotes` because the two are the same\n * shape — quotes behave as parens — while staying two rules: the caller\n * supplies its own pattern and its own rule name, so each has its own\n * population, its own tests and its own place in the order.\n */\nfunction stripAlias(\n\ts: string,\n\tpattern: RegExp,\n\trule: ScrubRule,\n\trules: ScrubRule[],\n\thandler: ParentheticalHandler,\n\tprint: string,\n): string | null {\n\tconst delimiter = rule === \"strip-quotes\" ? '\"\"' : \"()\";\n\tlet out = s;\n\tlet fired = false;\n\tfor (;;) {\n\t\tconst m = pattern.exec(out);\n\t\tpattern.lastIndex = 0;\n\t\tif (m === null) break;\n\t\tconst inner = (m[1] ?? \"\").trim();\n\t\tif (inner !== \"\") {\n\t\t\tconst verdict = handler(inner, { print, delimiter });\n\t\t\tif (verdict !== \"strip\") {\n\t\t\t\trules.push(verdict === \"refuse\" ? \"refuse-parenthetical\" : verdict.refuse);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\tout = `${out.slice(0, m.index)} ${out.slice(m.index + m[0].length)}`;\n\t\tfired = true;\n\t}\n\tif (fired) rules.push(rule);\n\treturn out;\n}\n\n/**\n * Scrub one printed person-name cell. Total: it returns a value for every input,\n * and that value is `NAME_REFUSED` exactly where the cell names no person.\n *\n * An empty print is returned empty and unrefused — \"no name was printed\" is a\n * different fact from \"this is not a name\", and a caller should flag each\n * separately.\n */\nexport function scrubNameDetail(printed: string, options: ScrubOptions = {}): ScrubResult {\n\tconst handler = options.parenthetical ?? stripEveryAside;\n\tconst rules: ScrubRule[] = [];\n\tlet s = tidy(printed);\n\tif (s === \"\") return { value: \"\", refused: false, rules };\n\n\t// ── PHASE 1 — repair, toward what the page meant ─────────────────────────\n\n\t// `0` READ BACK AS `O`, AND IT RUNS FIRST so the four zero-for-O prints never\n\t// reach the digit refusal. It fires only where the `0` LEADS a token and a\n\t// letter or an apostrophe follows, which is the shape of an Irish `O'`\n\t// surname and of nothing else in the corpus: the `0` inside `BN2018` is\n\t// preceded by a digit and the `2017` of a bare-year qualifier does not start\n\t// with one. `../particles/particle-vocabulary.ts` already keys `\"0\"` as an O particle\n\t// with an apostrophe join, so the splitter agrees with this reading.\n\t{\n\t\tconst next = s.replace(/(?<=^|\\s)0(?=['’`]\\p{L}|\\s\\p{L}|\\p{L})/gu, \"O\");\n\t\tif (next !== s) rules.push(\"ocr-zero-for-o\");\n\t\ts = next;\n\t}\n\n\t// `;` READ BACK AS `i`, between letters only: *\"Bad OCR for KESTRIA (lower\n\t// case I)\"*. The replacement takes the case of the letter before it,\n\t// so an all-caps print stays all-caps and the casing rule downstream still\n\t// sees one consistent run.\n\t{\n\t\tconst next = s.replace(/(?<=\\p{L});(?=\\p{L})/gu, (_m, ...a) => {\n\t\t\tconst at = a[a.length - 2] as number;\n\t\t\tconst prev = s[at - 1] as string;\n\t\t\treturn prev === prev.toLocaleUpperCase() && prev !== prev.toLocaleLowerCase() ? \"I\" : \"i\";\n\t\t});\n\t\tif (next !== s) rules.push(\"ocr-semicolon-for-i\");\n\t\ts = next;\n\t}\n\n\t// A STANDALONE U+00B4 IS NOT A LETTER AND NOT AN APOSTROPHE. It is a spacing\n\t// acute the renderer emitted where the page carried an accent, and it is\n\t// dropped rather than re-combined: `Fa´inne` → `Fainne`. Combining it would\n\t// guess which letter it belonged to, which is a question for the page.\n\tif (s.includes(\"´\")) {\n\t\ts = tidy(s.replace(/´/gu, \"\"));\n\t\trules.push(\"ocr-stray-acute\");\n\t}\n\n\t// ── PHASE 2 — strip the junk, keep the name ──────────────────────────────\n\n\t// PARENS FIRST, THEN QUOTES, THEN WHATEVER IS LEFT OVER. The order is the\n\t// rule: the pairs are fixed, and only then is a surviving single delimiter replaced.\n\t{\n\t\tconst next = stripAlias(s, /\\(([^()]*)\\)/u, \"strip-parens\", rules, handler, printed);\n\t\tif (next === null) return { value: NAME_REFUSED, refused: true, rules };\n\t\ts = tidy(next);\n\t}\n\t{\n\t\tconst next = stripAlias(s, /\"([^\"]*)\"/u, \"strip-quotes\", rules, handler, printed);\n\t\tif (next === null) return { value: NAME_REFUSED, refused: true, rules };\n\t\ts = tidy(next);\n\t}\n\tif (/[()\"]/u.test(s)) {\n\t\ts = tidy(s.replace(/[()\"]/gu, \" \"));\n\t\trules.push(\"strip-dangling\");\n\t}\n\n\t// A CREDENTIAL COMES OFF BEFORE ANYTHING READS THE COMMA. The comma of\n\t// `Claire Maxted, ADCRG` is a credential delimiter, not the `Last, First`\n\t// order separator, and handing it to the splitter unguarded parses the\n\t// surname as `Claire Maxted` and the given name as `ADCRG`.\n\t{\n\t\tconst next = stripTrailingCredentials(s);\n\t\tif (next !== s) rules.push(\"strip-credential\");\n\t\ts = tidy(next);\n\t}\n\n\t// AN INITIALS RUN IS HELD OUT OF `strip-period`, then spelled back compactly.\n\tconst held: string[] = [];\n\t{\n\t\tconst next = s.replace(INITIALS_RUN, (run) => {\n\t\t\theld.push(joinInitials(run));\n\t\t\treturn `${HOLD}${held.length - 1}${HOLD}`;\n\t\t});\n\t\tif (held.length > 0) rules.push(\"join-initials\");\n\t\ts = next;\n\t}\n\tif (s.includes(\".\")) {\n\t\ts = s.replace(/\\./gu, \" \");\n\t\trules.push(\"strip-period\");\n\t}\n\t// A LITERAL `\\'` IS AN ESCAPED APOSTROPHE, AND IT RUNS BEFORE `strip-slash`,\n\t// or `O\\'Brien` becomes `O ' Brien` and the surname breaks in two. The earlier\n\t// Java implementation unescaped it; `../lexicon/irish.ts` folds glyph SHAPE\n\t// only, so without this rule the backslash would survive. Zero cells carry\n\t// the shape in the measured corpus — its one backslash is\n\t// `MAKAYLA\\ FONNAILLOW`, a slash before a space — and the rule is still owed,\n\t// because the escape is a property of the producing tool and the next source\n\t// may print it.\n\tif (s.includes(\"\\\\'\")) {\n\t\ts = s.replace(/\\\\'/gu, \"'\");\n\t\trules.push(\"unescape-apostrophe\");\n\t}\n\tif (/[/\\\\]/u.test(s)) {\n\t\ts = s.replace(/[/\\\\]/gu, \" \");\n\t\trules.push(\"strip-slash\");\n\t}\n\ts = tidy(s);\n\n\t// A HYPHEN WITH WHITESPACE BESIDE IT CLOSES UP. `GRACE- OSYRNIA JERLEY` and\n\t// `Maistow - Marie Gallowmere` print one double-barrelled name each, and the space is\n\t// the sheet's, not the name's.\n\t//\n\t// A STATUS QUALIFIER IS HELD ASIDE FIRST, or this rule welds `ELLA McVeanaivard\n\t// - WMH` into the surname `McVeanaivard-WMH`. It is put back untouched: the\n\t// marker carries the world-qualifier fact and that is the caller's to read.\n\t{\n\t\tconst q = /\\s+-\\s*([\\p{Lu}]+)$/u.exec(s);\n\t\tconst trailer = q !== null && STATUS_QUALIFIERS.has(q[1] as string) ? q[0] : \"\";\n\t\tconst head = trailer === \"\" ? s : s.slice(0, s.length - trailer.length);\n\t\tconst closed = head.replace(/\\s+-\\s*|\\s*-\\s+/gu, \"-\");\n\t\tif (closed !== head) rules.push(\"close-spaced-hyphen\");\n\t\ts = closed + trailer;\n\t}\n\n\t// TRAILING NON-LETTERS COME OFF, as the earlier Java implementation's\n\t// `removeTrailingPunct` did. Unicode-aware, unlike a plain `[A-Za-z]` test,\n\t// which would eat the `é` off a name that ends in one. A held initials token\n\t// is restored afterwards, so a name ending in `T.J.` keeps its period.\n\t{\n\t\tconst next = s.replace(/[^\\p{L}\\p{N}]+$/u, \"\");\n\t\tif (next !== s) rules.push(\"strip-trailing-punct\");\n\t\ts = next;\n\t}\n\n\ts = tidy(\n\t\ts.replace(new RegExp(`${HOLD}(\\\\d+)${HOLD}`, \"gu\"), (_m, i) => held[Number(i)] as string),\n\t);\n\n\t// ── PHASE 3 — refuse ─────────────────────────────────────────────────────\n\n\t// A DIGIT, AFTER THE ZERO-FOR-O REPAIR. Nobody's name carries one, and the\n\t// corpus population is a registration or qualification code fused into the\n\t// cell — `- BN2018`, `- AI2015`, `- AS2015`, `- BN24`, the bare year `- 2017`.\n\tif (/\\p{Nd}/u.test(s)) {\n\t\trules.push(\"refuse-digit\");\n\t\treturn { value: NAME_REFUSED, refused: true, rules };\n\t}\n\n\t// A LOCATION TRAILER: *\"need location trailer detection to trigger\n\t// !!!INVALID\"*. The `:` is the signal and it is the only one: the cells are\n\t// a name, a school and a region fused into one field, and there is\n\t// no name in there to recover without deciding where the school begins.\n\t//\n\t// A TRAILING `, <place>` IS NOT THIS RULE AND MUST NOT BE. `Jovindane,\n\t// Katarina Victoria` is a surname-first print whose given name happens to be\n\t// a place name — which is why asides are judged only inside a paired\n\t// delimiter, by the `ParentheticalHandler`.\n\tif (s.includes(\":\")) {\n\t\trules.push(\"refuse-location-trailer\");\n\t\treturn { value: NAME_REFUSED, refused: true, rules };\n\t}\n\n\t// A TEAM DESIGNATION IS NOT A PERSON AND IS NOT A DEFECT. The designation\n\t// has one canonical spelling, `Team`, adorned with at most one upper-case\n\t// letter. The bare form is one whitespace token, so without this exemption\n\t// `refuse-single-token` below would refuse it and a legitimate team cell\n\t// with no letter would be reported as an invalid name.\n\t//\n\t// IT SITS BELOW `refuse-digit` DELIBERATELY. A digit is not a legal\n\t// designator, so `Team 1` must keep refusing and this\n\t// exemption must not be able to reach it. Ordering is the whole guarantee:\n\t// the rule above has already returned by the time this is asked.\n\t//\n\t// THE VALUE IS NOT CANONICALIZED HERE. Casing is `./name-case.ts`'s and runs\n\t// after this file (§ *What is NOT here*), so `TEAM A` leaves this function\n\t// spelled as the sheet spelled it and reaches the canonical `Team A` at the\n\t// renderer, exactly as it did before.\n\tif (canonicalTeamName(s) !== null) {\n\t\trules.push(\"accept-team\");\n\t\treturn { value: s, refused: false, rules };\n\t}\n\n\t// ONE TOKEN CANNOT BE BOTH A SURNAME AND A GIVEN NAME. The earlier Java\n\t// implementation refused it outright, and here the same print scrubs to\n\t// `!!!INVALID` — `KESTRELDUNMERE`, `CHLOE`, `Saunders`, `???`. The bare `???`\n\t// names nobody and lands here too, having no letters at all. A bare `Team`\n\t// would too, but the team exemption above has already accepted it. A comma\n\t// separates tokens as a space does, so `Surname,Given` is two tokens, as\n\t// `Surname, Given` is.\n\tif (s.split(/[ ,]/).filter((t) => t !== \"\").length < 2) {\n\t\trules.push(\"refuse-single-token\");\n\t\treturn { value: NAME_REFUSED, refused: true, rules };\n\t}\n\n\treturn { value: s, refused: false, rules };\n}\n\n/** `scrubNameDetail`'s value alone, for the callers that do not count rules. */\nexport function scrubName(printed: string): string {\n\treturn scrubNameDetail(printed).value;\n}\n",
6
6
  "/**\n * `foldNameKey` — the blocking key over a PRINTED PERSONAL NAME.\n *\n * One implementation for two kinds of consumer, and that is the whole reason it\n * lives here rather than beside either of them:\n *\n * - a record linker folds every printed adjudicator and dancer string to\n * block candidate pairs;\n * - a panel check folds a printed PANEL SEAT to whole tokens, so a seat-state\n * word (\"withdrawn\", \"vacant\") is matched on a token and never on a\n * substring.\n *\n * The two must not be able to disagree. A seat the transcription-time check\n * calls a person and the linker calls a marker — or the reverse — is a silent\n * split between two layers over one printed string, so the fold lives in this\n * zero-dependency leaf rather than being copied: a second copy can silently\n * disagree with the first.\n *\n * IT IS A BLOCKING KEY, NEVER AN IDENTITY KEY — this package's standing rule.\n * Two prints folding alike are a candidate pair, nothing more.\n *\n * WHAT IT FOLDS, in order: NFD decomposition, combining marks dropped\n * (U+0300–U+036F), lowercase, every character outside `a-z` and space replaced\n * by a space, runs of whitespace collapsed, ends trimmed. So `\"Ní Jirkirkane\"` and\n * `\"Ni Jirkirkane\"` fold alike, `\"O'Hare\"` folds to `o hare`, and `\"N/A\"` folds to\n * the two tokens `n a`.\n */\nexport function foldNameKey(s: string): string {\n\treturn s\n\t\t.normalize(\"NFD\")\n\t\t.replace(/[̀-ͯ]/g, \"\")\n\t\t.toLowerCase()\n\t\t.replace(/[^a-z ]/g, \" \")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n}\n\n/**\n * `nameFold` — the COMPARISON fold over one name token or one joined run.\n *\n * Distinct from `foldNameKey` above and deliberately not merged with it: that\n * one is a blocking key over a whole printed name and KEEPS the whitespace that\n * separates its tokens, because a seat marker is matched on whole tokens. This\n * one exists to ask whether two spellings of the SAME span are the same span, so\n * it drops every separator there is.\n *\n * APPLIED TO A JOINED RUN RATHER THAN TOKEN BY TOKEN wherever a surname is\n * compared, because `name-split.ts`'s tokenizer glues `O Brien` into one token\n * while the printed cell holds two. Concatenating before folding makes the two\n * spellings equal without either side knowing about the glue.\n *\n * IT LIVES IN THIS LEAF BECAUSE THREE THINGS AT THREE LAYERS MUST AGREE on it:\n * the primed bar's anchor index (`./name-order-bar.ts`), the generated compound\n * surname table (`./compound-surnames.ts`) and the splitter that looks a span up\n * in that table (`./name-split.ts`). A second copy of these five lines is a\n * table whose keys silently stop matching the lookups.\n */\nexport function nameFold(s: string): string {\n\treturn s\n\t\t.normalize(\"NFD\")\n\t\t.replace(/\\p{M}+/gu, \"\")\n\t\t.replace(/[^\\p{L}\\p{N}]+/gu, \"\")\n\t\t.toLocaleLowerCase();\n}\n",
7
7
  "/**\n * name-placeholder.ts — THE ONE ANSWER to \"did the page print a name here at all\".\n *\n * A person cell prints NO NAME when it is one of three things, and this file is where all\n * three are decided:\n *\n * 1. it holds no letter at all: empty, whitespace, `???`, `0`, `, .`, `22 - ()`\n * (`^[^\\p{L}]*$`, any Unicode letter, so a name written in a non-Latin script is a\n * name);\n * 2. it is a platform sentinel a row's name cell and school cell share (`N/A`, `TBA`,\n * `Unknown`, `None`): `PLATFORM_PLACEHOLDERS`, asked through `isPlaceholderPrint`, ONE\n * list for both cells so they cannot drift apart;\n * 3. it is one of `NAME_PLACEHOLDERS`: the sentinels only a NAME cell prints, each with\n * where it was measured.\n *\n * `PersonName.printsNoName()` is the accessor a caller holding a parse asks; `isNoNamePrint`\n * is the same answer for a caller holding only the print, and it parses nothing.\n *\n * A TEST ENTRY IS NOT HERE. `Test Dancer` prints a name-shaped string; whether a platform's\n * test entries are rows at all is a different question from whether a name was printed, and it\n * is the consumer's.\n */\n\nimport { foldNameKey } from \"./name-fold.ts\";\n\n/** One sentinel a cell prints where no name was given, with its measurement. */\nexport interface NamePlaceholder {\n\t/** the print folded by `foldNameKey`: lower case, accents and punctuation gone, single spaces */\n\treadonly print: string;\n\t/** where it was seen, so a reviewer can audit the row */\n\treadonly authority: string;\n}\n\n/**\n * THE SHARED SENTINELS: what an entry platform writes where nothing was entered, in a name cell\n * or a school cell alike. A school reader asks `isPlaceholderPrint` of its cell, so `N/A` is\n * refused on both sides of a row by this one list. A sentinel worded about a school\n * (`No School`, `-- Choose One --`) is a school-cell fact and stays with the school reader.\n *\n * Measured 2026-10-01 over every stream of the results corpus (3,776,915 rows): rows per\n * cell, matched on the fold.\n */\nexport const PLATFORM_PLACEHOLDERS: readonly NamePlaceholder[] = [\n\t{\n\t\tprint: \"unknown\",\n\t\tauthority:\n\t\t\t\"4 name rows (`Unknown`, `unknown`); 237 school rows (`Unknown`, `unknown`, `*Unknown*`)\",\n\t},\n\t{ print: \"tba\", authority: \"4 name rows (`TBA`); 4 school rows\" },\n\t{\n\t\tprint: \"n a\",\n\t\tauthority:\n\t\t\t\"42 name rows (`#N/A`, a spreadsheet's missing-value mark; it parsed as the person `A<<N`); 43 school rows (`#N/A`, `N/A`)\",\n\t},\n\t{ print: \"none\", authority: \"0 name rows; 21 school rows (`None`, `none`)\" },\n\t{ print: \"not applicable\", authority: \"0 name rows; 1 school row (`Not applicable`)\" },\n];\n\n/**\n * THE NAME-ONLY SENTINELS: the placeholder-shaped prints that hold a letter, that only a name\n * cell prints, and that `PLATFORM_PLACEHOLDERS` does not already hold. Measured 2026-10-01 over\n * every stream of the results corpus (3,776,915 rows).\n */\nexport const NAME_PLACEHOLDERS: readonly NamePlaceholder[] = [\n\t{\n\t\tprint: \"name withheld\",\n\t\tauthority: \"`Name Withheld`, 136 rows: the platform printed that the name was withheld\",\n\t},\n\t{\n\t\tprint: \"none none\",\n\t\tauthority: \"`none none`, 5 rows: the sentinel `none` typed into both name fields\",\n\t},\n\t{\n\t\tprint: \"not known\",\n\t\tauthority: \"`Not known`, 2 rows. It parsed as the person `Known<<Not`\",\n\t},\n\t{\n\t\tprint: \"x\",\n\t\tauthority: \"`X`, 2 rows: a bare keyboard filler in the name field\",\n\t},\n];\n\nconst SHARED = new Set(PLATFORM_PLACEHOLDERS.map((p) => p.print));\nconst NAME_ONLY = new Set(NAME_PLACEHOLDERS.map((p) => p.print));\n\nconst HAS_LETTER = /\\p{L}/u;\n\n/**\n * Is this print one of the PLATFORM PLACEHOLDERS a name cell and a school cell share\n * (`N/A`, `TBA`, `Unknown`, `None`)? The question a school reader asks of its cell.\n */\nexport function isPlaceholderPrint(print: string): boolean {\n\treturn SHARED.has(foldNameKey(print));\n}\n\n/**\n * Did this person cell print NO NAME: no letter, a shared placeholder, or a name-only one?\n * Total over any string; the print is read, never rewritten, and nothing is parsed.\n */\nexport function isNoNamePrint(print: string): boolean {\n\tif (!HAS_LETTER.test(print)) return true;\n\tconst folded = foldNameKey(print);\n\treturn NAME_ONLY.has(folded) || SHARED.has(folded);\n}\n",
8
8
  "/**\n * compound-surnames.ts — surname spans the corpus names outright, for the\n * splitter to read where the print itself carries no boundary.\n *\n * GENERATED by a walk over a large results corpus. DO NOT HAND-EDIT — change\n * the walk and re-run it.\n *\n * Each entry is one surname span some `Last, First` print in the corpus puts\n * ahead of its own inversion comma, folded (`./name-fold.ts`) and joined. None\n * carries a standalone particle: a span the particle vocabulary can already walk\n * back over is the vocabulary's business and is deliberately not here, so the two\n * never contend for the same boundary. The comment on each row is how one anchor\n * print spelt it.\n *\n * WHAT THIS IS NOT. It is not a per-name lookup deciding WHICH PERSON a print is\n * — the class `name-split.ts`'s header excludes. It decides where the surname\n * ENDS, which is the split's own question, and it generalizes past the bearer the\n * anchor named: `Trulton McKenna, Nuala` also settles `Petra Trulton Mairvivith`'s\n * sibling spans for every other bearer of the same surname.\n */\n\nimport { nameFold } from \"./name-fold.ts\";\n\n/** The spans, folded and joined. */\nexport const COMPOUND_SURNAMES: ReadonlySet<string> = new Set([\n\t\"bremersumma\", // Bremer Summa\n\t\"graymilewski\", // Gray Milewski\n\t\"lawlerlopez\", // Lawler Lopez\n\t\"mcinerneyzona\", // McInerney Zona\n\t\"morandenno\", // Moran Denno\n\t\"murphyzink\", // Murphy Zink\n\t\"murraymacritchie\", // Murray Macritchie\n\t\"powersozyurt\", // Powers Ozyurt\n\t\"sharkeyochoa\", // Sharkey Ochoa\n\t\"vanderkooi\", // Vander Kooi\n\t\"vanderwoude\", // Vander Woude\n\t\"woodsdoherty\", // Woods Doherty\n\t\"woodsmckenna\", // Woods McKenna\n]);\n\n/**\n * Do these tokens, read as one span, form a surname the corpus names outright?\n *\n * Folds the JOINED run rather than each token, so a print that spaces what\n * another glues matches either way.\n */\nexport function isCompoundSurname(tokens: readonly string[]): boolean {\n\treturn COMPOUND_SURNAMES.has(tokens.map(nameFold).join(\"\"));\n}\n",
@@ -13,7 +13,7 @@
13
13
  "/**\n * person-name.ts — the parsed personal name, and its five level projections.\n *\n * `docs/NAME-NORMALIZATION.md` § *The shape of the normalizer* (440-560) is the\n * specification. Read it; this file implements it and does not restate it.\n *\n * ## One parse, five projections — not five normalizers\n *\n * The ask is a canonical NAME normalizer, not a canonical STRING normalizer. A\n * string normalizer must pick one lossy answer, and every caller that wanted a\n * different one writes its own — which is how six particle vocabularies and\n * three splitters happened. This parses once, keeps the structure, and lets each\n * caller name the loss it can afford with a `dop` argument.\n *\n * NN0 is the print. NN1 repairs only never-information. NN2 is the canonical\n * display string. NN3 drops punctuation and case off NN2. NN4 drops field order\n * off NN3. The level table in § *The levels, by use case* is authority for which of those each level\n * keeps.\n *\n * ## NN2 IS NOT RE-IMPLEMENTED HERE\n *\n * It is `./person-display.ts`, called. That module is the display convention's renderer\n * and it already reads the one splitter, the one particle vocabulary and the\n * lexicon; a second renderer built off `NamePart` would be the third\n * implementation of \"which token is the surname\" that this whole initiative\n * exists to delete. NN3 and NN4 are then pure string transforms of NN2, which is\n * exactly what that table says they are.\n *\n * ## What `NamePart` is for, since NN2 does not read it\n *\n * The per-PART lexicon lookup. `lexiconKey(\"Torvell-MacDonald\")` is\n * `torvellmacdonald`, which no entry answers; `macdonald` is one. A compound's\n * `parts` make that lookup per-part by construction, so no fused-prefix stem list is\n * needed to find the lexicon entry inside a compound.\n *\n * ## Recursion, not inheritance\n *\n * `McRalue-Quorvez`, `de la Varno-O'Thyltith` and `McFoskemow-Varnowski` are measured\n * corpus names that a class hierarchy cannot express — no object is both\n * `IrishName` and `HispanicName`. A part that may contain parts holds them\n * without strain and each child keeps its own `tradition`.\n *\n * ## The parts carry the PRINT\n *\n * `particles`, `base` and `suffixes` hold the print's own tokens — accent, case\n * and apostrophe intact. `{ particles: [\"Ní\"], base: \"Mhaolvarna\" }` is what\n * makes `NíMhaolvarna`, `Ní Mhaolvarna` and `nimhaolvarna` three renderings of one\n * parse instead of a smush committed at parse time.\n *\n * ## A FUSED prefix is not a particle run\n *\n * `particles` holds what the PRINT separated. The `Mc` of `McRalue` is inside\n * the token, so it is part of `base` and `./name-case.ts`'s D3 rules answer for\n * it; the `Mc` of `Mc Virkby` is a run. That is the vocabulary's own test read at\n * the other boundary — a particle is confirmed from the tokens that follow it,\n * never from resemblance.\n */\n\nimport { normalizeApostrophes } from \"../lexicon/apostrophes.ts\";\nimport { toAscii } from \"../lexicon/ascii-approx.ts\";\nimport { isStandaloneNameParticle, nameParticle } from \"../particles/particle-vocabulary.ts\";\nimport { type CellVerdict, type Refusal, classifyCell } from \"./cell-verdict.ts\";\nimport { isNoNamePrint } from \"./name-placeholder.ts\";\nimport { NAME_REFUSED, type ParentheticalHandler } from \"./name-scrub.ts\";\nimport {\n\ttype NameOrder,\n\ttype NameSplit,\n\tgivenNameGroups,\n\tisNameSuffix,\n\tsplitPersonName,\n} from \"./name-split.ts\";\nimport {\n\ttype DisplayLexicon,\n\tGIVEN_SEPARATOR,\n\tSURNAME_SEPARATOR,\n\tformatPersonDisplay,\n\tlexiconKey,\n\tparsePersonName,\n} from \"./person-display.ts\";\nimport { isTeamPrint } from \"./team-name.ts\";\n\n// ─── traditions ───────────────────────────────────────────────────────────────\n\n/**\n * What tradition a name part belongs to. One letter, per `docs/NAME-NORMALIZATION.md:449`.\n *\n * IT IS CARRIED AND NEVER BRANCHED ON, which is the same discipline\n * `../particles/particle-vocabulary.ts` states for `ParticleTradition`: the flag is\n * evidence for a consumer, and the only behaviour the document reserves for it is\n * denial at NN5 — *\"two parts with different non-null traditions never match\"* —\n * which is the experimental band and not implemented here.\n */\nexport type NameTradition = \"a\" | \"b\" | \"g\" | \"i\" | \"n\" | \"s\";\n\n/**\n * The six traditions, each under BOTH of its codes.\n *\n * TWO ALPHABETS FOR ONE CONCEPT, AND THAT IS WHY THIS TABLE EXISTS. `names.txt`\n * issues a tradition as a DIGIT (`Kowalski:L6`) and its header rules those\n * indices permanent, running `1-9` then `a-z`; `docs/NAME-NORMALIZATION.md`\n * spells the same six as LETTERS. Deriving either from the other by position is\n * how they silently diverge the first time a seventh tradition is issued, so\n * both codes sit on one row and a spec pins that each column is injective.\n *\n * WELSH AND ROMANCE ARE DELIBERATELY UNISSUED — `names.txt` says so in its own\n * header — so no particle of the `romance` group reaches a tradition here.\n */\nexport const NAME_TRADITIONS: readonly {\n\treadonly letter: NameTradition;\n\treadonly index: string;\n\treadonly label: string;\n}[] = [\n\t{ letter: \"a\", index: \"1\", label: \"Armenian\" },\n\t{ letter: \"g\", index: \"2\", label: \"Germanic\" },\n\t{ letter: \"b\", index: \"3\", label: \"Iberian\" },\n\t{ letter: \"i\", index: \"4\", label: \"Irish/Gaelic\" },\n\t{ letter: \"n\", index: \"5\", label: \"Nordic\" },\n\t{ letter: \"s\", index: \"6\", label: \"Slavic\" },\n];\n\n/** `names.txt`'s tradition index → this module's letter. `undefined` if unissued. */\nexport function traditionFromIndex(index: string): NameTradition | undefined {\n\treturn NAME_TRADITIONS.find((t) => t.index === index)?.letter;\n}\n\n/**\n * A tradition lookup over `names.txt`, as this module consults it: one O(1)\n * question keyed by `lexiconKey()`, answered with a letter or `undefined`.\n *\n * IT IS INJECTED FOR THE SAME REASON `DisplayLexicon` IS. This package is a\n * zero-dependency leaf that reads no file, and a consumer may cache folds that run\n * through it under a key that covers the code and no data file — so a table compiled\n * in here is one such a cache key cannot see moving. The caller that already holds\n * `names.txt` hands its lookup in.\n */\nexport type NameTraditionLookup = (key: string) => NameTradition | undefined;\n\n// ─── the type ─────────────────────────────────────────────────────────────────\n\n/**\n * One name part: a root, the particle run that governs it, and — for a\n * compound joined by a hyphen or a space — the decomposition of that root.\n */\nexport interface NamePart {\n\t/**\n\t * The particle run as the PRINT gave it, in reading order, never smushed.\n\t * Empty where the print separated none.\n\t */\n\treadonly particles: readonly string[];\n\t/**\n\t * The root the particles govern, as printed. May carry a space (`Stoskmore Trirock`)\n\t * or a hyphen (`Walter-Oreskarard`), and either makes it a compound — see `parts`.\n\t */\n\treadonly base: string;\n\t/**\n\t * `base` decomposed. NON-EMPTY ONLY FOR A COMPOUND, and a compound here is a root\n\t * of two or more pieces joined by a HYPHEN OR A SPACE: `O'Mearorro-Failtonton` and\n\t * `Comerton Rennuvham` both decompose, one leaf per piece. The rule\n\t * for names is that a hyphen and a space between two surname parts are the same\n\t * thing (`name-compose.ts`, `surnameParts`), and a directory that prints\n\t * `Comerton Rennuvham, Ciara` names the same `Rennuvham` a register printing `Ciara\n\t * Rennuvham` does. The JOINER IS NOT RECORDED HERE because nothing renders from the\n\t * parts: `base` keeps the print's own space or hyphen, and `person-display.ts`\n\t * renders `base` (`Stoskmore Trirock`, never `StoskmoreTrirock`).\n\t */\n\treadonly parts: readonly NamePart[];\n\t/** what tradition the part asserts, or `null` where nothing settles it */\n\treadonly tradition: NameTradition | null;\n}\n\n/** The levels over which equality is an equivalence relation. */\nexport type TransitiveLevel = \"nn0\" | \"nn1\" | \"nn2\" | \"nn3\" | \"nn4\";\n\n/**\n * Every level, including the experimental similarity band.\n *\n * THE BOUNDARY BETWEEN NN4 AND NN5 IS TRANSITIVITY, and it is in the types\n * rather than in a docblock. NN0-NN4 are total functions, so equal\n * keys form an equivalence relation and a hash-backed set or map is well\n * defined. NN5 is a DISTANCE, so `probablySame(a,b) ∧ probablySame(b,c) ⇏\n * probablySame(a,c)` and any structure over it is a clustering whose contents\n * depend on insertion order and on a declared linkage.\n */\nexport type Level = TransitiveLevel | \"nn5\";\n\n/**\n * A printed personal name, parsed.\n *\n * `toString()` RETURNS NN2 DELIBERATELY, and the reason is asymmetric cost: NN2\n * is the strictest view, so an accidental `${a} === ${b}` UNDER-merges. A false\n * reject is recoverable. A false accept silently merges two dancers.\n *\n * NEVER COMPARE TWO LEVEL STRINGS WITH `===`. This is the floating-point\n * discipline and it is what stops a caller writing a second normalizer: a caller\n * that cannot compare declares its precision instead, and the `dop` argument at\n * the call site *is* the justification, inline and readable.\n */\nexport interface PersonName {\n\treadonly [Symbol.toStringTag]: \"PersonName\";\n\t/** NN2. See the note above before comparing it with anything. */\n\ttoString(): string;\n\n\t/** NN0 — exactly what the page said. */\n\treadonly nn0: string;\n\t/** NN1 — the print with only never-information repaired. */\n\treadonly nn1: string;\n\t/** NN2 — the canonical display string, `Last<<First<Middle`, ASCII. */\n\treadonly nn2: string;\n\t/**\n\t * NN3 — the fold two prints are COMPARED at. NOT a drawer a row goes in: no row is\n\t * ever filed under a key, and a key is never used for matching by `===`. A row is filed for the\n\t * address of the result that printed it. Two names are compared with\n\t * `probablySame(a, b, dop)`; a caller needing a hash structure takes\n\t * `createNameSet(dop)` / `createNameMap(dop)`, which hold the precision themselves.\n\t */\n\treadonly nn3: string;\n\t/** NN4 — NN3 with field order dropped. A matching view, never a key. */\n\treadonly nn4: string;\n\n\t/**\n\t * How long the DISPLAY name is — `toString()`, which is NN2.\n\t *\n\t * IT IS A GETTER FOR THE DISPLAY NAME LENGTH: `p.nn3.length` asks for the exact\n\t * level's length, and `p.length` is the display name's. A caller wanting the\n\t * length of some OTHER level still asks that level for it, which is the point\n\t * of the split — this one is the length of the name as the project renders it,\n\t * and nothing has to know which level that is.\n\t *\n\t * IT IS NOT A COMPARISON. Two names of equal display length are not thereby\n\t * the same name; `nameCompare`/`probablySame` are the only things that answer\n\t * that, at a declared level.\n\t */\n\treadonly length: number;\n\n\t/**\n\t * The SURNAME field of NN3 — upper case, punctuation and accents gone.\n\t *\n\t * THE KEY-GRADE SURNAME, and it exists so that a caller asking *\"do these two\n\t * prints share a surname\"* never re-derives one. It is the half of `nn3`\n\t * before the field separator, so it folds exactly as `nn3` folds and two\n\t * callers cannot disagree about it: `O'Rervton`, `ORervton` and `Ó Rervton` reach\n\t * `ORERVTON`, and the spaced compound `Graro - Brarkia` reaches `GRAROBRARKIA`\n\t * because a compound surname is ONE field (C4).\n\t *\n\t * `surname` above is the PARSE — particles, base, sub-parts, tradition, with\n\t * the print's own case and accents intact. This is its projection at NN3. Ask\n\t * `surname` what the name IS; ask this whether two prints AGREE on it. It is not\n\t * a filing key and a row is never filed under it (see `nn3`).\n\t *\n\t * `\"\"` for a refusal, which is the same answer as \"no surname was captured\"\n\t * on purpose: neither holds a surname, and a refusal must not fold to a\n\t * name-shaped token (see `nn3`).\n\t */\n\tsurnameKey(): string;\n\n\t/**\n\t * The GIVEN-NAME fields of NN3, in print order, AS A LIST.\n\t *\n\t * `givenName()` below is this joined, and it is DEFINED as this joined, so the\n\t * two cannot disagree about where a field boundary is. A caller that wants the\n\t * fields asks for the fields; splitting the joined string on the separator is\n\t * a hand split, and a hand split is a second answer to where a field boundary is.\n\t *\n\t * THE FIELD ORDER IS THE PRINT'S. Element `0` is the first given name and the\n\t * rest are what NN5 calls the MIDDLE fields; `./name-middle.ts` is the one\n\t * consumer that reads it that way, and it is a RELATION over two of these\n\t * lists rather than a sixth level.\n\t *\n\t * A TOKEN-VALUED PARTITIONER IS COMPARED AS TOKENS. The same rule holds for school\n\t * names, and the reason is the same here, except that C4 makes it stronger — no\n\t * NN3 field contains a space, so the join back is injective and the rule is\n\t * about which question is being asked, not about ambiguity.\n\t *\n\t * `[]` where the parse holds no given name at all, and for a refusal.\n\t */\n\tgivenFields(): readonly string[];\n\n\t/**\n\t * The GIVEN-NAME fields of NN3, in print order, `<`-joined.\n\t *\n\t * IT EXISTS so that no caller slices a stored key at `<<` and splits the remainder\n\t * on `<` itself. `surnameKey()` and this one partition\n\t * `nn3`, so a caller needs neither separator.\n\t *\n\t * IT IS NN3'S FIELD STRUCTURE AND NOT THE PARSE'S. A suffix NN2 wrote into the\n\t * trailing given slot is here too — `Jyskock<<John<II` gives `JOHN<II` —\n\t * because that is where the KEY carries it, and a caller comparing given-name\n\t * fields is comparing what the key holds. `suffixes` is where the parse's own\n\t * list of them is, and it is the thing to read when the question is about\n\t * generation rather than about the key.\n\t *\n\t * `\"\"` where the parse holds no given name at all, and for a refusal.\n\t */\n\tgivenName(): string;\n\n\treadonly surname: NamePart;\n\treadonly given: readonly NamePart[];\n\t/**\n\t * Generational and qualification suffixes, AS PRINTED and in print order.\n\t * The canonical spelling is a rendering decision and lives at NN2.\n\t */\n\treadonly suffixes: readonly string[];\n\n\t/**\n\t * Non-null exactly when the cell holds something that is not a person's name.\n\t * An EMPTY cell holds nothing and carries no refusal (`isEmpty()`), so\n\t * `refusal === null` is not \"a person\": ask `isPerson()`.\n\t */\n\treadonly refusal: Refusal | null;\n\t/** What `classifyCell` made of the cell. */\n\treadonly verdict: CellVerdict;\n\n\t/**\n\t * Does this cell name a TEAM rather than a person?\n\t *\n\t * THE PREDICATE, and the reason it exists is the shape it replaces:\n\t * `PersonName.toString().contains('Team')` or anything like it.\n\t * A substring test says yes to `Teamwork Murphy`; this reads the team\n\t * format — the word, and at most one letter after one space.\n\t *\n\t * IT IS ASKED OF NN1, NOT OF `toString()`. NN2 of a team is `!!!INVALID`,\n\t * because a team fills neither the surname nor the given slot and the parse\n\t * refuses it; NN1 is the print with only never-information repaired, which is\n\t * where the designation still is. A `true` here therefore EXPLAINS a refusal\n\t * rather than contradicting one — the cell was rejected as a person's name\n\t * because it is a team, which is a different fact from a defective cell.\n\t */\n\tisTeam(): boolean;\n\n\t/**\n\t * Does this cell name a person?\n\t *\n\t * THE THREE KINDS ARE NOT TWO, and this predicate is where a caller stops\n\t * having to know that. `./cell-verdict.ts` keeps *\"no name was captured\"*\n\t * and *\"this is not a name\"* apart because a consumer reports each\n\t * separately; a caller asking whether it holds a person wants `false` for\n\t * both, and would otherwise re-derive the disjunction — a second answer to\n\t * the question `classifyCell` already settled.\n\t *\n\t * IT REPLACES `icao === null`. A key string that is absent is the OUTPUT of\n\t * a refusal, so testing it makes every consumer depend on the spelling of a\n\t * fold rather than on the verdict behind it: `icao === null` becomes\n\t * `!nameA?.isPerson()`.\n\t *\n\t * It says nothing about WHICH person, and nothing about teams — which\n\t * prints name no person is `isTeam()`'s question and is not answered here.\n\t */\n\tisPerson(): boolean;\n\n\t/**\n\t * Was NO name captured: the cell is empty, or whitespace only?\n\t *\n\t * The third kind, asked directly. An empty cell is neither a person nor a\n\t * refusal, so a caller that means \"the sheet printed nothing here\" asks this\n\t * and never `refusal === null && !isPerson()`.\n\t */\n\tisEmpty(): boolean;\n\n\t/**\n\t * Did the page print NO NAME here: an empty cell, a cell with no letter in\n\t * it (`???`, `0`), or a placeholder (`Unknown`, `TBA`, `Not known`)?\n\t *\n\t * `isEmpty()` is the first kind alone; this is the whole of \"no name was\n\t * printed\", and it does not depend on which refusal rule fired (`TBA` is the\n\t * scrub's `refuse-single-token`, `Not known` the guard's `placeholder`).\n\t * `./name-placeholder.ts` is the one place the answer is decided, and\n\t * `isNoNamePrint` there is the same answer for a caller that holds only the\n\t * print.\n\t */\n\tprintsNoName(): boolean;\n}\n\n// ─── build context ────────────────────────────────────────────────────────────\n\n/**\n * What one factory builds names under. Nothing in this module is state: every\n * function that consults the lexicon, the tradition lookup or the parenthetical\n * handler takes the context it was handed, so two factories never see each\n * other's options. `./factory.ts` makes the public factories over it.\n */\nexport interface BuildContext {\n\t/** consulted by NN2 before its rules (doc D5); `undefined` means rules only */\n\treadonly lexicon: DisplayLexicon | undefined;\n\t/** a root's tradition where its particles do not settle it */\n\treadonly traditions: NameTraditionLookup | undefined;\n\t/** what an aside in `( … )` or `\" … \"` means; `undefined` strips every aside */\n\treadonly parenthetical: ParentheticalHandler | undefined;\n}\n\n// ─── the levels ───────────────────────────────────────────────────────────────\n\n/**\n * NN1 — the print with only NEVER-INFORMATION repaired.\n *\n * Compatibility composition folds a ligature (`Delfina` → `Delfina`), the apostrophe\n * vocabulary folds a curly quote, format characters go and control characters\n * become the whitespace they were standing in for. CASE AND ACCENTS SURVIVE:\n * the level table keeps both at this level, and input case is a signal that NN0 and NN1\n * may read.\n */\nfunction renderNn1(print: string): string {\n\treturn normalizeApostrophes(print.normalize(\"NFKC\"))\n\t\t.replace(/\\p{Cf}+/gu, \"\")\n\t\t.replace(/\\p{Cc}+/gu, \" \")\n\t\t.replace(/\\s+/gu, \" \")\n\t\t.trim();\n}\n\n/**\n * NN3 — NN2 with punctuation and case dropped (the level table, D2, C4).\n *\n * A PURE TRANSFORM OF NN2, which is what makes NN3 \"ignores strictly more than\n * NN2 does\" a property rather than a hope. The separators survive because they\n * are the field structure, not punctuation: `O'Rervton<<Moira` reaches\n * `ORERVTON<<MOIRA`, and the space of `Stoskmore Trirock<<Steathainnell` goes with\n * everything else, which is C4 — no field contains a space.\n */\nfunction renderNn3(nn2: string): string {\n\treturn nn2.replace(/[^\\p{L}\\p{N}<]+/gu, \"\").toLocaleUpperCase();\n}\n\n/**\n * NN2 cut into its fields — the surname, then each given name, in print order.\n *\n * ONE CUT, READ BY BOTH HALVES. `surnameKey()` takes `[0]` and `givenName()`\n * takes the rest, so the two cannot disagree about where the boundary is, and\n * neither re-implements `renderNn3` — each folds the slice it took with the same\n * function `nn3` itself uses. The suffixes are already outside the given-name\n * fields, because NN2 wrote them there.\n */\nfunction fieldsOfNn2(nn2: string): string[] {\n\tconst at = nn2.indexOf(SURNAME_SEPARATOR);\n\tif (at < 0) return [nn2];\n\treturn [\n\t\tnn2.slice(0, at),\n\t\t...nn2\n\t\t\t.slice(at + SURNAME_SEPARATOR.length)\n\t\t\t.split(GIVEN_SEPARATOR)\n\t\t\t.filter((f) => f !== \"\"),\n\t];\n}\n\n/**\n * NN4 — NN3 with field order dropped (the level table).\n *\n * THE ORDER IT TOLERATES IS THE NAME ORDER. A sheet that printed `Mailtina John`\n * where another printed `John Mailtina` produces two different NN3 keys and one\n * NN4, which is what the level is for: asking whether two prints are the same\n * name when the split may have read them opposite ways.\n */\nfunction renderNn4(nn3: string): string {\n\treturn nn3\n\t\t.split(GIVEN_SEPARATOR)\n\t\t.filter((f) => f !== \"\")\n\t\t.sort()\n\t\t.join(GIVEN_SEPARATOR);\n}\n\n// ─── the parse ────────────────────────────────────────────────────────────────\n\n/** The tradition a particle run asserts, where the vocabulary settles one. */\nfunction traditionOfParticles(particles: readonly string[]): NameTradition | null {\n\tfor (const p of particles) {\n\t\tconst entry = nameParticle(p);\n\t\tif (entry === undefined) continue;\n\t\t// THREE OF THE SIX VOCABULARY GROUPS MAP, AND THE PROJECT ALREADY SAID SO.\n\t\t// `src/cli/propose-traditions.ts` is the proposer\n\t\t// that issues these indices from a print's morphology: its Irish/Gaelic\n\t\t// marker is `^(Mc|Fitz)` — *\"covers the Norman `Fitz`\"* — and its Germanic\n\t\t// marker is the `Van|Von|Der|Den|Ter|Ten|Zu` particle. `romance` reaches\n\t\t// nothing, because `names.txt` rules Romance deliberately unissued and the\n\t\t// proposer types only the MULTI-TOKEN `de la`/`de los`/`del` as Iberian,\n\t\t// which is a fact about the whole print and not about a bare `de`.\n\t\t// `elided` and `ocr` describe how a print spells a join, not what it\n\t\t// asserts. A token carrying several traditions is answered by the first\n\t\t// that maps, so `o` (gaelic AND elided) is Irish and `d` is nothing.\n\t\tif (entry.traditions.includes(\"gaelic\") || entry.traditions.includes(\"norman\")) return \"i\";\n\t\tif (entry.traditions.includes(\"germanic\")) return \"g\";\n\t}\n\treturn null;\n}\n\n/** The tradition of one root, from the particles first and the lexicon second. */\nfunction traditionOf(\n\tparticles: readonly string[],\n\tbase: string,\n\tctx: BuildContext,\n): NameTradition | null {\n\tconst fromParticles = traditionOfParticles(particles);\n\tif (fromParticles !== null) return fromParticles;\n\tif (ctx.traditions === undefined) return null;\n\tconst key = lexiconKey(base);\n\treturn key === \"\" ? null : (ctx.traditions(key) ?? null);\n}\n\n/** A leaf part: no particles of its own, no decomposition. Used for a compound's children. */\nfunction leafPart(base: string, ctx: BuildContext): NamePart {\n\treturn { particles: [], base, parts: [], tradition: traditionOf([], base, ctx) };\n}\n\n/**\n * A ROOT'S COMPOUND PIECES, or one piece where it is not a compound.\n *\n * A HYPHEN AND A SPACE ARE ONE JOINER between two surname parts: `Walter-Oreskarard`\n * and `Comerton Rennuvham` both cut.\n *\n * A HYPHEN ALWAYS CUTS (`docs/NAME-NORMALIZATION.md` § *Consumer contract*). The print\n * hyphenated the piece off, so a hyphenated particle is a piece of its own: `El-Varoun` reads\n * `El` and `Varoun`, `De-Ste-Varne` reads `De`, `Ste` and `Varne`, `Goskick-La-Vorne` reads\n * `Goskick`, `La` and `Vorne`.\n *\n * A SPACE AFTER A PARTICLE DOES NOT CUT: a space is how a particle is printed as well as how\n * two surnames are joined, so the particle stays on the piece after it with the space the\n * print gave, and `Ní Jirkirkane Uí Sevith`'s root reads `Jirkirkane` and `Uí Sevith` and never a\n * part `Uí`. A particle with nothing after it in its hyphen piece is a piece of its own, the\n * same test `partFromTokens` applies to the leading run.\n *\n * Either way the particle still GOVERNS the piece after it, and what compares parts glues it\n * on (`./name-compose.ts`, `surnameParts`), as NN3 does.\n */\nfunction compoundSegments(base: string): string[] {\n\tconst out: string[] = [];\n\tfor (const piece of base.split(/-+/u)) {\n\t\tconst raw = piece.split(/\\s+/u).filter((s) => s !== \"\");\n\t\tlet held: string[] = [];\n\t\tfor (let i = 0; i < raw.length; i++) {\n\t\t\tconst t = raw[i] as string;\n\t\t\tif (i + 1 < raw.length && isStandaloneNameParticle(t)) {\n\t\t\t\theld.push(t);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tout.push([...held, t].join(\" \"));\n\t\t\theld = [];\n\t\t}\n\t}\n\treturn out;\n}\n\n/**\n * One part from a run of printed tokens.\n *\n * The particle run is the LEADING tokens that are standalone particles and\n * govern something after them; the rest, joined by the space the print gave, is\n * the root. A trailing token governs nothing and is therefore never a particle,\n * whatever it resembles — the same test `./person-display.ts` applies when it\n * renders the run.\n */\nfunction partFromTokens(tokens: readonly string[], ctx: BuildContext): NamePart {\n\tlet i = 0;\n\twhile (i + 1 < tokens.length && isStandaloneNameParticle(tokens[i] as string)) i++;\n\tconst particles = tokens.slice(0, i);\n\tconst base = tokens.slice(i).join(\" \");\n\tconst segments = compoundSegments(base);\n\treturn {\n\t\tparticles,\n\t\tbase,\n\t\tparts: segments.length > 1 ? segments.map((seg) => leafPart(seg, ctx)) : [],\n\t\ttradition: traditionOf(particles, base, ctx),\n\t};\n}\n\n/** One part from a run of token indices into a split. */\nfunction partFromRun(split: NameSplit, run: readonly number[], ctx: BuildContext): NamePart {\n\treturn partFromTokens(\n\t\trun.map((i) => split.tokens[i] as string),\n\t\tctx,\n\t);\n}\n\n// ─── construction ─────────────────────────────────────────────────────────────\n\ninterface Built {\n\tnn0: string;\n\tnn1: string;\n\tnn2: string;\n\tsurname: NamePart;\n\tgiven: readonly NamePart[];\n\tsuffixes: readonly string[];\n\trefusal: Refusal | null;\n\tverdict: CellVerdict;\n}\n\n/**\n * A `PersonName` over a built parse, with NN3 and NN4 computed on first read.\n *\n * A CLASS, SO THE METHODS LIVE ON THE PROTOTYPE. This was an object literal, and an\n * object literal's methods and getters are function objects made anew per instance:\n * nine of them, each with a closure over the builder, on every one of the ~166k names\n * the memo holds over a corpus pass. Measured on those names, the\n * literal cost 3.9 KB an instance and 612 MB of RSS for the memo; the class holds the\n * strings, the parts and two lazy slots and nothing else per instance.\n */\nclass MaterializedName implements PersonName {\n\treadonly nn0: string;\n\treadonly nn1: string;\n\treadonly nn2: string;\n\treadonly surname: NamePart;\n\treadonly given: readonly NamePart[];\n\treadonly suffixes: readonly string[];\n\treadonly refusal: Refusal | null;\n\treadonly verdict: CellVerdict;\n\t#nn3: string | undefined;\n\t#nn4: string | undefined;\n\n\tconstructor(b: Built) {\n\t\tthis.nn0 = b.nn0;\n\t\tthis.nn1 = b.nn1;\n\t\tthis.nn2 = b.nn2;\n\t\tthis.surname = b.surname;\n\t\tthis.given = b.given;\n\t\tthis.suffixes = b.suffixes;\n\t\tthis.refusal = b.refusal;\n\t\tthis.verdict = b.verdict;\n\t}\n\n\tget [Symbol.toStringTag](): \"PersonName\" {\n\t\treturn \"PersonName\";\n\t}\n\ttoString(): string {\n\t\treturn this.nn2;\n\t}\n\tget nn3(): string {\n\t\t// REFUSAL IS NOT A NAME AND IS NOT FOLDED LIKE ONE. `!!!INVALID` through\n\t\t// `renderNn3` would lose its punctuation and read as a name-shaped token,\n\t\t// which is the one thing the `!!!` spelling of it exists to prevent.\n\t\tthis.#nn3 ??= this.refusal !== null ? NAME_REFUSED : renderNn3(this.nn2);\n\t\treturn this.#nn3;\n\t}\n\tget nn4(): string {\n\t\tthis.#nn4 ??= this.refusal !== null ? NAME_REFUSED : renderNn4(renderNn3(this.nn2));\n\t\treturn this.#nn4;\n\t}\n\tget length(): number {\n\t\treturn this.nn2.length;\n\t}\n\tsurnameKey(): string {\n\t\treturn this.refusal !== null ? \"\" : renderNn3(fieldsOfNn2(this.nn2)[0] ?? \"\");\n\t}\n\tgivenFields(): readonly string[] {\n\t\treturn this.refusal !== null ? [] : fieldsOfNn2(this.nn2).slice(1).map(renderNn3);\n\t}\n\tgivenName(): string {\n\t\t// DEFINED AS THE FIELDS JOINED, not rendered a second way. `renderNn3`\n\t\t// keeps the separator, so folding each field and joining is the same string\n\t\t// as joining and folding — and writing it this way makes that an identity\n\t\t// rather than a coincidence two bodies have to keep agreeing on.\n\t\treturn this.givenFields().join(GIVEN_SEPARATOR);\n\t}\n\tisTeam(): boolean {\n\t\treturn isTeamPrint(this.nn1);\n\t}\n\tisPerson(): boolean {\n\t\treturn this.refusal === null && this.verdict.kind !== \"empty\";\n\t}\n\tisEmpty(): boolean {\n\t\treturn this.verdict.kind === \"empty\";\n\t}\n\tprintsNoName(): boolean {\n\t\treturn this.isEmpty() || isNoNamePrint(this.nn0);\n\t}\n}\n\nfunction materialize(b: Built): PersonName {\n\treturn new MaterializedName(b);\n}\n\nconst EMPTY_PART: NamePart = { particles: [], base: \"\", parts: [], tradition: null };\n\nfunction refusedName(\n\tprint: string,\n\tnn1: string,\n\tverdict: CellVerdict,\n\trefusal: Refusal,\n): PersonName {\n\treturn materialize({\n\t\tnn0: print,\n\t\tnn1,\n\t\t// NN0 AND NN1 STILL CARRY THE PRINT. A refusal says the cell is not a name;\n\t\t// it does not say the page printed nothing, and the level table gives NN0 as\n\t\t// \"exactly what the page said\" with no carve-out.\n\t\tnn2: NAME_REFUSED,\n\t\tsurname: EMPTY_PART,\n\t\tgiven: [],\n\t\tsuffixes: [],\n\t\trefusal,\n\t\tverdict,\n\t});\n}\n\n/**\n * The ICAO shape, as a fast path for a string already believed well-formed.\n *\n * `Surname<<Given<Middle`, which is the shape of the key a row is filed under\n * and what a human-facing surface renders. THROWS on anything else: the point of\n * the fast path is to skip the guard, so a caller that is wrong about its input\n * must find out rather than receive a plausible parse.\n *\n * A SUFFIX IN THE TRAILING GIVEN SLOT IS READ BACK AS A SUFFIX, because that is\n * where NN2 put it (`Jyskock<<John<II`), so `factory.fromIcao(pn.nn2)`\n * reproduces `pn`'s own partition rather than inventing a given name `II`.\n *\n * `print` IS THE VERBATIM STRING THE KEY WAS MADE FROM, where the caller holds\n * it — a stored row holds both. Without it the key stands in for its own input\n * and NN0 reports a fold as though it were the page, which is the one thing NN0\n * may never do: the level table gives NN0 as *\"exactly what the page said\"*.\n * Pass it wherever a row carries it. It changes NOTHING else: the partition, and\n * every level from NN2 down, come off the key, because the key is what the row\n * was filed under and a second opinion at read time is a silent split between\n * the query side and the stored side.\n */\n/**\n * Will `fromIcao` read this string, or throw on it?\n *\n * IT ASKS THE SAME QUESTION THE THROW ASKS, off the same normalized form, so a\n * caller that tests before calling cannot be told yes and then thrown at. That is\n * the whole reason it is here rather than spelled as an `indexOf` at each caller:\n * a stored key with a leading space is ICAO-shaped to a raw `indexOf` and is not\n * to `renderNn1`, and the corpus holds such keys.\n */\nexport function isIcaoName(icao: string): boolean {\n\treturn renderNn1(icao).indexOf(SURNAME_SEPARATOR) > 0;\n}\n\n/** An ICAO key read back into a name. The factories' `fromIcao`. */\nexport function buildFromIcao(ctx: BuildContext, icao: string, print?: string): PersonName {\n\tconst s = renderNn1(icao);\n\tconst at = s.indexOf(SURNAME_SEPARATOR);\n\tif (at <= 0) {\n\t\tthrow new TypeError(\n\t\t\t`fromIcao: not an ICAO name, expected Surname${SURNAME_SEPARATOR}Given: ${JSON.stringify(icao)}`,\n\t\t);\n\t}\n\tconst surnameText = s.slice(0, at);\n\tconst fields = s\n\t\t.slice(at + SURNAME_SEPARATOR.length)\n\t\t.split(GIVEN_SEPARATOR)\n\t\t.filter((f) => f !== \"\");\n\tconst suffixes: string[] = [];\n\twhile (fields.length > 0 && isNameSuffix(fields[fields.length - 1] as string)) {\n\t\tsuffixes.unshift(fields.pop() as string);\n\t}\n\tconst nn2 = toAscii(s);\n\treturn materialize({\n\t\tnn0: print ?? icao,\n\t\tnn1: print === undefined ? s : renderNn1(print),\n\t\tnn2,\n\t\tsurname: partFromTokens(\n\t\t\tsurnameText.split(\" \").filter((t) => t !== \"\"),\n\t\t\tctx,\n\t\t),\n\t\tgiven: fields.map((f) =>\n\t\t\tpartFromTokens(\n\t\t\t\tf.split(\" \").filter((t) => t !== \"\"),\n\t\t\t\tctx,\n\t\t\t),\n\t\t),\n\t\tsuffixes,\n\t\trefusal: null,\n\t\tverdict: { kind: \"name\", scrubbed: s, rules: [] },\n\t});\n}\n\n/**\n * An NN4 string read back: fields whose ORDER carries nothing, because NN4 is\n * the level that dropped it.\n *\n * IT EXISTS FOR C2 AND FOR NOTHING ELSE. Idempotence is scoped to a level\n * re-applied to its OWN output, so `personName(x.nn4).nn4 === x.nn4` has to\n * hold; reading NN2 or NN3 off such a parse is defined but meaningless, since\n * the surname slot holds whichever field sorted first.\n */\nfunction parseUnordered(s: string, ctx: BuildContext): PersonName {\n\tconst fields = s.split(GIVEN_SEPARATOR).filter((f) => f !== \"\");\n\treturn materialize({\n\t\tnn0: s,\n\t\tnn1: s,\n\t\tnn2: (fields[0] as string) + SURNAME_SEPARATOR + fields.slice(1).join(GIVEN_SEPARATOR),\n\t\tsurname: partFromTokens([fields[0] as string], ctx),\n\t\tgiven: fields.slice(1).map((f) => partFromTokens([f], ctx)),\n\t\tsuffixes: [],\n\t\trefusal: null,\n\t\tverdict: { kind: \"name\", scrubbed: s, rules: [] },\n\t});\n}\n\n/** The parse of one printed cell. Total. The factories' `parse`. */\nexport function buildPersonName(ctx: BuildContext, print: string, order: NameOrder): PersonName {\n\tconst nn1 = renderNn1(print);\n\t// THE FAST PATH IS TAKEN ONLY WHERE IT CANNOT THROW, which is what makes this\n\t// function total. `buildFromIcao` rejects a separator at index 0 — the\n\t// point of a fast path is to skip the guard — so `<<Sean`, a key whose\n\t// surname half is empty, would reach a caller as an exception rather than as\n\t// a refusal. It is handed to the guard below instead, which is total.\n\tif (nn1.indexOf(SURNAME_SEPARATOR) > 0) return buildFromIcao(ctx, print);\n\t// An NN4 string: separators but no surname separator. See `parseUnordered`.\n\t//\n\t// A STRING OF BARE SEPARATORS IS NOT ONE. `parseUnordered` reads field 0 as\n\t// the surname slot, so a print whose separators fence off no field at all\n\t// would put `undefined` there and render a name-shaped NN2 out of nothing.\n\t// It is handed to the guard below, which refuses it.\n\tif (\n\t\tnn1.includes(GIVEN_SEPARATOR) &&\n\t\t!/[^\\p{L}\\p{N}<]/u.test(nn1) &&\n\t\tnn1.split(GIVEN_SEPARATOR).some((f) => f !== \"\")\n\t)\n\t\treturn parseUnordered(nn1, ctx);\n\n\tconst verdict = classifyCell(print, { parenthetical: ctx.parenthetical });\n\tif (verdict.kind === \"refused\") return refusedName(print, nn1, verdict, verdict.refusal);\n\tif (verdict.kind === \"empty\") {\n\t\treturn materialize({\n\t\t\tnn0: print,\n\t\t\tnn1,\n\t\t\tnn2: \"\",\n\t\t\tsurname: EMPTY_PART,\n\t\t\tgiven: [],\n\t\t\tsuffixes: [],\n\t\t\t// \"NO NAME WAS CAPTURED\" IS NOT \"THIS IS NOT A NAME\". A consumer reports\n\t\t\t// each separately and `classifyCell` keeps them apart, so an empty\n\t\t\t// cell carries no refusal.\n\t\t\trefusal: null,\n\t\t\tverdict,\n\t\t});\n\t}\n\n\tconst split = splitPersonName(verdict.scrubbed, order);\n\tconst parts = parsePersonName(verdict.scrubbed, order, ctx.lexicon);\n\tif (split === null || parts === null) {\n\t\t// A TEAM PRINT LANDS HERE, via `parsePersonName`'s own null, and it is the\n\t\t// one refusal that is not a defect. `isTeam()` above is what tells the two\n\t\t// apart; there is still no second answer to \"which prints name no person\"\n\t\t// written here, because `parsePersonName` asks the same predicate.\n\t\tconst refusal: Refusal = { rule: \"unsplittable\", printed: print, value: NAME_REFUSED };\n\t\treturn refusedName(print, nn1, verdict, refusal);\n\t}\n\n\treturn materialize({\n\t\tnn0: print,\n\t\tnn1,\n\t\tnn2: formatPersonDisplay(parts),\n\t\tsurname: partFromRun(split, split.surname, ctx),\n\t\tgiven: givenNameGroups(split).map((g) => partFromRun(split, g, ctx)),\n\t\tsuffixes: split.suffixes.map((i) => split.tokens[i] as string),\n\t\trefusal: null,\n\t\tverdict,\n\t});\n}\n\n/**\n * One level off a parsed name, by name.\n *\n * TRANSITIVE LEVELS ONLY, and the type is where that is said: NN5 is a distance\n * and has no string to read.\n */\nexport function levelOf(name: PersonName, dop: TransitiveLevel): string {\n\treturn name[dop];\n}\n\n/**\n * IS ONE GIVEN KEY THE OTHER MADE POORER? Both are `givenName()` keys, and `poorer` abbreviates\n * `fuller` in two shapes. Equal keys abbreviate each other.\n *\n * - THE WHOLE GIVEN NAME AS ONE INITIAL: a platform's public pages print `M Mailtina` where\n * its signed-in pages print `Mary Vellane Mailtina`, so the key `M` abbreviates `MARY<VELLANE`\n * - FIELD BY FIELD, the same number of fields and each field of `poorer` the matching field of\n * `fuller` or its one-letter INITIAL. The parse puts the first part of a compound surname it\n * does not know into the given fields: `N Kaiskystham Vearvo` and `Natalia Kaiskystham Vearvo` are\n * the keys `N<KAISKYSTHAM` and `NATALIA<KAISKYSTHAM` over one surname key `VEARVO`\n *\n * Nothing else is: `C Mailtina Beannell` (`C<MAILTINA`) is not `Cian Beannell` (`CIAN`), and crossed initials\n * (`NATALIA<M` against `N<KAISKYSTHAM`) are neither reading made poorer. The fields are cut here,\n * where the separator is defined, so no caller slices a key by hand.\n */\nexport function givenKeyAbbreviates(poorer: string, fuller: string): boolean {\n\treturn givenFieldsAbbreviate(poorer.split(GIVEN_SEPARATOR), fuller.split(GIVEN_SEPARATOR));\n}\n\n/** `givenKeyAbbreviates` over fields already cut: the one rule, read by both entry points. */\nfunction givenFieldsAbbreviate(p: readonly string[], f: readonly string[]): boolean {\n\tif (p.length === f.length && p.every((x, i) => x === f[i])) return true;\n\tconst whole = p.length === 1 ? (p[0] as string) : \"\";\n\tif (whole.length === 1 && (f[0] ?? \"\").startsWith(whole)) return true;\n\tif (p.length !== f.length) return false;\n\treturn p.every((x, i) => {\n\t\tconst y = f[i] as string;\n\t\treturn x === y || (x.length === 1 && y.startsWith(x));\n\t});\n}\n\n/**\n * Where a name's NN3 given fields stop being given names and start being suffixes. NN2 writes\n * a suffix into the trailing given slot (`Smithson<<W<IV`), and `suffixes` says how many of the\n * trailing fields it is. The same cut as `./name-middle.ts`'s, read off the parse's own decision\n * and never off the vocabulary (`Victoria V Mailtina` prints a middle INITIAL `V`).\n */\nfunction givenSuffixCut(p: PersonName): number {\n\treturn Math.max(1, p.givenFields().length - p.suffixes.length);\n}\n\n/**\n * IS ONE NAME'S GIVEN NAME THE OTHER'S MADE POORER, WITH THE SUFFIXES SET ASIDE? The rule is\n * `givenKeyAbbreviates`'s, applied to the given fields before the suffix cut, and the suffix\n * fields must then be equal at NN3. `givenName()` keeps the suffix in the trailing given slot,\n * because that is where the key carries it, so `W Smithson IV` (`W<IV`) against `William J.\n * Smithson IV` (`WILLIAM<J<IV`) had two fields against three and neither shape fired; set aside,\n * `W` is the whole given name as one initial of `WILLIAM<J`. A suffix one name prints and the\n * other does not is not set aside: `John Mailtina` is not `John Mailtina Jr` made poorer, he may be\n * the father.\n */\nexport function givenAbbreviates(poorer: PersonName, fuller: PersonName): boolean {\n\tconst p = poorer.givenFields();\n\tconst f = fuller.givenFields();\n\tconst pc = givenSuffixCut(poorer);\n\tconst fc = givenSuffixCut(fuller);\n\tconst ps = p.slice(pc);\n\tconst fs = f.slice(fc);\n\tif (ps.length !== fs.length || !ps.every((x, i) => x === fs[i])) return false;\n\treturn givenFieldsAbbreviate(p.slice(0, pc), f.slice(0, fc));\n}\n",
14
14
  "/**\n * The PersonName factories. A `PersonName` is only ever made by one of these.\n *\n * - `createPersonNameFactory(options)`: parses every call.\n * - `createCachingPersonNameFactory(options)`: memoizes `parse` on `(print, order)`.\n * - `defaultPersonNameFactory()`: one caching factory over the committed `names.txt`,\n * made on first use; `personName` and `personNameFromIcao` are its shorthands.\n *\n * A factory's options are fixed when it is made. Nothing here is mutable module\n * state, so a factory built for a test, a fixture lexicon or a different aside\n * policy can never change what another factory answers or poison its memo.\n */\n\nimport type { DisplayLexicon } from \"../lexicon/display.ts\";\nimport { Lexicon } from \"../lexicon/index.ts\";\nimport { lexiconKey } from \"../lexicon/keys.ts\";\nimport { NAME_REFUSED, type ParentheticalHandler } from \"./name-scrub.ts\";\nimport type { NameOrder } from \"./name-split.ts\";\nimport {\n\ttype BuildContext,\n\tNAME_TRADITIONS,\n\ttype NameTradition,\n\ttype NameTraditionLookup,\n\ttype PersonName as PersonNameShape,\n\tbuildFromIcao,\n\tbuildPersonName,\n\tgivenAbbreviates,\n\tgivenKeyAbbreviates,\n\tisIcaoName,\n\tlevelOf,\n\ttraditionFromIndex,\n} from \"./person-name.ts\";\n\n/**\n * One printed person's name, parsed. Made only by a `PersonNameFactory`.\n *\n * Read the levels (`nn0`–`nn4`, see `docs/NAME-NORMALIZATION.md`), the parts\n * (`surname`, `given`, `suffixes`), and ask it what it is (`isPerson()`,\n * `isTeam()`). Persist a level string (`nn2`, or `nn3` as a key), never the\n * object; read `nn2` back with `factory.fromIcao`.\n */\nexport type PersonName = PersonNameShape;\n\n/** The functions that go with a `PersonName` but are not asked of one. */\nexport const PersonName = {\n\t/** Will `fromIcao` read this string, or throw on it? */\n\tisIcao: isIcaoName,\n\t/** One transitive level off a parsed name, by name. */\n\tlevelOf,\n\t/** Is the given key `poorer` an abbreviation of `fuller`? */\n\tgivenKeyAbbreviates,\n\t/** Is `poorer`'s given name `fuller`'s made poorer, the suffixes set aside? */\n\tgivenAbbreviates,\n\t/** The value every level from NN2 down holds for a refused cell. */\n\tREFUSED: NAME_REFUSED,\n\t/** The six traditions, each under its letter and its names.txt index. */\n\tTRADITIONS: NAME_TRADITIONS,\n\t/** A names.txt tradition index → its letter. */\n\ttraditionFromIndex,\n} as const;\n\nexport interface PersonNameFactoryOptions {\n\t/**\n\t * The spellings NN2 consults before its rules. Default: the committed\n\t * `names.txt`. A `Lexicon` also supplies the default `traditions`. `null`:\n\t * rules only.\n\t */\n\treadonly lexicon?: Lexicon | DisplayLexicon | null;\n\t/**\n\t * A root's tradition where its particles do not settle it. Default: read from\n\t * the lexicon's digit flags when `lexicon` is a `Lexicon` (or defaulted),\n\t * otherwise none. `null`: none.\n\t */\n\treadonly traditions?: NameTraditionLookup | null;\n\t/** What an aside in `( … )` or `\" … \"` means. Default: strip every aside. */\n\treadonly parenthetical?: ParentheticalHandler;\n}\n\nexport interface CachingPersonNameFactoryOptions extends PersonNameFactoryOptions {\n\t/**\n\t * How many `(print, order)` parses to hold. Default\n\t * `DEFAULT_PERSON_NAME_CAPACITY`. `0` holds none, which is how a test shows\n\t * the memo changes no answer. Past capacity the oldest entry is evicted.\n\t */\n\treadonly capacity?: number;\n}\n\nexport interface PersonNameFactory {\n\t/** The parse of one printed cell. Total: a cell that is no name is refused, not thrown. */\n\tparse(print: string, order?: NameOrder): PersonName;\n\t/**\n\t * A stored ICAO key (`Surname<<Given<Middle`, an `nn2`) read back. Throws\n\t * where `PersonName.isIcao` says no. `print`, where known, becomes `nn0`.\n\t */\n\tfromIcao(icao: string, print?: string): PersonName;\n\t/** The options it was made with, as given. */\n\treadonly options: Readonly<PersonNameFactoryOptions>;\n}\n\nexport interface PersonNameCacheStats {\n\treadonly hits: number;\n\treadonly misses: number;\n\treadonly evictions: number;\n\treadonly size: number;\n\treadonly capacity: number;\n}\n\nexport interface CachingPersonNameFactory extends PersonNameFactory {\n\tstats(): PersonNameCacheStats;\n\t/** Empty the memo and zero the counters. */\n\tclear(): void;\n}\n\n/**\n * The default capacity. Above the distinct `(print, order)` pairs of a large\n * results corpus (~194k over 5.2M rows), so a full pass evicts nothing. A power\n * of two only because `Map` growth is happier that way.\n *\n * Memory, measured on 166,210 real names: ~1 KB retained per entry.\n */\nexport const DEFAULT_PERSON_NAME_CAPACITY = 262_144;\n\n/** Joins the order to the print with a character no print carries. */\nconst MEMO_SEPARATOR = \"\\u0000\";\n\n/**\n * The tradition lookup a lexicon's digit flags spell, keyed by `lexiconKey`.\n * A key whose entries carry two different traditions answers nothing.\n */\nexport function traditionLookupOf(lexicon: Lexicon): NameTraditionLookup {\n\tconst table = new Map<string, NameTradition | null>();\n\tfor (const { name, flags } of lexicon.entries) {\n\t\tlet t: NameTradition | undefined;\n\t\tfor (const ch of flags) {\n\t\t\tt = traditionFromIndex(ch);\n\t\t\tif (t !== undefined) break;\n\t\t}\n\t\tif (t === undefined) continue;\n\t\tconst key = lexiconKey(name);\n\t\tif (key === \"\") continue;\n\t\tconst was = table.get(key);\n\t\ttable.set(key, was === undefined || was === t ? t : null);\n\t}\n\treturn (key) => table.get(key) ?? undefined;\n}\n\nfunction contextOf(options: PersonNameFactoryOptions): BuildContext {\n\tconst lex = options.lexicon === undefined ? Lexicon.default() : (options.lexicon ?? undefined);\n\tconst lexicon = lex instanceof Lexicon ? lex.displayLexicon() : lex;\n\tconst traditions =\n\t\toptions.traditions === undefined\n\t\t\t? lex instanceof Lexicon\n\t\t\t\t? traditionLookupOf(lex)\n\t\t\t\t: undefined\n\t\t\t: (options.traditions ?? undefined);\n\treturn { lexicon, traditions, parenthetical: options.parenthetical };\n}\n\n/** A factory that parses every call. */\nexport function createPersonNameFactory(options: PersonNameFactoryOptions = {}): PersonNameFactory {\n\tconst ctx = contextOf(options);\n\treturn {\n\t\tparse: (print, order = \"unknown\") => buildPersonName(ctx, print, order),\n\t\tfromIcao: (icao, print) => buildFromIcao(ctx, icao, print),\n\t\toptions,\n\t};\n}\n\n/**\n * A factory that memoizes `parse` on `(print, order)`, which with its fixed\n * options is everything a parse reads. The same pair answers the same object.\n */\nexport function createCachingPersonNameFactory(\n\toptions: CachingPersonNameFactoryOptions = {},\n): CachingPersonNameFactory {\n\tconst ctx = contextOf(options);\n\tconst capacity = options.capacity ?? DEFAULT_PERSON_NAME_CAPACITY;\n\tconst cache = new Map<string, PersonName>();\n\tlet hits = 0;\n\tlet misses = 0;\n\tlet evictions = 0;\n\treturn {\n\t\tparse(print, order = \"unknown\") {\n\t\t\tconst key = `${order}${MEMO_SEPARATOR}${print}`;\n\t\t\tconst hit = cache.get(key);\n\t\t\tif (hit !== undefined) {\n\t\t\t\thits++;\n\t\t\t\treturn hit;\n\t\t\t}\n\t\t\tmisses++;\n\t\t\tconst built = buildPersonName(ctx, print, order);\n\t\t\tif (capacity > 0) {\n\t\t\t\t// INSERTION ORDER IS THE EVICTION ORDER: `Map`'s own iteration order,\n\t\t\t\t// so the policy needs no second structure.\n\t\t\t\tif (cache.size >= capacity) {\n\t\t\t\t\tconst oldest = cache.keys().next();\n\t\t\t\t\tif (!oldest.done) {\n\t\t\t\t\t\tcache.delete(oldest.value);\n\t\t\t\t\t\tevictions++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcache.set(key, built);\n\t\t\t}\n\t\t\treturn built;\n\t\t},\n\t\tfromIcao: (icao, print) => buildFromIcao(ctx, icao, print),\n\t\toptions,\n\t\tstats: () => ({ hits, misses, evictions, size: cache.size, capacity }),\n\t\tclear() {\n\t\t\tcache.clear();\n\t\t\thits = 0;\n\t\t\tmisses = 0;\n\t\t\tevictions = 0;\n\t\t},\n\t};\n}\n\nlet theDefault: CachingPersonNameFactory | undefined;\n\n/**\n * The shared caching factory over the committed `names.txt`, with default\n * options. Made on first call; the lexicon is parsed then, not at import.\n */\nexport function defaultPersonNameFactory(): CachingPersonNameFactory {\n\ttheDefault ??= createCachingPersonNameFactory();\n\treturn theDefault;\n}\n\n/** `defaultPersonNameFactory().parse(print, order)`. */\nexport function personName(print: string, order: NameOrder = \"unknown\"): PersonName {\n\treturn defaultPersonNameFactory().parse(print, order);\n}\n\n/** `defaultPersonNameFactory().fromIcao(icao, print)`. */\nexport function personNameFromIcao(icao: string, print?: string): PersonName {\n\treturn defaultPersonNameFactory().fromIcao(icao, print);\n}\n"
15
15
  ],
16
- "mappings": ";;;;;;;;;;;;;;;;;;AAmEO,IAAM,gBAAe;AAyErB,IAAM,mBAAwC,MAAM;AA8B3D,IAAM,cAAmC,IAAI,IAAI,CAAC,QAAQ,SAAS,SAAS,MAAM,KAAK,CAAC;AAyBjF,SAAS,yBAAwB,CAAC,GAAmB;AAAA,EAC3D,IAAI,OAAO;AAAA,EACX,UAAS;AAAA,IACR,MAAM,IAAI,wBAAwB,KAAK,IAAI;AAAA,IAC3C,IAAI,MAAM,QAAQ,CAAC,YAAY,IAAK,EAAE,GAAc,kBAAkB,CAAC;AAAA,MAAG;AAAA,IAC1E,OAAO,KAAK,MAAM,GAAG,EAAE,KAAK;AAAA,EAC7B;AAAA,EACA,OAAO;AAAA;AAgBR,IAAM,oBAAyC,IAAI,IAAI;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAGD,SAAS,IAAI,CAAC,GAAmB;AAAA,EAChC,OAAO,EAAE,QAAQ,SAAS,GAAG,EAAE,KAAK;AAAA;AAyBrC,IAAM,eACL;AAGD,SAAS,YAAY,CAAC,KAAqB;AAAA,EAC1C,QAAQ,IAAI,MAAM,SAAS,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE;AAAA;AAIhE,IAAM,OAAO;AAWb,SAAS,UAAU,CAClB,GACA,SACA,MACA,OACA,SACA,OACgB;AAAA,EAChB,MAAM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A,QAGjB,IAAI,MAAM,QAAQ,UAAU;AAAA,UAC3B,MAAM,SAAS,MAAM,KAAK,EAAE,KAAK;AAAA,UACjC,IAAI,CAAC,OAAO,MAAM;AAAA,YACjB,MAAM,OAAO,OAAO,KAAK;AAAA,YACzB;AAAA,UACD;AAAA,QACD;AAAA,QACA,MAAM,IAAI,KAAK,KAAK;AAAA,MACrB;AAAA,MACA,OAAO;AAAA;AAAA,IAER,UAAU,CAAC,MAAM,UAAU,cAAc,KAAK,MAAM,KAAK;AAAA,IACzD;AAAA,IACA,OAAO,OAAO,EAAE,MAAM,QAAQ,WAAW,MAAM,MAAM,MAAM,SAAS;AAAA,IACpE,KAAK,GAAG;AAAA,MACP,MAAM,MAAM;AAAA,MACZ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,YAAY;AAAA;AAAA,EAEd;AAAA;AAGD,IAAI;AAMG,SAAS,yBAAwB,GAA6B;AAAA,EACpE,eAAe,gCAA+B;AAAA,EAC9C,OAAO;AAAA;AAID,SAAS,WAAU,CAAC,OAAe,QAAmB,WAAuB;AAAA,EACnF,OAAO,0BAAyB,EAAE,MAAM,OAAO,KAAK;AAAA;AAI9C,SAAS,mBAAkB,CAAC,MAAc,OAA4B;AAAA,EAC5E,OAAO,0BAAyB,EAAE,SAAS,MAAM,KAAK;AAAA;",
17
+ "debugId": "6DB0BC302D69D65E64756E2164756E21",
18
18
  "names": []
19
19
  }
@@ -3,7 +3,7 @@ import {
3
3
  isAmbiguous2,
4
4
  isPlace2,
5
5
  isTradename2
6
- } from "./index-0qptxnwh.js";
6
+ } from "./index-7vvt5hhy.js";
7
7
 
8
8
  // src/lexicon/place.ts
9
9
  var JOINING_COMMA = /(?<=[^\s,]),(?=[^\s,])/g;
@@ -24,4 +24,4 @@ function isPlacePhrase(phrase, getFlags) {
24
24
  export { splitWords, FIELD_END, isPlaceWordFlags, isPlacePhrase };
25
25
 
26
26
  //# debugId=A9815F8EF12D8D4964756E2164756E21
27
- //# sourceMappingURL=index-2fsdvhaf.js.map
27
+ //# sourceMappingURL=index-kw6gbrnq.js.map
@@ -3,7 +3,13 @@ import {
3
3
  isGiven2,
4
4
  isAmbiguous2,
5
5
  Lexicon2
6
- } from "./index-0qptxnwh.js";
6
+ } from "./index-7vvt5hhy.js";
7
+ import {
8
+ isPlaceWordFlags
9
+ } from "./index-kw6gbrnq.js";
10
+ import {
11
+ doubleMetaphone2
12
+ } from "./index-ebebeamh.js";
7
13
  import {
8
14
  nameFold2,
9
15
  isPlaceholderPrint2,
@@ -13,10 +19,7 @@ import {
13
19
  commaReading2,
14
20
  levelOf2,
15
21
  defaultPersonNameFactory2
16
- } from "./index-fzzq5txh.js";
17
- import {
18
- isPlaceWordFlags
19
- } from "./index-2fsdvhaf.js";
22
+ } from "./index-jx97zxtz.js";
20
23
  import {
21
24
  isTeamPrint2
22
25
  } from "./index-0phgwy52.js";
@@ -969,6 +972,67 @@ function personList2(print, factory = defaultPersonNameFactory2()) {
969
972
  }
970
973
  return out;
971
974
  }
975
+ // src/normalize/block-keys.ts
976
+ function blockLetters(surname) {
977
+ return surname.toUpperCase().replace(/[^A-Z]/g, "");
978
+ }
979
+ function firstLetter(s) {
980
+ const m = s.match(/[A-Za-z]/);
981
+ return m ? m[0].toUpperCase() : null;
982
+ }
983
+ function surnameBlock2(surname) {
984
+ return blockLetters(surname) || null;
985
+ }
986
+ function initialsBlock2(given, surname) {
987
+ const first = firstLetter(given);
988
+ const last = firstLetter(blockLetters(surname));
989
+ return first && last ? first + last : null;
990
+ }
991
+ function metaphoneBlocks2(surname) {
992
+ const letters = blockLetters(surname);
993
+ if (!letters)
994
+ return [];
995
+ const [primary, secondary] = doubleMetaphone2(letters);
996
+ if (!primary)
997
+ return [];
998
+ return secondary && secondary !== primary ? [primary, secondary] : [primary];
999
+ }
1000
+ // src/normalize/name-columns.ts
1001
+ var NAME_LEVEL_COLUMNS2 = [
1002
+ "nn0",
1003
+ "nn1",
1004
+ "nn2",
1005
+ "nn3",
1006
+ "nn4"
1007
+ ];
1008
+ var NAME_COLUMNS2 = [
1009
+ ...NAME_LEVEL_COLUMNS2,
1010
+ "surname_key",
1011
+ "given_key",
1012
+ "blk_surname",
1013
+ "blk_initials",
1014
+ "blk_metaphone",
1015
+ "blk_metaphone_alt"
1016
+ ];
1017
+ function nameColumns2(name) {
1018
+ const person = name.isPerson();
1019
+ const level = (dop) => person ? name[dop] : null;
1020
+ const surname = person ? name.surnameKey() : "";
1021
+ const [metaphone, metaphoneAlt] = metaphoneBlocks2(surname);
1022
+ return {
1023
+ nn0: level("nn0"),
1024
+ nn1: level("nn1"),
1025
+ nn2: level("nn2"),
1026
+ nn3: level("nn3"),
1027
+ nn4: level("nn4"),
1028
+ surname_key: surname || null,
1029
+ given_key: person && name.givenName() || null,
1030
+ blk_surname: surnameBlock2(surname),
1031
+ blk_initials: person ? initialsBlock2(name.givenFields()[0] ?? "", surname) : null,
1032
+ blk_metaphone: metaphone ?? null,
1033
+ blk_metaphone_alt: metaphoneAlt ?? null
1034
+ };
1035
+ }
972
1036
  // src/normalize/name-format.ts
973
1037
  var NAME_FORMATS2 = ["First Last", "Last, First", "Last First"];
974
1038
  function nameFormatOrder2(verdict) {
@@ -1356,7 +1420,7 @@ function deriveNameFormat2(prints, options = {}) {
1356
1420
  return first;
1357
1421
  return scoreReadings(cells.map((c) => readNameCell2(c, { ...options, placeColumn: true })), NAME_FORMAT_MODEL, threshold, schoolRead);
1358
1422
  }
1359
- export { repairMojibake2, sameGivenFamily2, comparePosition2, nameRelation2, nameCompare2, probablySame2, createNameSet2, createNameMap2, createNameClusters2, MAX_READINGS2, surnameParts2, printAttestsOrder2, nameReadings2, meetReading2, refinesReading2, sameReading2, chooseReadingPair2, composeReadings2, composeNames2, meetReadings2, nameMeet2, showReading2, blockKeysOfReadings2, nameBlockKeys2, namesFeasible2, INFEASIBLE_CLASSES2, editDistance2, nearSpelling2, compoundGiven2, middleForm2, infeasibleClass2, isListJoiner2, personList2, NAME_FORMATS2, nameFormatOrder2, ORDER_READINGS2, readNameCell2, DEFAULT_NAME_FORMAT_THRESHOLD2, deriveNameFormat2 };
1423
+ export { repairMojibake2, sameGivenFamily2, comparePosition2, nameRelation2, nameCompare2, probablySame2, createNameSet2, createNameMap2, createNameClusters2, MAX_READINGS2, surnameParts2, printAttestsOrder2, nameReadings2, meetReading2, refinesReading2, sameReading2, chooseReadingPair2, composeReadings2, composeNames2, meetReadings2, nameMeet2, showReading2, blockKeysOfReadings2, nameBlockKeys2, namesFeasible2, INFEASIBLE_CLASSES2, editDistance2, nearSpelling2, compoundGiven2, middleForm2, infeasibleClass2, isListJoiner2, personList2, surnameBlock2, initialsBlock2, metaphoneBlocks2, NAME_LEVEL_COLUMNS2, NAME_COLUMNS2, nameColumns2, NAME_FORMATS2, nameFormatOrder2, ORDER_READINGS2, readNameCell2, DEFAULT_NAME_FORMAT_THRESHOLD2, deriveNameFormat2 };
1360
1424
 
1361
- //# debugId=A94FC7266AE0EB2964756E2164756E21
1362
- //# sourceMappingURL=index-knrkej0f.js.map
1425
+ //# debugId=A39684B9543A024164756E2164756E21
1426
+ //# sourceMappingURL=index-n4t288kj.js.map