@mailwoman/codex 6.0.0 → 6.2.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/out/index.d.ts +5 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +5 -1
- package/out/index.js.map +1 -1
- package/out/level-semantics.d.ts +465 -0
- package/out/level-semantics.d.ts.map +1 -0
- package/out/level-semantics.js +516 -0
- package/out/level-semantics.js.map +1 -0
- package/out/tools/build-country-surface-lexicon.d.ts +43 -0
- package/out/tools/build-country-surface-lexicon.d.ts.map +1 -0
- package/out/tools/build-country-surface-lexicon.js +139 -0
- package/out/tools/build-country-surface-lexicon.js.map +1 -0
- package/out/tools/export-country-surfaces.d.ts +15 -0
- package/out/tools/export-country-surfaces.d.ts.map +1 -0
- package/out/tools/export-country-surfaces.js +34 -0
- package/out/tools/export-country-surfaces.js.map +1 -0
- package/out/us/unit-designator.d.ts +46 -0
- package/out/us/unit-designator.d.ts.map +1 -1
- package/out/us/unit-designator.js +70 -0
- package/out/us/unit-designator.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Build the COUNTRY-SURFACE LEXICON for the country-lexicon soft-feed channel (#1104). This is the
|
|
7
|
+
* third atlas channel, a sibling of the postcode anchor (#239/#240) and the gazetteer anchor
|
|
8
|
+
* (#464): a per-token multi-hot clue the neural GRAMMAR conditions on but never obeys. Country is a
|
|
9
|
+
* CLOSED, ENUMERABLE class (~250 surfaces) — atlas, not grammar — so a dictionary phrase-lookup
|
|
10
|
+
* recovers the WOF-admin / resolver hierarchy case ("United States of America, Wyoming, <locality>")
|
|
11
|
+
* the learned tagger reads as a leading STREET. Pelias handled the same class the same way
|
|
12
|
+
* (`WhosOnFirstClassifier extends PhraseClassifier`); this is the model-first analogue.
|
|
13
|
+
*
|
|
14
|
+
* WHY A DEDICATED LEXICON (not just the gazetteer's `country` slot): the gazetteer already carries
|
|
15
|
+
* these surfaces in slot 0, and the shipped model already consumes them — yet the WOF-admin case
|
|
16
|
+
* still fails (model-card #1104: golden country recall 82.0% vs 88.6%). The country bit is one of a
|
|
17
|
+
* 5-hot vector sharing ONE learned projection with region/po_box/cedex/homograph, and it is ZEROED
|
|
18
|
+
* adjacent to a postcode by `suppress_gazetteer_near_postcode` (exactly where a trailing "…12345
|
|
19
|
+
* USA" sits). A dedicated channel de-entangles the country signal (its own projection + confidence
|
|
20
|
+
* weight) and is immune to that suppression. See
|
|
21
|
+
* docs/superpowers/plans/2026-07-14-country-lexicon-channel.md.
|
|
22
|
+
*
|
|
23
|
+
* The matcher REUSES the gazetteer's phrase-scan (longest-first n-gram over whitespace words,
|
|
24
|
+
* case-insensitive `entries` + uppercase-exact `code_entries`, char→piece projection) — one tested
|
|
25
|
+
* algorithm, two vocabularies. Only the vocabulary + the emitted feature differ. The emitted
|
|
26
|
+
* feature is 2-dim per piece: `[country_surface, country_ambiguous]`.
|
|
27
|
+
*
|
|
28
|
+
* - `country_surface` (bit 1): the piece is part of a recognized country surface phrase.
|
|
29
|
+
* - `country_ambiguous` (bit 2): the SURFACE is a homograph (also a US region) or a common-word
|
|
30
|
+
* name ("Georgia", "America", "England", "IN") — a SOFT version of Pelias's hard blacklist. The
|
|
31
|
+
* model learns to trust `surface & !ambiguous` (unambiguous long/code forms) strongly and
|
|
32
|
+
* `surface & ambiguous` weakly, using context — model-first, never a hard drop, so recall on
|
|
33
|
+
* "Republic of Georgia" is preserved.
|
|
34
|
+
*
|
|
35
|
+
* Source of truth: `@mailwoman/codex` (COUNTRY_SURFACE_FORMS + ISO2_TO_NAME) — the SAME data the
|
|
36
|
+
* corpus-python bridge `country-surfaces.json` is generated from (export-country-surfaces.ts), so
|
|
37
|
+
* the channel and the corpus shard synthesizer cannot diverge on what a country surface IS.
|
|
38
|
+
*
|
|
39
|
+
* Output: data/gazetteer/country-surface-lexicon-v1.json (small, committed, provenance-tracked).
|
|
40
|
+
* Regenerate: `node codex/tools/build-country-surface-lexicon.ts`
|
|
41
|
+
*/
|
|
42
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
43
|
+
import { dirname, resolve } from "node:path";
|
|
44
|
+
import { COUNTRY_SURFACE_FORMS, ISO2_TO_NAME } from "../country/country.js";
|
|
45
|
+
import { US_STATE_ABBREVIATIONS, US_STATE_NAMES } from "../us/state.js";
|
|
46
|
+
const BIT = { country_surface: 1, country_ambiguous: 2 };
|
|
47
|
+
const SLOTS = ["country_surface", "country_ambiguous"];
|
|
48
|
+
// Committed output path (a codex-derived artifact, like export-country-surfaces.ts — no argv, so the
|
|
49
|
+
// no-process-globals lint policy holds; codex stays zero-runtime-dep).
|
|
50
|
+
const OUTPUT = resolve(import.meta.dirname, "../../data/gazetteer/country-surface-lexicon-v1.json");
|
|
51
|
+
/**
|
|
52
|
+
* THE shared word-normalization rule (identical to build-gazetteer-anchor-lexicon.mjs and mirrored in
|
|
53
|
+
* gazetteer_char_paint on both sides): per whitespace-word, strip LEADING/TRAILING characters that are not Unicode
|
|
54
|
+
* letters or digits (keep internal ones: "u.s.a", "timor-leste"), rejoin single-spaced. Entry keys and scanned tokens
|
|
55
|
+
* both pass through it, so "U.S.A." ≡ "u.s.a".
|
|
56
|
+
*/
|
|
57
|
+
const wordNorm = (s) => s
|
|
58
|
+
.split(/\s+/)
|
|
59
|
+
.map((w) => w.replace(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, ""))
|
|
60
|
+
.filter(Boolean)
|
|
61
|
+
.join(" ");
|
|
62
|
+
const norm = (s) => wordNorm(s).toLowerCase();
|
|
63
|
+
/** Short alphabetic code (≤3 letters once punctuation is dropped) → exact-uppercase matching. */
|
|
64
|
+
const isShortCode = (s) => {
|
|
65
|
+
const letters = s.replace(/[^\p{L}]/gu, "");
|
|
66
|
+
return letters.length > 0 && letters.length <= 3 && /^[\p{L}.\s]+$/u.test(s);
|
|
67
|
+
};
|
|
68
|
+
// Homograph set: a single-word country surface that is ALSO a US region (name or abbreviation) reads
|
|
69
|
+
// ambiguously (Georgia the country vs the state, IN = India vs Indiana). Computed from codex so it
|
|
70
|
+
// tracks the US region table, never hand-maintained.
|
|
71
|
+
const usStateNames = new Set(US_STATE_NAMES.map((n) => n.toLowerCase()));
|
|
72
|
+
const usStateAbbrevs = new Set(US_STATE_ABBREVIATIONS);
|
|
73
|
+
// Curated common-word country surfaces — single tokens that appear far more often as ordinary
|
|
74
|
+
// street/venue/locality words than as a trailing country. A SOFT flag (the model still decides), the
|
|
75
|
+
// model-first analogue of Pelias's blacklist (north/south/east/west/street/city/king). Tunable.
|
|
76
|
+
const COMMON_WORD_AMBIGUOUS = new Set(["america", "england", "britain", "turkey", "chad", "jordan", "jersey", "guinea"]);
|
|
77
|
+
const isAmbiguousName = (lowerKey) => usStateNames.has(lowerKey) || COMMON_WORD_AMBIGUOUS.has(lowerKey);
|
|
78
|
+
// surface → bits, split across the two match-rule maps (mirrors the gazetteer builder).
|
|
79
|
+
const entries = new Map(); // lowercase key
|
|
80
|
+
const codeEntries = new Map(); // exact-uppercase key
|
|
81
|
+
let maxNgram = 1;
|
|
82
|
+
function add(surface) {
|
|
83
|
+
const s = surface.trim();
|
|
84
|
+
if (!s)
|
|
85
|
+
return;
|
|
86
|
+
if (isShortCode(s)) {
|
|
87
|
+
const key = wordNorm(s).toUpperCase();
|
|
88
|
+
if (!key)
|
|
89
|
+
return;
|
|
90
|
+
// A code that collides with a US-state abbreviation (CA/IN/AL/CO/…) is a homograph → ambiguous.
|
|
91
|
+
const bits = BIT.country_surface | (usStateAbbrevs.has(key) ? BIT.country_ambiguous : 0);
|
|
92
|
+
codeEntries.set(key, (codeEntries.get(key) ?? 0) | bits);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const key = norm(s);
|
|
96
|
+
if (!key)
|
|
97
|
+
return;
|
|
98
|
+
const words = key.split(" ");
|
|
99
|
+
maxNgram = Math.max(maxNgram, words.length);
|
|
100
|
+
// Multi-word phrases are unambiguous by construction; single tokens consult the homograph +
|
|
101
|
+
// common-word rule.
|
|
102
|
+
const ambiguous = words.length === 1 && isAmbiguousName(key);
|
|
103
|
+
const bits = BIT.country_surface | (ambiguous ? BIT.country_ambiguous : 0);
|
|
104
|
+
entries.set(key, (entries.get(key) ?? 0) | bits);
|
|
105
|
+
}
|
|
106
|
+
// Curated rich surface forms first (US/GB/DE/… endonyms + abbreviations), then the canonical English
|
|
107
|
+
// name for every remaining ISO 3166-1 alpha-2 — exactly the merge country-surfaces.json performs.
|
|
108
|
+
for (const forms of Object.values(COUNTRY_SURFACE_FORMS)) {
|
|
109
|
+
for (const f of forms) {
|
|
110
|
+
add(f);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
for (const [, name] of ISO2_TO_NAME) {
|
|
114
|
+
add(name);
|
|
115
|
+
}
|
|
116
|
+
const ambiguousEntries = [...entries, ...codeEntries].filter(([, b]) => b & BIT.country_ambiguous).map(([k]) => k);
|
|
117
|
+
const lexicon = {
|
|
118
|
+
version: 1,
|
|
119
|
+
generated_by: "codex/tools/build-country-surface-lexicon.ts (source: @mailwoman/codex COUNTRY_SURFACE_FORMS + ISO2_TO_NAME)",
|
|
120
|
+
feature_dim: SLOTS.length,
|
|
121
|
+
slots: SLOTS,
|
|
122
|
+
bits: BIT,
|
|
123
|
+
max_ngram: maxNgram,
|
|
124
|
+
rules: {
|
|
125
|
+
word_norm: "per whitespace-word: strip leading/trailing chars that are not Unicode letters/digits " +
|
|
126
|
+
"(keep internal: 'timor-leste', 'u.s.a'); rejoin single-spaced. Applied to BOTH entry keys and scanned tokens.",
|
|
127
|
+
entries: "case-insensitive; key = word_norm lowercased. country_surface always set; country_ambiguous set for single-token homographs (US region) or curated common-word names.",
|
|
128
|
+
code_entries: "case-SENSITIVE exact: word_norm(token) == key (keys uppercase; 'in' the word ≠ 'IN' India). n-gram length 1. country_ambiguous set when the code is also a US-state abbreviation.",
|
|
129
|
+
scan: "longest-first n-gram over whitespace words, left to right, non-overlapping (shared with the gazetteer matcher)",
|
|
130
|
+
feature: "emitted per-piece row = [country_surface, country_ambiguous] (the raw bits); confidence = 1.0 where country_surface fires.",
|
|
131
|
+
},
|
|
132
|
+
entries: Object.fromEntries([...entries].sort(([a], [b]) => a.localeCompare(b))),
|
|
133
|
+
code_entries: Object.fromEntries([...codeEntries].sort(([a], [b]) => a.localeCompare(b))),
|
|
134
|
+
};
|
|
135
|
+
mkdirSync(dirname(OUTPUT), { recursive: true });
|
|
136
|
+
writeFileSync(OUTPUT, JSON.stringify(lexicon, null, 1) + "\n");
|
|
137
|
+
process.stderr.write(`wrote ${OUTPUT}: ${entries.size} entries + ${codeEntries.size} code_entries, ` +
|
|
138
|
+
`max_ngram=${maxNgram}, ${ambiguousEntries.length} ambiguous: ${ambiguousEntries.slice(0, 12).join(", ")}${ambiguousEntries.length > 12 ? ", …" : ""}\n`);
|
|
139
|
+
//# sourceMappingURL=build-country-surface-lexicon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-country-surface-lexicon.js","sourceRoot":"","sources":["../../tools/build-country-surface-lexicon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC3E,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEvE,MAAM,GAAG,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAA;AACxD,MAAM,KAAK,GAAG,CAAC,iB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;QACxK,YAAY,EACX,mLAAmL;QACpL,IAAI,EAAE,gHAAgH;QACtH,OAAO,EACN,4HAA4H;KAC7H;IACD,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;CACzF,CAAA;AAED,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;AAC/C,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAA;AAC9D,OAAO,CAAC,MAAM,CAAC,KAAK,CACnB,SAAS,MAAM,KAAK,OAAO,CAAC,IAAI,cAAc,WAAW,CAAC,IAAI,iBAAiB;IAC9E,aAAa,QAAQ,KAAK,gBAAgB,CAAC,MAAM,eAAe,gBAAgB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CACzJ,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* codex → corpus-python bridge: emit the authoritative country surface forms as JSON so the Python
|
|
7
|
+
* shard generators can synthesize address tails ("…, USA" / "…, United States of America") without
|
|
8
|
+
* re-deriving the country name/alias data. `@mailwoman/codex` stays the single source of truth
|
|
9
|
+
* (COUNTRY_SURFACE_FORMS + ISO2_TO_NAME, salvaged from isp-nexus spatial/countries); this writes a
|
|
10
|
+
* snapshot the language boundary can't import directly.
|
|
11
|
+
*
|
|
12
|
+
* Regenerate: `node codex/tools/export-country-surfaces.ts` (writes the corpus-python data file).
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=export-country-surfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-country-surfaces.d.ts","sourceRoot":"","sources":["../../tools/export-country-surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* codex → corpus-python bridge: emit the authoritative country surface forms as JSON so the Python
|
|
7
|
+
* shard generators can synthesize address tails ("…, USA" / "…, United States of America") without
|
|
8
|
+
* re-deriving the country name/alias data. `@mailwoman/codex` stays the single source of truth
|
|
9
|
+
* (COUNTRY_SURFACE_FORMS + ISO2_TO_NAME, salvaged from isp-nexus spatial/countries); this writes a
|
|
10
|
+
* snapshot the language boundary can't import directly.
|
|
11
|
+
*
|
|
12
|
+
* Regenerate: `node codex/tools/export-country-surfaces.ts` (writes the corpus-python data file).
|
|
13
|
+
*/
|
|
14
|
+
import { writeFileSync } from "node:fs";
|
|
15
|
+
import { resolve } from "node:path";
|
|
16
|
+
import { COUNTRY_SURFACE_FORMS, ISO2_TO_NAME } from "../country/country.js";
|
|
17
|
+
// Merge: rich surface forms where the codex curates them, else the canonical English name for every
|
|
18
|
+
// ISO 3166-1 alpha-2. Canonical-name-first (the codex's own ordering) so the common form leads.
|
|
19
|
+
const surfaces = {};
|
|
20
|
+
for (const [iso2, forms] of Object.entries(COUNTRY_SURFACE_FORMS)) {
|
|
21
|
+
surfaces[iso2] = [...forms];
|
|
22
|
+
}
|
|
23
|
+
for (const [iso2, name] of ISO2_TO_NAME) {
|
|
24
|
+
if (!surfaces[iso2]) {
|
|
25
|
+
surfaces[iso2] = [name];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const out = resolve(import.meta.dirname, "../../corpus-python/src/mailwoman_train/data/country-surfaces.json");
|
|
29
|
+
writeFileSync(out, JSON.stringify({
|
|
30
|
+
_generated: "codex/tools/export-country-surfaces.ts from @mailwoman/codex COUNTRY_SURFACE_FORMS + ISO2_TO_NAME",
|
|
31
|
+
surfaces,
|
|
32
|
+
}, null, 2) + "\n");
|
|
33
|
+
process.stderr.write(`wrote ${Object.keys(surfaces).length} countries → ${out}\n`);
|
|
34
|
+
//# sourceMappingURL=export-country-surfaces.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-country-surfaces.js","sourceRoot":"","sources":["../../tools/export-country-surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAE3E,oGAAoG;AACpG,gGAAgG;AAChG,MAAM,QAAQ,GAA6B,EAAE,CAAA;AAE7C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,CAAC;IACnE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAA;AAC5B,CAAC;AAED,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,YAAY,EAAE,CAAC;IACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACrB,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACxB,CAAC;AACF,CAAC;AAED,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,oEAAoE,CAAC,CAAA;AAC9G,aAAa,CACZ,GAAG,EACH,IAAI,CAAC,SAAS,CACb;IACC,UAAU,EAAE,mGAAmG;IAC/G,QAAQ;CACR,EACD,IAAI,EACJ,CAAC,CACD,GAAG,IAAI,CACR,CAAA;AACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAA"}
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
* counterpart to the runtime `UnitDesignatorClassifier` (which matches the broader libpostal
|
|
17
17
|
* `unit_types` lexicon). Designators are LEADING ("Apt 4B"), unlike street suffixes which trail.
|
|
18
18
|
*
|
|
19
|
+
* `US_UNIT_DESIGNATOR_REQUIRES_RANGE` (added for #1100, the secondary-address epic; retrieved from
|
|
20
|
+
* Appendix C2 2026-07-13) is Pub-28's own "Requires a Secondary Number" column: APT, BLDG, DEPT,
|
|
21
|
+
* FL, HNGR, KEY, LOT, PIER, RM, SLIP, SPC, STOP, STE, TRLR, and UNIT must be followed by an
|
|
22
|
+
* identifier ("Apt 4B", never bare "Apt"); BSMT, FRNT, LBBY, LOWR, OFC, PH, REAR, SIDE, and UPPR
|
|
23
|
+
* may stand alone. This formalizes, as provenance-tracked reference data, the split that
|
|
24
|
+
* `corpus/src/shard-recipes/unit.ts` previously hand-rolled (and only partially covered) as
|
|
25
|
+
* in-file `ID_DESIGNATORS`/`STANDALONE_DESIGNATORS` arrays for synthesis weighting. A SEPARATE,
|
|
26
|
+
* not-yet-built deliverable of #1100 is the per-locale *level-semantics* table (étage/RDC, EG/OG/UG,
|
|
27
|
+
* planta/piso/bajo, piano/terra, 階/F/B1, …) — this module stays US/Pub-28 only.
|
|
28
|
+
*
|
|
19
29
|
* Data is verbatim USPS Pub-28 C2.
|
|
20
30
|
* @see {@link https://pe.usps.com/text/pub28/28apc_003.htm USPS Secondary Unit Designators}
|
|
21
31
|
*/
|
|
@@ -59,6 +69,13 @@ export type UsUnitDesignator = keyof typeof US_UNIT_DESIGNATOR_VARIANTS;
|
|
|
59
69
|
export declare const US_UNIT_DESIGNATOR_LOOKUP: ReadonlyMap<string, UsUnitDesignator>;
|
|
60
70
|
/** Approved USPS abbreviation per canonical (`APARTMENT → "APT"`, `SUITE → "STE"`). */
|
|
61
71
|
export declare const US_UNIT_DESIGNATOR_PREFERRED_ABBR: Readonly<Record<UsUnitDesignator, string>>;
|
|
72
|
+
/**
|
|
73
|
+
* Canonical designators Appendix C2 marks as "Requires a Secondary Number" — the designator must be followed by an
|
|
74
|
+
* identifier ("Apt 4B", "Rm 12"), never appearing bare. The remaining designators (BASEMENT, FRONT, LOBBY, LOWER,
|
|
75
|
+
* OFFICE, PENTHOUSE, REAR, SIDE, UPPER) may stand alone with no trailing identifier. Verbatim from USPS Pub-28 C2; see
|
|
76
|
+
* the module header for provenance (#1100).
|
|
77
|
+
*/
|
|
78
|
+
export declare const US_UNIT_DESIGNATOR_REQUIRES_RANGE: Readonly<Record<UsUnitDesignator, boolean>>;
|
|
62
79
|
/**
|
|
63
80
|
* If the FIRST whitespace-separated word of `unit` is a known USPS designator variant, return the canonical key and the
|
|
64
81
|
* matched word. Returns null if the leading word isn't a known designator (e.g. a bare `"4B"` or `"#210"`).
|
|
@@ -68,6 +85,30 @@ export declare function matchLeadingDesignator(unit: string): {
|
|
|
68
85
|
canonical: UsUnitDesignator;
|
|
69
86
|
matched: string;
|
|
70
87
|
} | null;
|
|
88
|
+
/** Result of {@link matchLeadingDesignatorWithRange}: the leading designator plus its optional secondary range. */
|
|
89
|
+
export interface UnitDesignatorRangeMatch {
|
|
90
|
+
/** The matched canonical designator, i.e. "APARTMENT", "SUITE". */
|
|
91
|
+
canonical: UsUnitDesignator;
|
|
92
|
+
/** The designator's own matched surface form, i.e. "Apt". */
|
|
93
|
+
matched: string;
|
|
94
|
+
/**
|
|
95
|
+
* The secondary range/identifier token immediately following the designator, i.e. "4B" in "Apt 4B". Undefined when
|
|
96
|
+
* the designator appears standalone (e.g. bare "Basement"). This module does not validate the range's own shape —
|
|
97
|
+
* numeric, letter, or alphanumeric ranges are all USPS-valid.
|
|
98
|
+
*/
|
|
99
|
+
range: string | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Whether USPS Pub-28 Appendix C2 marks this designator as requiring a secondary range (see
|
|
102
|
+
* {@link US_UNIT_DESIGNATOR_REQUIRES_RANGE}). Informational only — not enforced by this matcher.
|
|
103
|
+
*/
|
|
104
|
+
requiresRange: boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Like {@link matchLeadingDesignator}, but also captures the secondary range/identifier token immediately following the
|
|
108
|
+
* designator, if present ("Apt 4B" → designator "APARTMENT", range "4B"; "Basement" → range `undefined`). Mirrors
|
|
109
|
+
* `street-suffix`/`street-directional`'s designator+adjacent-token matchers.
|
|
110
|
+
*/
|
|
111
|
+
export declare function matchLeadingDesignatorWithRange(unit: string): UnitDesignatorRangeMatch | null;
|
|
71
112
|
/** Result of a successful USPS secondary-unit designator lookup. */
|
|
72
113
|
export interface UnitDesignatorMatch<D extends UsUnitDesignator = UsUnitDesignator> {
|
|
73
114
|
/** The matched canonical designator, i.e. "APARTMENT", "SUITE". */
|
|
@@ -86,4 +127,9 @@ export declare function lookupUnitDesignator(input: string | null | undefined):
|
|
|
86
127
|
* `"floor"`.
|
|
87
128
|
*/
|
|
88
129
|
export declare function isUnitDesignatorToken(input: unknown): boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Alias of {@link isUnitDesignatorToken} under Pub-28's own term ("secondary unit designator"). Added for #1100 so
|
|
132
|
+
* secondary-address call sites can spell the predicate after the publication's vocabulary.
|
|
133
|
+
*/
|
|
134
|
+
export declare function isSecondaryUnitDesignatorToken(input: unknown): boolean;
|
|
89
135
|
//# sourceMappingURL=unit-designator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-designator.d.ts","sourceRoot":"","sources":["../../us/unit-designator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"unit-designator.d.ts","sourceRoot":"","sources":["../../us/unit-designator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;CAyBc,CAAA;AAEtD,2FAA2F;AAC3F,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,2BAA2B,CAAA;AAEvE;;;GAGG;AACH,eAAO,MAAM,yBAAyB,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAexE,CAAA;AAEJ,uFAAuF;AACvF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAE1C,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAyBpC,CAAA;AAEtD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,gBAAgB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAU5G;AAED,mHAAmH;AACnH,MAAM,WAAW,wBAAwB;IACxC,mEAAmE;IACnE,SAAS,EAAE,gBAAgB,CAAA;IAC3B,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,IAAI,CAgB7F;AAED,oEAAoE;AACpE,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IACjF,mEAAmE;IACnE,UAAU,EAAE,CAAC,CAAA;IACb,yDAAyD;IACzD,YAAY,EAAE,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;CACxD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,gBAAgB,EAAE,UAAU,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAAA;AACvG,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,mBAAmB,GAAG,IAAI,CAAA;AAUlG;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEtE"}
|
|
@@ -16,6 +16,16 @@
|
|
|
16
16
|
* counterpart to the runtime `UnitDesignatorClassifier` (which matches the broader libpostal
|
|
17
17
|
* `unit_types` lexicon). Designators are LEADING ("Apt 4B"), unlike street suffixes which trail.
|
|
18
18
|
*
|
|
19
|
+
* `US_UNIT_DESIGNATOR_REQUIRES_RANGE` (added for #1100, the secondary-address epic; retrieved from
|
|
20
|
+
* Appendix C2 2026-07-13) is Pub-28's own "Requires a Secondary Number" column: APT, BLDG, DEPT,
|
|
21
|
+
* FL, HNGR, KEY, LOT, PIER, RM, SLIP, SPC, STOP, STE, TRLR, and UNIT must be followed by an
|
|
22
|
+
* identifier ("Apt 4B", never bare "Apt"); BSMT, FRNT, LBBY, LOWR, OFC, PH, REAR, SIDE, and UPPR
|
|
23
|
+
* may stand alone. This formalizes, as provenance-tracked reference data, the split that
|
|
24
|
+
* `corpus/src/shard-recipes/unit.ts` previously hand-rolled (and only partially covered) as
|
|
25
|
+
* in-file `ID_DESIGNATORS`/`STANDALONE_DESIGNATORS` arrays for synthesis weighting. A SEPARATE,
|
|
26
|
+
* not-yet-built deliverable of #1100 is the per-locale *level-semantics* table (étage/RDC, EG/OG/UG,
|
|
27
|
+
* planta/piso/bajo, piano/terra, 階/F/B1, …) — this module stays US/Pub-28 only.
|
|
28
|
+
*
|
|
19
29
|
* Data is verbatim USPS Pub-28 C2.
|
|
20
30
|
* @see {@link https://pe.usps.com/text/pub28/28apc_003.htm USPS Secondary Unit Designators}
|
|
21
31
|
*/
|
|
@@ -69,6 +79,38 @@ export const US_UNIT_DESIGNATOR_LOOKUP = (() => {
|
|
|
69
79
|
})();
|
|
70
80
|
/** Approved USPS abbreviation per canonical (`APARTMENT → "APT"`, `SUITE → "STE"`). */
|
|
71
81
|
export const US_UNIT_DESIGNATOR_PREFERRED_ABBR = Object.fromEntries(Object.keys(US_UNIT_DESIGNATOR_VARIANTS).map((k) => [k, US_UNIT_DESIGNATOR_VARIANTS[k][0]]));
|
|
82
|
+
/**
|
|
83
|
+
* Canonical designators Appendix C2 marks as "Requires a Secondary Number" — the designator must be followed by an
|
|
84
|
+
* identifier ("Apt 4B", "Rm 12"), never appearing bare. The remaining designators (BASEMENT, FRONT, LOBBY, LOWER,
|
|
85
|
+
* OFFICE, PENTHOUSE, REAR, SIDE, UPPER) may stand alone with no trailing identifier. Verbatim from USPS Pub-28 C2; see
|
|
86
|
+
* the module header for provenance (#1100).
|
|
87
|
+
*/
|
|
88
|
+
export const US_UNIT_DESIGNATOR_REQUIRES_RANGE = {
|
|
89
|
+
APARTMENT: true,
|
|
90
|
+
BASEMENT: false,
|
|
91
|
+
BUILDING: true,
|
|
92
|
+
DEPARTMENT: true,
|
|
93
|
+
FLOOR: true,
|
|
94
|
+
FRONT: false,
|
|
95
|
+
HANGAR: true,
|
|
96
|
+
KEY: true,
|
|
97
|
+
LOBBY: false,
|
|
98
|
+
LOT: true,
|
|
99
|
+
LOWER: false,
|
|
100
|
+
OFFICE: false,
|
|
101
|
+
PENTHOUSE: false,
|
|
102
|
+
PIER: true,
|
|
103
|
+
REAR: false,
|
|
104
|
+
ROOM: true,
|
|
105
|
+
SIDE: false,
|
|
106
|
+
SLIP: true,
|
|
107
|
+
SPACE: true,
|
|
108
|
+
STOP: true,
|
|
109
|
+
SUITE: true,
|
|
110
|
+
TRAILER: true,
|
|
111
|
+
UNIT: true,
|
|
112
|
+
UPPER: false,
|
|
113
|
+
};
|
|
72
114
|
/**
|
|
73
115
|
* If the FIRST whitespace-separated word of `unit` is a known USPS designator variant, return the canonical key and the
|
|
74
116
|
* matched word. Returns null if the leading word isn't a known designator (e.g. a bare `"4B"` or `"#210"`).
|
|
@@ -84,6 +126,27 @@ export function matchLeadingDesignator(unit) {
|
|
|
84
126
|
return null;
|
|
85
127
|
return { canonical, matched: first };
|
|
86
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Like {@link matchLeadingDesignator}, but also captures the secondary range/identifier token immediately following the
|
|
131
|
+
* designator, if present ("Apt 4B" → designator "APARTMENT", range "4B"; "Basement" → range `undefined`). Mirrors
|
|
132
|
+
* `street-suffix`/`street-directional`'s designator+adjacent-token matchers.
|
|
133
|
+
*/
|
|
134
|
+
export function matchLeadingDesignatorWithRange(unit) {
|
|
135
|
+
const trimmed = unit.trim();
|
|
136
|
+
if (!trimmed)
|
|
137
|
+
return null;
|
|
138
|
+
const parts = trimmed.split(/\s+/);
|
|
139
|
+
const first = parts[0];
|
|
140
|
+
const canonical = US_UNIT_DESIGNATOR_LOOKUP.get(first.toLowerCase());
|
|
141
|
+
if (!canonical)
|
|
142
|
+
return null;
|
|
143
|
+
return {
|
|
144
|
+
canonical,
|
|
145
|
+
matched: first,
|
|
146
|
+
range: parts[1],
|
|
147
|
+
requiresRange: US_UNIT_DESIGNATOR_REQUIRES_RANGE[canonical],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
87
150
|
export function lookupUnitDesignator(input) {
|
|
88
151
|
if (!input || typeof input !== "string")
|
|
89
152
|
return null;
|
|
@@ -99,4 +162,11 @@ export function lookupUnitDesignator(input) {
|
|
|
99
162
|
export function isUnitDesignatorToken(input) {
|
|
100
163
|
return typeof input === "string" && US_UNIT_DESIGNATOR_LOOKUP.has(input.trim().toLowerCase());
|
|
101
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Alias of {@link isUnitDesignatorToken} under Pub-28's own term ("secondary unit designator"). Added for #1100 so
|
|
167
|
+
* secondary-address call sites can spell the predicate after the publication's vocabulary.
|
|
168
|
+
*/
|
|
169
|
+
export function isSecondaryUnitDesignatorToken(input) {
|
|
170
|
+
return isUnitDesignatorToken(input);
|
|
171
|
+
}
|
|
102
172
|
//# sourceMappingURL=unit-designator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-designator.js","sourceRoot":"","sources":["../../us/unit-designator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"unit-designator.js","sourceRoot":"","sources":["../../us/unit-designator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IAC1C,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC;IAClC,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC;IACzB,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,KAAK,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IACpB,KAAK,EAAE,CAAC,MAAM,CAAC;IACf,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,GAAG,EAAE,CAAC,KAAK,CAAC;IACZ,KAAK,EAAE,CAAC,MAAM,CAAC;IACf,GAAG,EAAE,CAAC,K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qB,CAAC,KAAK,CAAC,CAAA;AACpC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/codex",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Per-address-system postal reference data + branded types (USPS street suffixes, US ZIP codes). Pure, zero-runtime-dep — the shared canonical home for postal-system primitives the parser, resolver, and synthesis layers all reach for.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -116,6 +116,6 @@
|
|
|
116
116
|
"type-fest": "^5.8.0"
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
|
-
"@mailwoman/annotations": "6.
|
|
119
|
+
"@mailwoman/annotations": "6.2.0"
|
|
120
120
|
}
|
|
121
121
|
}
|