@finbheara/names 0.15.0 → 0.17.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 (42) hide show
  1. package/README.md +45 -6
  2. package/dist/chunks/{index-7vvt5hhy.js → index-0wpvbdgh.js} +2631 -1395
  3. package/dist/chunks/{index-7vvt5hhy.js.map → index-0wpvbdgh.js.map} +4 -4
  4. package/dist/chunks/{index-pncn9y2r.js → index-a6f2y4aa.js} +2 -2
  5. package/dist/chunks/{index-2565cn5x.js → index-ky754nsf.js} +3 -3
  6. package/dist/chunks/{index-kw69ry3j.js → index-n6fpj92s.js} +11 -367
  7. package/dist/chunks/{index-kw69ry3j.js.map → index-n6fpj92s.js.map} +4 -5
  8. package/dist/chunks/index-qmn87bdh.js +1697 -0
  9. package/dist/chunks/index-qmn87bdh.js.map +11 -0
  10. package/dist/chunks/{index-ka8nzreg.js → index-tk01chxw.js} +2 -2
  11. package/dist/chunks/{index-kw6gbrnq.js → index-tqdbxd92.js} +2 -2
  12. package/dist/chunks/{index-a15g2gp6.js → index-ye6j60jn.js} +3 -3
  13. package/dist/chunks/phrase-2hj26asc.js +11 -0
  14. package/dist/classifier/index.js +3 -3
  15. package/dist/cli/bin.js +109 -0
  16. package/dist/cli/bin.js.map +11 -0
  17. package/dist/cli/census.js +4 -4
  18. package/dist/index.js +18 -10
  19. package/dist/index.js.map +1 -1
  20. package/dist/lexicon/index.js +4 -2
  21. package/dist/lexicon/index.js.map +1 -1
  22. package/dist/measure/index.js +4 -4
  23. package/dist/normalize/index.js +13 -7
  24. package/dist/normalize/index.js.map +1 -1
  25. package/dist/types/cli/bin.d.ts +10 -0
  26. package/dist/types/cli/tables.d.ts +13 -0
  27. package/dist/types/lexicon/flags.d.ts +13 -5
  28. package/dist/types/normalize/given-diminutives.d.ts +15 -6
  29. package/dist/types/normalize/given-families.d.ts +53 -0
  30. package/dist/types/normalize/index.d.ts +1 -0
  31. package/dist/types/normalize/name-kinship.d.ts +12 -8
  32. package/docs/NAME-NORMALIZATION.md +36 -7
  33. package/names.txt +2624 -1389
  34. package/package.json +4 -2
  35. package/src/normalize/given-families.MANIFEST.json +46 -0
  36. package/dist/chunks/phrase-2nmvkrc5.js +0 -11
  37. /package/dist/chunks/{index-pncn9y2r.js.map → index-a6f2y4aa.js.map} +0 -0
  38. /package/dist/chunks/{index-2565cn5x.js.map → index-ky754nsf.js.map} +0 -0
  39. /package/dist/chunks/{index-ka8nzreg.js.map → index-tk01chxw.js.map} +0 -0
  40. /package/dist/chunks/{index-kw6gbrnq.js.map → index-tqdbxd92.js.map} +0 -0
  41. /package/dist/chunks/{index-a15g2gp6.js.map → index-ye6j60jn.js.map} +0 -0
  42. /package/dist/chunks/{phrase-2nmvkrc5.js.map → phrase-2hj26asc.js.map} +0 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/normalize/given-diminutives.ts", "../src/normalize/given-families.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * given-diminutives.ts — ONE GIVEN-NAME DIMINUTIVE TABLE, read by the TypeScript side.\n *\n * `./given-diminutives.json` is the table and this file is its reader. A consumer in another\n * language reads the table as `names tables given-name` prints it (`../cli/tables.ts`), never\n * this file, so the file's layout may change and no second copy exists. An earlier\n * adjudicator carried a `FAMILIAR` map of eight entries and said *\"the name primitives are\n * where it belongs once a second consumer wants one\"*; the teachers-directory gate is that\n * second consumer, and the eight entries are in the table.\n *\n * A RELATION OF A PAIR AND NEVER A KEY. Nothing here rewrites a given name: a stored key,\n * a filing key and every rendering keep the print's own spelling. A caller asks whether\n * TWO given names are one family, at the moment it compares them, and nowhere else, so the\n * root never leaves this module: `sameGivenFamily` and `givenFamilyTable` answer about a\n * pair and neither returns a root, for that reason.\n *\n * SPELLINGS, FAMILIES AND THE GATE. Two different given names are related in one of three\n * ways, and the answer says which:\n *\n * - `given-variant`: two spellings of one name (`Connor` / `Conor`, `Sara` / `Sarah`). A\n * spelling is not a familiar form, so `variants` is its own table, and a gate admits it.\n * - `given-family`: after each spelling is read as its canonical, the two share a ROOT of\n * `families` (`Tom` / `Thomas`, `Kate` / `Katherine`), and a gate admits it.\n * - `given-family-not-gate`: they share a root, but only through a `notAtGate` form: a name in\n * its own right (`Megan`, `Grace`), a translation (`Sean`, `Padraig`), another gender's\n * name (`Michelle`, `Sam`) or a form of more than one root (`Ellie`, `Evie`). The lane\n * reads it as evidence below an exact match; a gate refuses it.\n *\n * EVERY ROOT, NEVER THE FIRST. A form under several roots meets each of them (`Evie` is\n * Evelyn's, Genevieve's, Eve's and Eva's), and every such form is `notAtGate`, because the\n * form alone cannot say which root its bearer carries. Sharing a root is not transitive:\n * `Eve` and `Eva` share none, though `Evie` meets both. A `notAtGate` form is refused AS A\n * FORM: where it is the root itself (`Caitlin` / `Cait`), its own forms meet it at a gate.\n */\n\nimport table from \"./given-diminutives.json\";\n\ninterface Table {\n\tvariants: Record<string, readonly string[]>;\n\tfamilies: Record<string, readonly string[]>;\n\tnotAtGate: readonly string[];\n}\n\nconst TABLE = table as unknown as Table;\n\n/**\n * The table as this module reads it, for `names tables given-name`, which prints it. Not a\n * package export: the printed form is the contract, and this file's layout may change.\n */\nexport function givenDiminutiveTable(): {\n\treadonly variants: Readonly<Record<string, readonly string[]>>;\n\treadonly families: Readonly<Record<string, readonly string[]>>;\n\treadonly notAtGate: readonly string[];\n} {\n\treturn TABLE;\n}\n\n/** spelling -> its canonical spelling; a canonical maps to itself only by absence. */\nconst CANONICAL: ReadonlyMap<string, string> = (() => {\n\tconst out = new Map<string, string>();\n\tfor (const [canonical, spellings] of Object.entries(TABLE.variants))\n\t\tfor (const s of spellings) out.set(s, canonical);\n\treturn out;\n})();\n\n/** canonical name -> every root it belongs to: itself when it is a root, and each root it is a form of. */\nconst ROOTS: ReadonlyMap<string, ReadonlySet<string>> = (() => {\n\tconst out = new Map<string, Set<string>>();\n\tconst add = (form: string, root: string) => {\n\t\tlet roots = out.get(form);\n\t\tif (roots === undefined) out.set(form, (roots = new Set()));\n\t\troots.add(root);\n\t};\n\tfor (const [root, forms] of Object.entries(TABLE.families)) {\n\t\tadd(root, root);\n\t\tfor (const f of forms) add(f, root);\n\t}\n\treturn out;\n})();\n\nconst NOT_AT_GATE: ReadonlySet<string> = new Set(TABLE.notAtGate);\n\nconst canonical = (name: string): string => CANONICAL.get(name) ?? name;\n\n/** May `name` (canonical) meet the other side of a pair through `root` at a gate? */\nconst gateThrough = (name: string, root: string): boolean =>\n\tname === root || !NOT_AT_GATE.has(name);\n\n/**\n * Do two DIFFERENT given names (NN3, letters only) stand for one another at a gate?\n *\n * True exactly when `givenFamilyTable` relates them by a gate-safe answer: two spellings of\n * one name, or one family through no `notAtGate` form. Two equal names answer `false`:\n * equality is the caller's own test and this is the tolerance past it, so a caller can tell\n * which one admitted a pair.\n */\nexport function sameGivenFamily(a: string, b: string): boolean {\n\tconst via = givenFamilyTable(a, b);\n\treturn via === \"given-variant\" || via === \"given-family\";\n}\n\n/**\n * What the table says about two DIFFERENT given names (NN3, letters only), as a kinship\n * `via`: `given-variant` for two spellings of one name, `given-family` where the two share a\n * root and a gate admits the pair, `given-family-not-gate` where every root they share is\n * reached through a `notAtGate` form, and `null` where the table does not relate them. Two\n * equal names answer `null`, for `sameGivenFamily`'s reason.\n *\n * THE DEFAULT GIVEN-NAME PROVIDER of `createNameKinship` (`./name-kinship.ts`).\n * `sameGivenFamily` is defined as its gate-safe answers, so the gate and the tolerant relation\n * cannot disagree about a pair.\n */\nexport function givenFamilyTable(\n\ta: string,\n\tb: string,\n): \"given-variant\" | \"given-family\" | \"given-family-not-gate\" | null {\n\tif (a === b) return null;\n\tconst ca = canonical(a);\n\tconst cb = canonical(b);\n\tif (ca === cb) return \"given-variant\";\n\tconst ra = ROOTS.get(ca);\n\tconst rb = ROOTS.get(cb);\n\tif (ra === undefined || rb === undefined) return null;\n\tlet shared = false;\n\tfor (const root of ra) {\n\t\tif (!rb.has(root)) continue;\n\t\tif (gateThrough(ca, root) && gateThrough(cb, root)) return \"given-family\";\n\t\tshared = true;\n\t}\n\treturn shared ? \"given-family-not-gate\" : null;\n}\n",
6
+ "/**\n * given-families.ts — THE EXTENDED GIVEN-NAME FAMILY LIST, read by the TypeScript side.\n *\n * `./given-families.json` is the list and this file is its reader; `scripts/given-families.ts`\n * builds the list and `./given-families.MANIFEST.json` records its sources.\n *\n * TWO TIERS OF GIVEN-NAME KNOWLEDGE. `./given-diminutives.json` is the GATE tier: pairs this\n * package is sure of, curated by hand, some of them admitted at an identity gate. This list\n * is the EXTENDED tier: every family the sources record for English, Irish, Scottish, Welsh,\n * French, Italian, Spanish, German, Dutch and Polish usage, about 2,600 names. A pair it\n * relates MAY be one name, and the answer is `given-maybe`, which no gate admits.\n *\n * AN EXACT LIST, NOT A FILTER. A bloom filter of the same pairs at 8 KB answers about fifty\n * false partners for every given name it is asked about; the exact list is a few KB more\n * and answers none.\n *\n * A FAMILY IS CLOSED. Two names relate when they are a root and its form, or two forms of\n * one root (`Kate` / `Katie`, both Catherine's). A form under several roots meets each\n * root's family, and nothing is transitive across families: `Kit` meets Catherine's and\n * Christopher's, and `Kate` / `Chris` stay apart.\n *\n * A TIER BOUNDS HOW RARE A FORM MAY BE. Each form carries 1 (common), 2 (uncommon) or 3\n * (rare); a pair's tier is its rarer member's, the root counting as 1, and where two names\n * share several families the commonest counts. `maxTier` admits pairs up to that tier.\n */\n\nimport list from \"./given-families.json\";\n\n/** How common a form is: 1 common, 2 uncommon, 3 rare. */\nexport type GivenFamilyTier = 1 | 2 | 3;\n\nexport interface GivenFamilyListOptions {\n\t/** The rarest tier admitted. Default 3: every pair the list holds. */\n\treadonly maxTier?: GivenFamilyTier;\n\t/**\n\t * The families, one `ROOT,FORM:TIER,…` line each, NN3 upper case. Default: the shipped\n\t * `given-families.json`. A caller with its own list passes it here.\n\t */\n\treadonly families?: readonly string[];\n}\n\n/** A given-name provider over the extended list: `given-maybe` or `null`. */\nexport type GivenFamilyList = (a: string, b: string) => \"given-maybe\" | null;\n\n/** name -> root -> the name's tier in that root's family (a root's own is 1) */\ntype Memberships = ReadonlyMap<string, ReadonlyMap<string, number>>;\n\n/**\n * The lines, read. A malformed line throws: the list is data this package ships or a caller\n * supplies, and a line read wrong would relate names silently.\n */\nfunction parseFamilies(lines: readonly string[]): Memberships {\n\tconst out = new Map<string, Map<string, number>>();\n\tconst join = (name: string, root: string, tier: number) => {\n\t\tlet roots = out.get(name);\n\t\tif (roots === undefined) out.set(name, (roots = new Map()));\n\t\troots.set(root, Math.min(roots.get(root) ?? tier, tier));\n\t};\n\tfor (const line of lines) {\n\t\tconst [root, ...forms] = line.split(\",\");\n\t\tif (root === undefined || !/^[A-Z]+$/.test(root))\n\t\t\tthrow new Error(`given-families: bad root in \"${line}\"`);\n\t\tjoin(root, root, 1);\n\t\tfor (const entry of forms) {\n\t\t\tconst m = /^([A-Z]+):([123])$/.exec(entry);\n\t\t\tif (m === null) throw new Error(`given-families: bad form \"${entry}\" in \"${line}\"`);\n\t\t\tjoin(m[1] as string, root, Number(m[2]));\n\t\t}\n\t}\n\treturn out;\n}\n\n/**\n * The extended list as a `GivenProvider` for `createNameKinship`: `given-maybe` where two\n * DIFFERENT names (NN3) share a family within `maxTier`, `null` otherwise. Two equal names\n * answer `null`, as `givenFamilyTable`'s do.\n *\n * The list is parsed on the first question, once per provider.\n */\nexport function createGivenFamilyList(options: GivenFamilyListOptions = {}): GivenFamilyList {\n\tconst maxTier = options.maxTier ?? 3;\n\tconst lines = options.families ?? (list as { families: readonly string[] }).families;\n\tlet members: Memberships | undefined;\n\treturn (a, b) => {\n\t\tif (a === b) return null;\n\t\tmembers ??= parseFamilies(lines);\n\t\tconst ra = members.get(a);\n\t\tconst rb = members.get(b);\n\t\tif (ra === undefined || rb === undefined) return null;\n\t\tfor (const [root, ta] of ra) {\n\t\t\tconst tb = rb.get(root);\n\t\t\tif (tb !== undefined && Math.max(ta, tb) <= maxTier) return \"given-maybe\";\n\t\t}\n\t\treturn null;\n\t};\n}\n\n/**\n * The shipped list as root -> form -> tier, roots and forms sorted, for `names tables\n * given-name`, which prints it. Not a package export: the printed form is the contract.\n */\nexport function givenFamilyTiers(): Record<string, Record<string, GivenFamilyTier>> {\n\tconst byRoot = new Map<string, Map<string, GivenFamilyTier>>();\n\tfor (const [name, roots] of parseFamilies((list as { families: readonly string[] }).families))\n\t\tfor (const [root, tier] of roots) {\n\t\t\tif (name === root) continue;\n\t\t\tlet forms = byRoot.get(root);\n\t\t\tif (forms === undefined) byRoot.set(root, (forms = new Map()));\n\t\t\tforms.set(name, tier as GivenFamilyTier);\n\t\t}\n\tconst out: Record<string, Record<string, GivenFamilyTier>> = {};\n\tfor (const root of [...byRoot.keys()].sort())\n\t\tout[root] = Object.fromEntries([...byRoot.get(root)!].sort(([a], [b]) => (a < b ? -1 : 1)));\n\treturn out;\n}\n\n/** The shipped list, every tier: the second given-name provider of `nameKinship`. */\nexport const givenFamilyList: GivenFamilyList = createGivenFamilyList();\n"
7
+ ],
8
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,IAAM,QAAQ;AAMP,SAAS,oBAAoB,GAIlC;AAAA,EACD,OAAO;AAAA;AAIR,IAAM,aAA0C,MAAM;AAAA,EACrD,MAAM,MAAM,IAAI;AAAA,EAChB,YA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sB;",
9
+ "debugId": "0A72D6F5743D283A64756E2164756E21",
10
+ "names": []
11
+ }
@@ -3,7 +3,7 @@ import {
3
3
  normalizeApostrophes2,
4
4
  lexiconKey2,
5
5
  Lexicon2
6
- } from "./index-7vvt5hhy.js";
6
+ } from "./index-0wpvbdgh.js";
7
7
  import {
8
8
  canonicalTeamName2,
9
9
  isTeamPrint2
@@ -1130,4 +1130,4 @@ function personNameFromIcao2(icao, print) {
1130
1130
  export { NAME_REFUSED2, stripEveryAside2, stripTrailingCredentials2, scrubNameDetail2, scrubName2, foldNameKey2, nameFold2, PLATFORM_PLACEHOLDERS2, NAME_PLACEHOLDERS2, placeholderOf2, isPlaceholderPrint2, isNoNamePrint2, COMPOUND_SURNAMES2, isCompoundSurname2, spaceAfterComma2, isNameSuffix, tokenize, inferNameOrder2, commaReading2, lexiconNameOrder, resolveNameOrder2, splitPersonName2, classifyCell2, capitalise2, nameCase2, SURNAME_SEPARATOR2, GIVEN_SEPARATOR2, titleCaseNamePart2, spellingLookup2, parsePersonName2, formatPersonDisplay2, personDisplayName2, NAME_TRADITIONS2, traditionFromIndex2, isIcaoName2, levelOf2, givenKeyAbbreviates2, givenAbbreviates2, PersonName2, DEFAULT_PERSON_NAME_CAPACITY2, traditionLookupOf2, createPersonNameFactory2, createCachingPersonNameFactory2, defaultPersonNameFactory2, personName2, personNameFromIcao2 };
1131
1131
 
1132
1132
  //# debugId=2B32B66D0F08008A64756E2164756E21
1133
- //# sourceMappingURL=index-ka8nzreg.js.map
1133
+ //# sourceMappingURL=index-tk01chxw.js.map
@@ -3,7 +3,7 @@ import {
3
3
  isAmbiguous2,
4
4
  isPlace2,
5
5
  isTradename2
6
- } from "./index-7vvt5hhy.js";
6
+ } from "./index-0wpvbdgh.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-kw6gbrnq.js.map
27
+ //# sourceMappingURL=index-tqdbxd92.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  lookupKey2,
3
3
  Lexicon2
4
- } from "./index-7vvt5hhy.js";
4
+ } from "./index-0wpvbdgh.js";
5
5
  import {
6
6
  lexiconNameOrder,
7
7
  defaultPersonNameFactory2
8
- } from "./index-ka8nzreg.js";
8
+ } from "./index-tk01chxw.js";
9
9
  import {
10
10
  isNameParticle2
11
11
  } from "./index-23rzmwe2.js";
@@ -134,4 +134,4 @@ function createNameCensus2(options = {}) {
134
134
  export { createNameCensus2 };
135
135
 
136
136
  //# debugId=42B6EBFD51EC241764756E2164756E21
137
- //# sourceMappingURL=index-a15g2gp6.js.map
137
+ //# sourceMappingURL=index-ye6j60jn.js.map
@@ -0,0 +1,11 @@
1
+ import {
2
+ phraseClassifier2
3
+ } from "./index-ky754nsf.js";
4
+ import"./index-tqdbxd92.js";
5
+ import"./index-0wpvbdgh.js";
6
+ export {
7
+ phraseClassifier2 as phraseClassifier
8
+ };
9
+
10
+ //# debugId=BD8F5B3E6DE1DCF664756E2164756E21
11
+ //# sourceMappingURL=phrase-2hj26asc.js.map
@@ -6,9 +6,9 @@ import {
6
6
  createSegmenter2,
7
7
  createClassifier2,
8
8
  phraseClassifier2
9
- } from "../chunks/index-2565cn5x.js";
10
- import"../chunks/index-kw6gbrnq.js";
11
- import"../chunks/index-7vvt5hhy.js";
9
+ } from "../chunks/index-ky754nsf.js";
10
+ import"../chunks/index-tqdbxd92.js";
11
+ import"../chunks/index-0wpvbdgh.js";
12
12
  export {
13
13
  CONNECTORS2 as CONNECTORS,
14
14
  SCHOOL_KEYWORDS2 as SCHOOL_KEYWORDS,
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ givenDiminutiveTable,
4
+ givenFamilyTiers
5
+ } from "../chunks/index-qmn87bdh.js";
6
+
7
+ // src/cli/tables.ts
8
+ var TABLES = {
9
+ "given-name": { "1": givenNameV1 }
10
+ };
11
+ var OUTPUTS = ["json"];
12
+ function givenNameV1() {
13
+ const gate = givenDiminutiveTable();
14
+ return {
15
+ $comment: [
16
+ "@finbheara/names given-name tables, schema 1. Every name is NN3: upper case, letters only.",
17
+ "`variants`: canonical -> its other spellings. Read each name as its canonical spelling first;",
18
+ "two names with one canonical are `given-variant`. `families` and `notAtGate` hold canonical",
19
+ "spellings only.",
20
+ "`families`: root -> its familiar forms, the curated gate tier. A root belongs to its own family.",
21
+ "A form may sit under several roots and meets EVERY one of them; nothing is transitive, so two",
22
+ "names relate only when they share a root. They are `given-family` when, for some shared root,",
23
+ "neither name is a `notAtGate` form of it (a name that IS the root always passes), else",
24
+ "`given-family-not-gate`, which an identity gate must refuse.",
25
+ "`extended`: root -> form -> tier (1 common, 2 uncommon, 3 rare), the extended list. Two names",
26
+ "relate when they share a root; the pair's tier is its rarer member's, the root counting as 1.",
27
+ "Every pair here is `given-maybe`: a lead, never a gate. It is asked after `families`.",
28
+ "Two equal names are none of these: equality is the caller's own test."
29
+ ],
30
+ table: "given-name",
31
+ schema: 1,
32
+ variants: gate.variants,
33
+ families: gate.families,
34
+ notAtGate: gate.notAtGate,
35
+ extended: givenFamilyTiers()
36
+ };
37
+ }
38
+ var USAGE = [
39
+ "usage: names tables <table> [--output json] [--schema N]",
40
+ `tables: ${Object.entries(TABLES).map(([t, v]) => `${t} (schemas ${Object.keys(v).join(", ")})`).join("; ")}`,
41
+ "defaults: --output json --schema 1"
42
+ ].join(`
43
+ `);
44
+ function tables(argv) {
45
+ const options = { output: "json", schema: "1" };
46
+ const positional = [];
47
+ for (let i = 0;i < argv.length; i++) {
48
+ const a = argv[i];
49
+ if (a === "--help" || a === "-h") {
50
+ console.log(USAGE);
51
+ return 0;
52
+ }
53
+ const m = /^--([a-z]+)(?:=(.*))?$/.exec(a);
54
+ if (m === null) {
55
+ positional.push(a);
56
+ continue;
57
+ }
58
+ const [, key, inline] = m;
59
+ if (!(key in options))
60
+ return fail(`unknown option --${key}`);
61
+ const value = inline ?? argv[++i];
62
+ if (value === undefined)
63
+ return fail(`--${key} needs a value`);
64
+ options[key] = value;
65
+ }
66
+ if (positional.length !== 1)
67
+ return fail("name one table");
68
+ const schemas = TABLES[positional[0]];
69
+ if (schemas === undefined)
70
+ return fail(`unknown table "${positional[0]}"`);
71
+ const print = schemas[options.schema];
72
+ if (print === undefined)
73
+ return fail(`${positional[0]} has no schema ${options.schema}`);
74
+ if (!OUTPUTS.includes(options.output))
75
+ return fail(`unknown output "${options.output}"`);
76
+ console.log(JSON.stringify(print(), null, "\t"));
77
+ return 0;
78
+ }
79
+ function fail(message) {
80
+ console.error(`names tables: ${message}
81
+ ${USAGE}`);
82
+ return 2;
83
+ }
84
+
85
+ // src/cli/bin.ts
86
+ var COMMANDS = { tables };
87
+ var USAGE2 = "usage: names tables <table> [--output json] [--schema N]";
88
+ function main(argv) {
89
+ const [command, ...rest] = argv;
90
+ if (command === "--help" || command === "-h") {
91
+ console.log(USAGE2);
92
+ return 0;
93
+ }
94
+ if (command === undefined) {
95
+ console.error(USAGE2);
96
+ return 2;
97
+ }
98
+ const run = COMMANDS[command];
99
+ if (run === undefined) {
100
+ console.error(`names: unknown command "${command}"
101
+ ${USAGE2}`);
102
+ return 2;
103
+ }
104
+ return run(rest);
105
+ }
106
+ process.exitCode = main(process.argv.slice(2));
107
+
108
+ //# debugId=E2CE232D305113AE64756E2164756E21
109
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/cli/tables.ts", "../src/cli/bin.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * tables.ts — the package's data tables, printed for a consumer in any language.\n *\n * names tables given-name [--output json] [--schema 1] > given-name-tables.json\n *\n * THE PRINTED FORM IS THE CONTRACT, not the files the tables are stored in. Each table has\n * numbered schemas; a schema, once released, prints the same shape for as long as the\n * package offers it, and a new shape is a new schema. `--schema` defaults to 1 and\n * `--output` to `json`, so a command written against the first release keeps working.\n * (`--schema`, not `--version`: the number is the output's shape, not the package's.)\n */\n\nimport { givenDiminutiveTable } from \"../normalize/given-diminutives.ts\";\nimport { givenFamilyTiers } from \"../normalize/given-families.ts\";\n\n/** table -> schema -> its printed value */\nconst TABLES: Record<string, Record<string, () => unknown>> = {\n\t\"given-name\": { \"1\": givenNameV1 },\n};\n\nconst OUTPUTS = [\"json\"];\n\n/**\n * `given-name` schema 1: the curated gate table and the extended family list, with the\n * rules a reader needs to answer as `givenFamilyTable` and `givenFamilyList` do.\n */\nfunction givenNameV1() {\n\tconst gate = givenDiminutiveTable();\n\treturn {\n\t\t$comment: [\n\t\t\t\"@finbheara/names given-name tables, schema 1. Every name is NN3: upper case, letters only.\",\n\t\t\t\"`variants`: canonical -> its other spellings. Read each name as its canonical spelling first;\",\n\t\t\t\"two names with one canonical are `given-variant`. `families` and `notAtGate` hold canonical\",\n\t\t\t\"spellings only.\",\n\t\t\t\"`families`: root -> its familiar forms, the curated gate tier. A root belongs to its own family.\",\n\t\t\t\"A form may sit under several roots and meets EVERY one of them; nothing is transitive, so two\",\n\t\t\t\"names relate only when they share a root. They are `given-family` when, for some shared root,\",\n\t\t\t\"neither name is a `notAtGate` form of it (a name that IS the root always passes), else\",\n\t\t\t\"`given-family-not-gate`, which an identity gate must refuse.\",\n\t\t\t\"`extended`: root -> form -> tier (1 common, 2 uncommon, 3 rare), the extended list. Two names\",\n\t\t\t\"relate when they share a root; the pair's tier is its rarer member's, the root counting as 1.\",\n\t\t\t\"Every pair here is `given-maybe`: a lead, never a gate. It is asked after `families`.\",\n\t\t\t\"Two equal names are none of these: equality is the caller's own test.\",\n\t\t],\n\t\ttable: \"given-name\",\n\t\tschema: 1,\n\t\tvariants: gate.variants,\n\t\tfamilies: gate.families,\n\t\tnotAtGate: gate.notAtGate,\n\t\textended: givenFamilyTiers(),\n\t};\n}\n\nconst USAGE = [\n\t\"usage: names tables <table> [--output json] [--schema N]\",\n\t`tables: ${Object.entries(TABLES)\n\t\t.map(([t, v]) => `${t} (schemas ${Object.keys(v).join(\", \")})`)\n\t\t.join(\"; \")}`,\n\t\"defaults: --output json --schema 1\",\n].join(\"\\n\");\n\n/** `names tables …`: prints one table to stdout. Returns the exit code. */\nexport function tables(argv: readonly string[]): number {\n\tconst options: Record<string, string> = { output: \"json\", schema: \"1\" };\n\tconst positional: string[] = [];\n\tfor (let i = 0; i < argv.length; i++) {\n\t\tconst a = argv[i]!;\n\t\tif (a === \"--help\" || a === \"-h\") {\n\t\t\tconsole.log(USAGE);\n\t\t\treturn 0;\n\t\t}\n\t\tconst m = /^--([a-z]+)(?:=(.*))?$/.exec(a);\n\t\tif (m === null) {\n\t\t\tpositional.push(a);\n\t\t\tcontinue;\n\t\t}\n\t\tconst [, key, inline] = m as unknown as [string, string, string | undefined];\n\t\tif (!(key in options)) return fail(`unknown option --${key}`);\n\t\tconst value = inline ?? argv[++i];\n\t\tif (value === undefined) return fail(`--${key} needs a value`);\n\t\toptions[key] = value;\n\t}\n\tif (positional.length !== 1) return fail(\"name one table\");\n\tconst schemas = TABLES[positional[0]!];\n\tif (schemas === undefined) return fail(`unknown table \"${positional[0]}\"`);\n\tconst print = schemas[options.schema!];\n\tif (print === undefined) return fail(`${positional[0]} has no schema ${options.schema}`);\n\tif (!OUTPUTS.includes(options.output!)) return fail(`unknown output \"${options.output}\"`);\n\tconsole.log(JSON.stringify(print(), null, \"\\t\"));\n\treturn 0;\n}\n\nfunction fail(message: string): number {\n\tconsole.error(`names tables: ${message}\\n${USAGE}`);\n\treturn 2;\n}\n",
6
+ "#!/usr/bin/env node\n/**\n * names — the package's command, run as `npx @finbheara/names …` or `bunx @finbheara/names …`.\n *\n * names tables <table> [--output json] [--schema N] print a data table\n *\n * Runs under Node or Bun. (`bun run names` in this repository is the lexicon curation CLI,\n * `./names.ts`, which is not shipped.)\n */\n\nimport { tables } from \"./tables.ts\";\n\nconst COMMANDS: Record<string, (argv: readonly string[]) => number> = { tables };\n\nconst USAGE = \"usage: names tables <table> [--output json] [--schema N]\";\n\nfunction main(argv: readonly string[]): number {\n\tconst [command, ...rest] = argv;\n\tif (command === \"--help\" || command === \"-h\") {\n\t\tconsole.log(USAGE);\n\t\treturn 0;\n\t}\n\tif (command === undefined) {\n\t\tconsole.error(USAGE);\n\t\treturn 2;\n\t}\n\tconst run = COMMANDS[command];\n\tif (run === undefined) {\n\t\tconsole.error(`names: unknown command \"${command}\"\\n${USAGE}`);\n\t\treturn 2;\n\t}\n\treturn run(rest);\n}\n\n// Run unconditionally: this module is only ever the entry (a `.bin` symlink makes an\n// `import.meta.url === argv[1]` test unreliable).\nprocess.exitCode = main(process.argv.slice(2));\n"
7
+ ],
8
+ "mappings": ";;;;;;;AAgBA,IAAM,SAAwD;AAAA,EAC7D,cAAc,EAAE,KAAK,YAAY;AAClC;AAEA,IAAM,UAAU,CAAC,MAAM;AAMvB,SAAS,WAAW,GAAG;AAAA,EACtB,MAAM,OAAO,qBAAqB;AAAA,EAClC,OAAO;AAAA,IACN,UAAU;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAAA,IACA,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,UAAU,KAAK;AAAA,IACf,UAAU,KAAK;AAAA,IACf,WAAW,KAAK;AAAA,IAChB,UAAU,iBAAiB;AAAA,EAC5B;AAAA;AAGD,IAAM,QAAQ;AAAA,EACb;AAAA,EACA,WAAW,OAAO,QAAQ,MAAM,EAC9B,IAAI,EAAE,GAAG,OAAO,GAAG,cAAc,OAAO,KAAK,CAAC,EAAE,KAAK,IAAI,IAAI,EAC7D,KAAK,IAAI;AAAA,EACX;AACD,EAAE,KAAK;AAAA,CAAI;AAGJ,SAAS,MA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EAClD,OAAO;AAAA;;;AClFR,IAAM,WAAgE,EAAE,OAAO;AAE/E,IAAM,SAAQ;AAEd,SAAS,IAAI,CAAC,MAAiC;AAAA,EAC9C,OAAO,YAAY,QAAQ;AAAA,EAC3B,IAAI,YAAY,YAAY,YAAY,MAAM;AAAA,IAC7C,QAAQ,IAAI,MAAK;AAAA,IACjB,OAAO;AAAA,EACR;AAAA,EACA,IAAI,YAAY,WAAW;AAAA,IAC1B,QAAQ,MAAM,MAAK;AAAA,IACnB,OAAO;AAAA,EACR;AAAA,EACA,MAAM,MAAM,SAAS;AAAA,EACrB,IAAI,QAAQ,WAAW;AAAA,IACtB,QAAQ,MAAM,2BAA2B;AAAA,EAAa,QAAO;AAAA,IAC7D,OAAO;AAAA,EACR;AAAA,EACA,OAAO,IAAI,IAAI;AAAA;AAKhB,QAAQ,WAAW,KAAK,QAAQ,KAAK,MAAM,CAAC,CAAC;",
9
+ "debugId": "E2CE232D305113AE64756E2164756E21",
10
+ "names": []
11
+ }
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import"../chunks/index-7vvt5hhy.js";
2
+ import"../chunks/index-0wpvbdgh.js";
3
3
  import {
4
4
  createNameCensus2
5
- } from "../chunks/index-a15g2gp6.js";
6
- import"../chunks/index-ka8nzreg.js";
5
+ } from "../chunks/index-ye6j60jn.js";
6
+ import"../chunks/index-tk01chxw.js";
7
7
  import { createRequire } from "node:module";
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
 
@@ -20,7 +20,7 @@ async function main(argv) {
20
20
  const limit = Number(value("limit") ?? 25);
21
21
  const field = value("field") ?? "name";
22
22
  const orderField = value("order-field") ?? "order";
23
- const classifier = flag("classify") ? (await import("../chunks/phrase-2nmvkrc5.js")).phraseClassifier() : undefined;
23
+ const classifier = flag("classify") ? (await import("../chunks/phrase-2hj26asc.js")).phraseClassifier() : undefined;
24
24
  const census = createNameCensus2(classifier === undefined ? {} : { classifier });
25
25
  for await (const line of createInterface({
26
26
  input: process.stdin,
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  isMultiWord2,
18
18
  isSuspicious2,
19
19
  isRoundTripException2,
20
+ isInDiminutiveTable2,
20
21
  isPerson2,
21
22
  traditionOf2,
22
23
  toAscii2,
@@ -29,7 +30,7 @@ import {
29
30
  NAMES_TXT2,
30
31
  parseEntries2,
31
32
  Lexicon2
32
- } from "./chunks/index-7vvt5hhy.js";
33
+ } from "./chunks/index-0wpvbdgh.js";
33
34
  import {
34
35
  CONNECTORS2,
35
36
  SCHOOL_KEYWORDS2,
@@ -37,12 +38,10 @@ import {
37
38
  createSegmenter2,
38
39
  createClassifier2,
39
40
  phraseClassifier2
40
- } from "./chunks/index-2565cn5x.js";
41
+ } from "./chunks/index-ky754nsf.js";
41
42
  import"./chunks/index-jwx1mm4k.js";
42
43
  import {
43
44
  repairMojibake2,
44
- sameGivenFamily2,
45
- givenFamilyTable2,
46
45
  comparePosition2,
47
46
  nameRelation2,
48
47
  MAX_READINGS2,
@@ -90,19 +89,25 @@ import {
90
89
  readNameCell2,
91
90
  DEFAULT_NAME_FORMAT_THRESHOLD2,
92
91
  deriveNameFormat2
93
- } from "./chunks/index-kw69ry3j.js";
92
+ } from "./chunks/index-n6fpj92s.js";
94
93
  import"./chunks/index-qsznkk4s.js";
95
94
  import {
96
95
  composeEvalSet2,
97
96
  evaluateClassifier2
98
- } from "./chunks/index-pncn9y2r.js";
99
- import"./chunks/index-kw6gbrnq.js";
97
+ } from "./chunks/index-a6f2y4aa.js";
98
+ import {
99
+ sameGivenFamily2,
100
+ givenFamilyTable2,
101
+ createGivenFamilyList2,
102
+ givenFamilyList2
103
+ } from "./chunks/index-qmn87bdh.js";
104
+ import"./chunks/index-tqdbxd92.js";
100
105
  import {
101
106
  doubleMetaphone2
102
107
  } from "./chunks/index-ebebeamh.js";
103
108
  import {
104
109
  createNameCensus2
105
- } from "./chunks/index-a15g2gp6.js";
110
+ } from "./chunks/index-ye6j60jn.js";
106
111
  import {
107
112
  NAME_REFUSED2,
108
113
  stripEveryAside2,
@@ -147,7 +152,7 @@ import {
147
152
  defaultPersonNameFactory2,
148
153
  personName2,
149
154
  personNameFromIcao2
150
- } from "./chunks/index-ka8nzreg.js";
155
+ } from "./chunks/index-tk01chxw.js";
151
156
  import {
152
157
  TEAM_WORD2,
153
158
  TEAM_DESIGNATION_WORDS2,
@@ -215,6 +220,7 @@ export {
215
220
  compoundGiven2 as compoundGiven,
216
221
  createCachingPersonNameFactory2 as createCachingPersonNameFactory,
217
222
  createClassifier2 as createClassifier,
223
+ createGivenFamilyList2 as createGivenFamilyList,
218
224
  createNameCensus2 as createNameCensus,
219
225
  createNameClusters2 as createNameClusters,
220
226
  createNameIndex2 as createNameIndex,
@@ -232,6 +238,7 @@ export {
232
238
  foldNameKey2 as foldNameKey,
233
239
  formatPersonDisplay2 as formatPersonDisplay,
234
240
  givenAbbreviates2 as givenAbbreviates,
241
+ givenFamilyList2 as givenFamilyList,
235
242
  givenFamilyTable2 as givenFamilyTable,
236
243
  givenKeyAbbreviates2 as givenKeyAbbreviates,
237
244
  infeasibleClass2 as infeasibleClass,
@@ -245,6 +252,7 @@ export {
245
252
  isFemale2 as isFemale,
246
253
  isGiven2 as isGiven,
247
254
  isIcaoName2 as isIcaoName,
255
+ isInDiminutiveTable2 as isInDiminutiveTable,
248
256
  isListJoiner2 as isListJoiner,
249
257
  isMale2 as isMale,
250
258
  isMultiWord2 as isMultiWord,
@@ -320,5 +328,5 @@ export {
320
328
  traditionOf2 as traditionOf
321
329
  };
322
330
 
323
- //# debugId=0572977014BD005764756E2164756E21
331
+ //# debugId=CCF455D45E820EC364756E2164756E21
324
332
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "0572977014BD005764756E2164756E21",
7
+ "debugId": "CCF455D45E820EC364756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -17,6 +17,7 @@ import {
17
17
  isMultiWord2,
18
18
  isSuspicious2,
19
19
  isRoundTripException2,
20
+ isInDiminutiveTable2,
20
21
  isPerson2,
21
22
  traditionOf2,
22
23
  toAscii2,
@@ -29,7 +30,7 @@ import {
29
30
  NAMES_TXT2,
30
31
  parseEntries2,
31
32
  Lexicon2
32
- } from "../chunks/index-7vvt5hhy.js";
33
+ } from "../chunks/index-0wpvbdgh.js";
33
34
  export {
34
35
  APOSTROPHE_CHARS2 as APOSTROPHE_CHARS,
35
36
  CLASSIFICATION_FLAGS2 as CLASSIFICATION_FLAGS,
@@ -46,6 +47,7 @@ export {
46
47
  isConcept2 as isConcept,
47
48
  isFemale2 as isFemale,
48
49
  isGiven2 as isGiven,
50
+ isInDiminutiveTable2 as isInDiminutiveTable,
49
51
  isMale2 as isMale,
50
52
  isMultiWord2 as isMultiWord,
51
53
  isNeutral2 as isNeutral,
@@ -63,5 +65,5 @@ export {
63
65
  traditionOf2 as traditionOf
64
66
  };
65
67
 
66
- //# debugId=6FBC985A99F3DB7E64756E2164756E21
68
+ //# debugId=365105A6760E523C64756E2164756E21
67
69
  //# sourceMappingURL=index.js.map
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "6FBC985A99F3DB7E64756E2164756E21",
7
+ "debugId": "365105A6760E523C64756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  composeEvalSet2,
3
3
  evaluateClassifier2
4
- } from "../chunks/index-pncn9y2r.js";
4
+ } from "../chunks/index-a6f2y4aa.js";
5
5
  import {
6
6
  createNameCensus2
7
- } from "../chunks/index-a15g2gp6.js";
8
- import"../chunks/index-ka8nzreg.js";
9
- import"../chunks/index-7vvt5hhy.js";
7
+ } from "../chunks/index-ye6j60jn.js";
8
+ import"../chunks/index-tk01chxw.js";
9
+ import"../chunks/index-0wpvbdgh.js";
10
10
  export {
11
11
  composeEvalSet2 as composeEvalSet,
12
12
  createNameCensus2 as createNameCensus,
@@ -1,7 +1,5 @@
1
1
  import {
2
2
  repairMojibake2,
3
- sameGivenFamily2,
4
- givenFamilyTable2,
5
3
  comparePosition2,
6
4
  nameRelation2,
7
5
  MAX_READINGS2,
@@ -49,8 +47,14 @@ import {
49
47
  readNameCell2,
50
48
  DEFAULT_NAME_FORMAT_THRESHOLD2,
51
49
  deriveNameFormat2
52
- } from "../chunks/index-kw69ry3j.js";
53
- import"../chunks/index-kw6gbrnq.js";
50
+ } from "../chunks/index-n6fpj92s.js";
51
+ import {
52
+ sameGivenFamily2,
53
+ givenFamilyTable2,
54
+ createGivenFamilyList2,
55
+ givenFamilyList2
56
+ } from "../chunks/index-qmn87bdh.js";
57
+ import"../chunks/index-tqdbxd92.js";
54
58
  import {
55
59
  NAME_REFUSED2,
56
60
  stripEveryAside2,
@@ -95,7 +99,7 @@ import {
95
99
  defaultPersonNameFactory2,
96
100
  personName2,
97
101
  personNameFromIcao2
98
- } from "../chunks/index-ka8nzreg.js";
102
+ } from "../chunks/index-tk01chxw.js";
99
103
  import {
100
104
  TEAM_WORD2,
101
105
  TEAM_DESIGNATION_WORDS2,
@@ -108,7 +112,7 @@ import {
108
112
  } from "../chunks/index-0phgwy52.js";
109
113
  import {
110
114
  lexiconKey2
111
- } from "../chunks/index-7vvt5hhy.js";
115
+ } from "../chunks/index-0wpvbdgh.js";
112
116
  export {
113
117
  COMPOUND_SURNAMES2 as COMPOUND_SURNAMES,
114
118
  DEFAULT_NAME_FORMAT_THRESHOLD2 as DEFAULT_NAME_FORMAT_THRESHOLD,
@@ -140,6 +144,7 @@ export {
140
144
  composeReadings2 as composeReadings,
141
145
  compoundGiven2 as compoundGiven,
142
146
  createCachingPersonNameFactory2 as createCachingPersonNameFactory,
147
+ createGivenFamilyList2 as createGivenFamilyList,
143
148
  createNameClusters2 as createNameClusters,
144
149
  createNameIndex2 as createNameIndex,
145
150
  createNameKinship2 as createNameKinship,
@@ -152,6 +157,7 @@ export {
152
157
  foldNameKey2 as foldNameKey,
153
158
  formatPersonDisplay2 as formatPersonDisplay,
154
159
  givenAbbreviates2 as givenAbbreviates,
160
+ givenFamilyList2 as givenFamilyList,
155
161
  givenFamilyTable2 as givenFamilyTable,
156
162
  givenKeyAbbreviates2 as givenKeyAbbreviates,
157
163
  infeasibleClass2 as infeasibleClass,
@@ -214,5 +220,5 @@ export {
214
220
  traditionLookupOf2 as traditionLookupOf
215
221
  };
216
222
 
217
- //# debugId=6CAF39AD5BAB8B2064756E2164756E21
223
+ //# debugId=5AFE7A2DCFBC721064756E2164756E21
218
224
  //# sourceMappingURL=index.js.map
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "6CAF39AD5BAB8B2064756E2164756E21",
7
+ "debugId": "5AFE7A2DCFBC721064756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * names — the package's command, run as `npx @finbheara/names …` or `bunx @finbheara/names …`.
4
+ *
5
+ * names tables <table> [--output json] [--schema N] print a data table
6
+ *
7
+ * Runs under Node or Bun. (`bun run names` in this repository is the lexicon curation CLI,
8
+ * `./names.ts`, which is not shipped.)
9
+ */
10
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * tables.ts — the package's data tables, printed for a consumer in any language.
3
+ *
4
+ * names tables given-name [--output json] [--schema 1] > given-name-tables.json
5
+ *
6
+ * THE PRINTED FORM IS THE CONTRACT, not the files the tables are stored in. Each table has
7
+ * numbered schemas; a schema, once released, prints the same shape for as long as the
8
+ * package offers it, and a new shape is a new schema. `--schema` defaults to 1 and
9
+ * `--output` to `json`, so a command written against the first release keeps working.
10
+ * (`--schema`, not `--version`: the number is the output's shape, not the package's.)
11
+ */
12
+ /** `names tables …`: prints one table to stdout. Returns the exit code. */
13
+ export declare function tables(argv: readonly string[]): number;
@@ -2,19 +2,22 @@
2
2
  * The flag alphabet, typed, and the predicates over one entry's flag string.
3
3
  *
4
4
  * FLAGS ARE CASE-SENSITIVE. Upper case classifies; a digit is a tradition
5
- * footnote. `S` and `X` are marks that classify nothing.
5
+ * footnote. `S`, `X` and `D` are marks that classify nothing.
6
6
  *
7
7
  * A FLAGLESS ENTRY IS A FEMALE GIVEN NAME. The header says so outright, so every
8
8
  * predicate here reads `""` (or a string with no class letter) as `F`.
9
9
  */
10
10
  /** The classification namespace: what KIND of thing the entry is. */
11
11
  export declare const CLASS_FLAGS: "FMNLAGTCB";
12
- /** Marks: `S` a typo kept on purpose, `X` excluded from the renderer round trip. */
13
- export declare const MARK_FLAGS: "SX";
12
+ /**
13
+ * Marks: `S` a typo kept on purpose, `X` excluded from the renderer round trip, `D` a given
14
+ * name in a diminutive table (`given-diminutives.json` or `given-families.json`).
15
+ */
16
+ export declare const MARK_FLAGS: "SXD";
14
17
  /** Every letter the file issues. */
15
- export declare const CLASSIFICATION_FLAGS: "FMNLATGCBSX";
18
+ export declare const CLASSIFICATION_FLAGS: "FMNLATGCBSXD";
16
19
  export type ClassFlag = "F" | "M" | "N" | "L" | "A" | "G" | "T" | "C" | "B";
17
- export type MarkFlag = "S" | "X";
20
+ export type MarkFlag = "S" | "X" | "D";
18
21
  export type Flag = ClassFlag | MarkFlag;
19
22
  /**
20
23
  * The tradition namespace: a FOOTNOTE INDEX naming which onomastic tradition
@@ -53,6 +56,11 @@ export declare const isMultiWord: (flags: string) => boolean;
53
56
  export declare const isSuspicious: (flags: string) => boolean;
54
57
  /** `X`: excluded from the renderer round trip. */
55
58
  export declare const isRoundTripException: (flags: string) => boolean;
59
+ /**
60
+ * `D`: a given name that a diminutive table holds, as a root, a form or a spelling. It says
61
+ * the tables know the name; which names it relates to is the tables' answer, never the flag's.
62
+ */
63
+ export declare const isInDiminutiveTable: (flags: string) => boolean;
56
64
  /**
57
65
  * Any person class: `F`, `M`, `N`, `L` or `A`. An entry with no class at all is
58
66
  * a female given name and so a person.
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * given-diminutives.ts — ONE GIVEN-NAME DIMINUTIVE TABLE, read by the TypeScript side.
3
3
  *
4
- * `./given-diminutives.json` is the table and this file is its reader. A Python linkage
5
- * lane reads the same JSON for its `givenRoot` comparison level, so the two languages
6
- * share one copy and no second one exists. An earlier adjudicator carried a `FAMILIAR`
7
- * map of eight entries and said *"the name primitives are where it belongs once a second
8
- * consumer wants one"*; the teachers-directory gate is that second consumer, and the eight
9
- * entries are in the table.
4
+ * `./given-diminutives.json` is the table and this file is its reader. A consumer in another
5
+ * language reads the table as `names tables given-name` prints it (`../cli/tables.ts`), never
6
+ * this file, so the file's layout may change and no second copy exists. An earlier
7
+ * adjudicator carried a `FAMILIAR` map of eight entries and said *"the name primitives are
8
+ * where it belongs once a second consumer wants one"*; the teachers-directory gate is that
9
+ * second consumer, and the eight entries are in the table.
10
10
  *
11
11
  * A RELATION OF A PAIR AND NEVER A KEY. Nothing here rewrites a given name: a stored key,
12
12
  * a filing key and every rendering keep the print's own spelling. A caller asks whether
@@ -32,6 +32,15 @@
32
32
  * `Eve` and `Eva` share none, though `Evie` meets both. A `notAtGate` form is refused AS A
33
33
  * FORM: where it is the root itself (`Caitlin` / `Cait`), its own forms meet it at a gate.
34
34
  */
35
+ /**
36
+ * The table as this module reads it, for `names tables given-name`, which prints it. Not a
37
+ * package export: the printed form is the contract, and this file's layout may change.
38
+ */
39
+ export declare function givenDiminutiveTable(): {
40
+ readonly variants: Readonly<Record<string, readonly string[]>>;
41
+ readonly families: Readonly<Record<string, readonly string[]>>;
42
+ readonly notAtGate: readonly string[];
43
+ };
35
44
  /**
36
45
  * Do two DIFFERENT given names (NN3, letters only) stand for one another at a gate?
37
46
  *