@finbheara/names 0.16.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.
- package/README.md +33 -0
- package/dist/chunks/index-n6fpj92s.js +1418 -0
- package/dist/chunks/{index-74fyytnh.js.map → index-n6fpj92s.js.map} +3 -5
- package/dist/chunks/{index-74fyytnh.js → index-qmn87bdh.js} +21 -1411
- package/dist/chunks/index-qmn87bdh.js.map +11 -0
- package/dist/cli/bin.js +109 -0
- package/dist/cli/bin.js.map +11 -0
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/normalize/index.js +8 -6
- package/dist/normalize/index.js.map +1 -1
- package/dist/types/cli/bin.d.ts +10 -0
- package/dist/types/cli/tables.d.ts +13 -0
- package/dist/types/normalize/given-diminutives.d.ts +15 -6
- package/dist/types/normalize/given-families.d.ts +5 -0
- package/package.json +2 -1
|
@@ -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,QAA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,IAAI,CAAE,EAAE,KAAK,EAAE,KAAK,OAAQ,IAAI,IAAI,KAAK,CAAE,CAAC;AAAA,EAC3F,OAAO;AAAA;AAID,IAAM,mBAAmC,uBAAsB;",
|
|
9
|
+
"debugId": "0A72D6F5743D283A64756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
package/dist/cli/bin.js
ADDED
|
@@ -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,MAAM,CAAC,MAAiC;AAAA,EACvD,MAAM,UAAkC,EAAE,QAAQ,QAAQ,QA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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
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -42,10 +42,6 @@ import {
|
|
|
42
42
|
import"./chunks/index-jwx1mm4k.js";
|
|
43
43
|
import {
|
|
44
44
|
repairMojibake2,
|
|
45
|
-
sameGivenFamily2,
|
|
46
|
-
givenFamilyTable2,
|
|
47
|
-
createGivenFamilyList2,
|
|
48
|
-
givenFamilyList2,
|
|
49
45
|
comparePosition2,
|
|
50
46
|
nameRelation2,
|
|
51
47
|
MAX_READINGS2,
|
|
@@ -93,12 +89,18 @@ import {
|
|
|
93
89
|
readNameCell2,
|
|
94
90
|
DEFAULT_NAME_FORMAT_THRESHOLD2,
|
|
95
91
|
deriveNameFormat2
|
|
96
|
-
} from "./chunks/index-
|
|
92
|
+
} from "./chunks/index-n6fpj92s.js";
|
|
97
93
|
import"./chunks/index-qsznkk4s.js";
|
|
98
94
|
import {
|
|
99
95
|
composeEvalSet2,
|
|
100
96
|
evaluateClassifier2
|
|
101
97
|
} from "./chunks/index-a6f2y4aa.js";
|
|
98
|
+
import {
|
|
99
|
+
sameGivenFamily2,
|
|
100
|
+
givenFamilyTable2,
|
|
101
|
+
createGivenFamilyList2,
|
|
102
|
+
givenFamilyList2
|
|
103
|
+
} from "./chunks/index-qmn87bdh.js";
|
|
102
104
|
import"./chunks/index-tqdbxd92.js";
|
|
103
105
|
import {
|
|
104
106
|
doubleMetaphone2
|
|
@@ -326,5 +328,5 @@ export {
|
|
|
326
328
|
traditionOf2 as traditionOf
|
|
327
329
|
};
|
|
328
330
|
|
|
329
|
-
//# debugId=
|
|
331
|
+
//# debugId=CCF455D45E820EC364756E2164756E21
|
|
330
332
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
package/dist/normalize/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
repairMojibake2,
|
|
3
|
-
sameGivenFamily2,
|
|
4
|
-
givenFamilyTable2,
|
|
5
|
-
createGivenFamilyList2,
|
|
6
|
-
givenFamilyList2,
|
|
7
3
|
comparePosition2,
|
|
8
4
|
nameRelation2,
|
|
9
5
|
MAX_READINGS2,
|
|
@@ -51,7 +47,13 @@ import {
|
|
|
51
47
|
readNameCell2,
|
|
52
48
|
DEFAULT_NAME_FORMAT_THRESHOLD2,
|
|
53
49
|
deriveNameFormat2
|
|
54
|
-
} from "../chunks/index-
|
|
50
|
+
} from "../chunks/index-n6fpj92s.js";
|
|
51
|
+
import {
|
|
52
|
+
sameGivenFamily2,
|
|
53
|
+
givenFamilyTable2,
|
|
54
|
+
createGivenFamilyList2,
|
|
55
|
+
givenFamilyList2
|
|
56
|
+
} from "../chunks/index-qmn87bdh.js";
|
|
55
57
|
import"../chunks/index-tqdbxd92.js";
|
|
56
58
|
import {
|
|
57
59
|
NAME_REFUSED2,
|
|
@@ -218,5 +220,5 @@ export {
|
|
|
218
220
|
traditionLookupOf2 as traditionLookupOf
|
|
219
221
|
};
|
|
220
222
|
|
|
221
|
-
//# debugId=
|
|
223
|
+
//# debugId=5AFE7A2DCFBC721064756E2164756E21
|
|
222
224
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;
|
|
@@ -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
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* map of eight entries and said *"the name primitives are
|
|
8
|
-
* consumer wants one"*; the teachers-directory gate is that
|
|
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
|
*
|
|
@@ -44,5 +44,10 @@ export type GivenFamilyList = (a: string, b: string) => "given-maybe" | null;
|
|
|
44
44
|
* The list is parsed on the first question, once per provider.
|
|
45
45
|
*/
|
|
46
46
|
export declare function createGivenFamilyList(options?: GivenFamilyListOptions): GivenFamilyList;
|
|
47
|
+
/**
|
|
48
|
+
* The shipped list as root -> form -> tier, roots and forms sorted, for `names tables
|
|
49
|
+
* given-name`, which prints it. Not a package export: the printed form is the contract.
|
|
50
|
+
*/
|
|
51
|
+
export declare function givenFamilyTiers(): Record<string, Record<string, GivenFamilyTier>>;
|
|
47
52
|
/** The shipped list, every tier: the second given-name provider of `nameKinship`. */
|
|
48
53
|
export declare const givenFamilyList: GivenFamilyList;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@finbheara/names",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "A curated lexicon of personal, school and place names, the surname-particle vocabulary, a phrase classifier and a person-name normalizer",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"names",
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"typescript": "7.0.2"
|
|
89
89
|
},
|
|
90
90
|
"bin": {
|
|
91
|
+
"names": "./dist/cli/bin.js",
|
|
91
92
|
"names-census": "./dist/cli/census.js"
|
|
92
93
|
}
|
|
93
94
|
}
|