@mailwoman/codex 9.2.0 → 9.3.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 +4 -4
- package/{address-system-conventions.ts → lib/address-system-conventions.ts} +9 -9
- package/{au → lib/au}/index.ts +4 -4
- package/{ca → lib/ca}/index.ts +3 -3
- package/{ca → lib/ca}/postal-code.ts +1 -1
- package/{ca → lib/ca}/province.ts +1 -1
- package/{ca → lib/ca}/street-type.ts +10 -12
- package/{country → lib/country}/codes.ts +1 -1
- package/{country → lib/country}/country.ts +43 -14
- package/lib/country/index.ts +17 -0
- package/{country → lib/country}/reference.ts +2 -2
- package/{country → lib/country}/subdivision.ts +4 -4
- package/{de → lib/de}/index.ts +3 -3
- package/{es → lib/es}/codigo-postal.ts +22 -4
- package/{es → lib/es}/index.ts +1 -1
- package/{fr → lib/fr}/cedex.ts +1 -1
- package/{fr → lib/fr}/code-postal.ts +2 -2
- package/{fr → lib/fr}/departement.ts +5 -2
- package/{fr → lib/fr}/index.ts +5 -5
- package/{fr → lib/fr}/region.ts +1 -1
- package/{fr → lib/fr}/voie.ts +5 -13
- package/{gb → lib/gb}/country.ts +2 -10
- package/{gb → lib/gb}/index.ts +4 -4
- package/{gb → lib/gb}/postcode-area.ts +1 -1
- package/{gb → lib/gb}/street-type.ts +1 -1
- package/{index.ts → lib/index.ts} +13 -12
- package/{it → lib/it}/cap.ts +21 -3
- package/{it → lib/it}/index.ts +1 -1
- package/{jp → lib/jp}/index.ts +3 -3
- package/{jp → lib/jp}/prefecture.ts +7 -5
- package/{normalize.ts → lib/normalize.ts} +15 -1
- package/{nz → lib/nz}/delivery-service.ts +1 -1
- package/{nz → lib/nz}/index.ts +2 -2
- package/{postcode-systems.ts → lib/postcode-systems.ts} +40 -24
- package/{tools → lib/tools}/build-country-surface-lexicon.ts +10 -9
- package/{tools → lib/tools}/export-country-surfaces.ts +8 -8
- package/{tools → lib/tools}/generate-country-population.ts +4 -5
- package/{tools → lib/tools}/generate-country-reference.ts +4 -5
- package/{tools → lib/tools}/generate-official-languages.ts +7 -9
- package/{tools → lib/tools}/index.ts +3 -3
- package/{us → lib/us}/index.ts +8 -8
- package/{us → lib/us}/po-box.ts +1 -1
- package/{us → lib/us}/street-directional.ts +2 -2
- package/{us → lib/us}/street-suffix.ts +1 -1
- package/{us → lib/us}/unit-designator.ts +1 -1
- package/{us → lib/us}/zipcode.ts +1 -1
- package/out/address-system-conventions.d.ts +1 -1
- package/out/address-system-conventions.d.ts.map +1 -1
- package/out/address-system-conventions.js +8 -8
- package/out/address-system-conventions.js.map +1 -1
- package/out/au/delivery-service.d.ts.map +1 -1
- package/out/au/delivery-service.js.map +1 -1
- package/out/au/index.d.ts +4 -4
- package/out/au/index.d.ts.map +1 -1
- package/out/au/index.js +4 -4
- package/out/au/index.js.map +1 -1
- package/out/au/level-designator.d.ts.map +1 -1
- package/out/au/level-designator.js.map +1 -1
- package/out/au/postcode.d.ts.map +1 -1
- package/out/au/postcode.js.map +1 -1
- package/out/au/state.d.ts.map +1 -1
- package/out/au/state.js.map +1 -1
- package/out/ca/index.d.ts +3 -3
- package/out/ca/index.d.ts.map +1 -1
- package/out/ca/index.js +3 -3
- package/out/ca/index.js.map +1 -1
- package/out/ca/postal-code.d.ts +1 -1
- package/out/ca/postal-code.d.ts.map +1 -1
- package/out/ca/postal-code.js.map +1 -1
- package/out/ca/province.d.ts.map +1 -1
- package/out/ca/province.js +1 -1
- package/out/ca/province.js.map +1 -1
- package/out/ca/street-type.d.ts.map +1 -1
- package/out/ca/street-type.js +9 -12
- package/out/ca/street-type.js.map +1 -1
- package/out/country/codes.d.ts.map +1 -1
- package/out/country/codes.js.map +1 -1
- package/out/country/country.d.ts +13 -11
- package/out/country/country.d.ts.map +1 -1
- package/out/country/country.js +35 -13
- package/out/country/country.js.map +1 -1
- package/out/country/display-names.d.ts.map +1 -1
- package/out/country/display-names.js.map +1 -1
- package/out/country/index.d.ts +10 -10
- package/out/country/index.d.ts.map +1 -1
- package/out/country/index.js +10 -10
- package/out/country/index.js.map +1 -1
- package/out/country/names.d.ts.map +1 -1
- package/out/country/names.js.map +1 -1
- package/out/country/official-languages.d.ts.map +1 -1
- package/out/country/official-languages.js.map +1 -1
- package/out/country/population.d.ts.map +1 -1
- package/out/country/population.js.map +1 -1
- package/out/country/reference-data.d.ts.map +1 -1
- package/out/country/reference-data.js.map +1 -1
- package/out/country/reference.d.ts +1 -1
- package/out/country/reference.d.ts.map +1 -1
- package/out/country/reference.js +2 -2
- package/out/country/reference.js.map +1 -1
- package/out/country/subdivision.d.ts.map +1 -1
- package/out/country/subdivision.js +4 -4
- package/out/country/subdivision.js.map +1 -1
- package/out/de/bundesland.d.ts.map +1 -1
- package/out/de/bundesland.js.map +1 -1
- package/out/de/index.d.ts +3 -3
- package/out/de/index.d.ts.map +1 -1
- package/out/de/index.js +3 -3
- package/out/de/index.js.map +1 -1
- package/out/de/postleitzahl.d.ts.map +1 -1
- package/out/de/postleitzahl.js.map +1 -1
- package/out/de/street-type.d.ts.map +1 -1
- package/out/de/street-type.js.map +1 -1
- package/out/es/codigo-postal.d.ts +11 -0
- package/out/es/codigo-postal.d.ts.map +1 -1
- package/out/es/codigo-postal.js +20 -3
- package/out/es/codigo-postal.js.map +1 -1
- package/out/es/index.d.ts +1 -1
- package/out/es/index.d.ts.map +1 -1
- package/out/es/index.js +1 -1
- package/out/es/index.js.map +1 -1
- package/out/fr/cedex.d.ts +1 -1
- package/out/fr/cedex.d.ts.map +1 -1
- package/out/fr/cedex.js +1 -1
- package/out/fr/cedex.js.map +1 -1
- package/out/fr/code-postal.d.ts +2 -2
- package/out/fr/code-postal.d.ts.map +1 -1
- package/out/fr/code-postal.js +2 -2
- package/out/fr/code-postal.js.map +1 -1
- package/out/fr/departement.d.ts +2 -2
- package/out/fr/departement.d.ts.map +1 -1
- package/out/fr/departement.js +3 -0
- package/out/fr/departement.js.map +1 -1
- package/out/fr/index.d.ts +5 -5
- package/out/fr/index.d.ts.map +1 -1
- package/out/fr/index.js +5 -5
- package/out/fr/index.js.map +1 -1
- package/out/fr/region.d.ts.map +1 -1
- package/out/fr/region.js +1 -1
- package/out/fr/region.js.map +1 -1
- package/out/fr/voie.d.ts.map +1 -1
- package/out/fr/voie.js +4 -11
- package/out/fr/voie.js.map +1 -1
- package/out/gb/country.d.ts.map +1 -1
- package/out/gb/country.js +1 -9
- package/out/gb/country.js.map +1 -1
- package/out/gb/index.d.ts +4 -4
- package/out/gb/index.d.ts.map +1 -1
- package/out/gb/index.js +4 -4
- package/out/gb/index.js.map +1 -1
- package/out/gb/postcode-area.d.ts +1 -1
- package/out/gb/postcode-area.d.ts.map +1 -1
- package/out/gb/postcode-area.js.map +1 -1
- package/out/gb/postcode.d.ts.map +1 -1
- package/out/gb/postcode.js.map +1 -1
- package/out/gb/street-type.d.ts +1 -1
- package/out/gb/street-type.d.ts.map +1 -1
- package/out/gb/street-type.js +1 -1
- package/out/gb/street-type.js.map +1 -1
- package/out/index.d.ts +12 -12
- package/out/index.d.ts.map +1 -1
- package/out/index.js +12 -12
- package/out/index.js.map +1 -1
- package/out/it/cap.d.ts +11 -0
- package/out/it/cap.d.ts.map +1 -1
- package/out/it/cap.js +19 -2
- package/out/it/cap.js.map +1 -1
- package/out/it/index.d.ts +1 -1
- package/out/it/index.d.ts.map +1 -1
- package/out/it/index.js +1 -1
- package/out/it/index.js.map +1 -1
- package/out/jp/address-unit.d.ts.map +1 -1
- package/out/jp/address-unit.js.map +1 -1
- package/out/jp/index.d.ts +3 -3
- package/out/jp/index.d.ts.map +1 -1
- package/out/jp/index.js +3 -3
- package/out/jp/index.js.map +1 -1
- package/out/jp/postal-code.d.ts.map +1 -1
- package/out/jp/postal-code.js.map +1 -1
- package/out/jp/prefecture.d.ts +4 -1
- package/out/jp/prefecture.d.ts.map +1 -1
- package/out/jp/prefecture.js +6 -5
- package/out/jp/prefecture.js.map +1 -1
- package/out/level-semantics.d.ts.map +1 -1
- package/out/level-semantics.js.map +1 -1
- package/out/normalize.d.ts +8 -0
- package/out/normalize.d.ts.map +1 -1
- package/out/normalize.js +14 -1
- package/out/normalize.js.map +1 -1
- package/out/nz/delivery-service.d.ts +1 -1
- package/out/nz/delivery-service.d.ts.map +1 -1
- package/out/nz/delivery-service.js +1 -1
- package/out/nz/delivery-service.js.map +1 -1
- package/out/nz/index.d.ts +2 -2
- package/out/nz/index.d.ts.map +1 -1
- package/out/nz/index.js +2 -2
- package/out/nz/index.js.map +1 -1
- package/out/nz/postcode.d.ts.map +1 -1
- package/out/nz/postcode.js.map +1 -1
- package/out/postcode-systems.d.ts +26 -15
- package/out/postcode-systems.d.ts.map +1 -1
- package/out/postcode-systems.js +38 -23
- package/out/postcode-systems.js.map +1 -1
- package/out/tools/build-country-surface-lexicon.d.ts +1 -1
- package/out/tools/build-country-surface-lexicon.d.ts.map +1 -1
- package/out/tools/build-country-surface-lexicon.js +10 -9
- package/out/tools/build-country-surface-lexicon.js.map +1 -1
- package/out/tools/export-country-surfaces.d.ts +1 -1
- package/out/tools/export-country-surfaces.d.ts.map +1 -1
- package/out/tools/export-country-surfaces.js +7 -7
- package/out/tools/export-country-surfaces.js.map +1 -1
- package/out/tools/generate-country-population.d.ts.map +1 -1
- package/out/tools/generate-country-population.js +4 -4
- package/out/tools/generate-country-population.js.map +1 -1
- package/out/tools/generate-country-reference.d.ts.map +1 -1
- package/out/tools/generate-country-reference.js +4 -4
- package/out/tools/generate-country-reference.js.map +1 -1
- package/out/tools/generate-official-languages.d.ts.map +1 -1
- package/out/tools/generate-official-languages.js +7 -7
- package/out/tools/generate-official-languages.js.map +1 -1
- package/out/tools/index.d.ts +3 -3
- package/out/tools/index.d.ts.map +1 -1
- package/out/tools/index.js +3 -3
- package/out/tools/index.js.map +1 -1
- package/out/us/floor-designator.d.ts.map +1 -1
- package/out/us/floor-designator.js.map +1 -1
- package/out/us/index.d.ts +8 -8
- package/out/us/index.d.ts.map +1 -1
- package/out/us/index.js +8 -8
- package/out/us/index.js.map +1 -1
- package/out/us/military-address.d.ts.map +1 -1
- package/out/us/military-address.js.map +1 -1
- package/out/us/po-box.d.ts +1 -1
- package/out/us/po-box.d.ts.map +1 -1
- package/out/us/po-box.js +1 -1
- package/out/us/po-box.js.map +1 -1
- package/out/us/state.d.ts.map +1 -1
- package/out/us/state.js.map +1 -1
- package/out/us/street-directional.d.ts.map +1 -1
- package/out/us/street-directional.js +2 -2
- package/out/us/street-directional.js.map +1 -1
- package/out/us/street-suffix.d.ts +1 -1
- package/out/us/street-suffix.d.ts.map +1 -1
- package/out/us/street-suffix.js +1 -1
- package/out/us/street-suffix.js.map +1 -1
- package/out/us/unit-designator.d.ts +1 -1
- package/out/us/unit-designator.d.ts.map +1 -1
- package/out/us/unit-designator.js +1 -1
- package/out/us/unit-designator.js.map +1 -1
- package/out/us/zipcode.d.ts +1 -1
- package/out/us/zipcode.d.ts.map +1 -1
- package/out/us/zipcode.js +1 -1
- package/out/us/zipcode.js.map +1 -1
- package/package.json +70 -269
- package/country/index.ts +0 -17
- /package/{au → lib/au}/delivery-service.ts +0 -0
- /package/{au → lib/au}/level-designator.ts +0 -0
- /package/{au → lib/au}/postcode.ts +0 -0
- /package/{au → lib/au}/state.ts +0 -0
- /package/{country → lib/country}/display-names.ts +0 -0
- /package/{country → lib/country}/names.ts +0 -0
- /package/{country → lib/country}/official-languages.ts +0 -0
- /package/{country → lib/country}/population.ts +0 -0
- /package/{country → lib/country}/reference-data.ts +0 -0
- /package/{de → lib/de}/bundesland.ts +0 -0
- /package/{de → lib/de}/postleitzahl.ts +0 -0
- /package/{de → lib/de}/street-type.ts +0 -0
- /package/{gb → lib/gb}/postcode.ts +0 -0
- /package/{jp → lib/jp}/address-unit.ts +0 -0
- /package/{jp → lib/jp}/postal-code.ts +0 -0
- /package/{level-semantics.ts → lib/level-semantics.ts} +0 -0
- /package/{nz → lib/nz}/postcode.ts +0 -0
- /package/{us → lib/us}/floor-designator.ts +0 -0
- /package/{us → lib/us}/military-address.ts +0 -0
- /package/{us → lib/us}/state.ts +0 -0
- /package/{us → lib/us}/street-suffix.json +0 -0
package/out/postcode-systems.js
CHANGED
|
@@ -10,24 +10,26 @@
|
|
|
10
10
|
*
|
|
11
11
|
* It is the shared source of truth for "which systems can this shape be" — consumed by the postcode
|
|
12
12
|
* anchor (to narrow which systems' street vocabularies it checks) and, in time, by the runtime
|
|
13
|
-
* pipeline's locale
|
|
13
|
+
* pipeline's `@mailwoman/locale-hint` stage (so its format→locale scoring derives from the same patterns rather than
|
|
14
14
|
* a second, divergent copy). The point is to unify the DATA, not to couple the modules: callers
|
|
15
15
|
* depend on this pure function, never on each other.
|
|
16
16
|
*
|
|
17
17
|
* Note this is a SHAPE test, not a gazetteer-membership test. A bare `68161` matches the US,
|
|
18
|
-
* German,
|
|
19
|
-
* split the numeric-postcode systems. The anchor uses real gazetteer membership for the finer
|
|
18
|
+
* German, French, Spanish and Italian 5-digit shapes, so it returns `["us", "de", "fr", "es", "it"]` —
|
|
19
|
+
* the shape alone cannot split the numeric-postcode systems. The anchor uses real gazetteer membership for the finer
|
|
20
20
|
* call; this function answers the coarser, model-free "which systems is this shape even eligible
|
|
21
21
|
* for".
|
|
22
22
|
*/
|
|
23
|
-
import { normalizeAuPostcode } from "
|
|
24
|
-
import { normalizeCaPostalCode } from "
|
|
25
|
-
import { normalizePLZ } from "
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
23
|
+
import { normalizeAuPostcode } from "#au/index";
|
|
24
|
+
import { normalizeCaPostalCode } from "#ca/index";
|
|
25
|
+
import { normalizePLZ } from "#de/index";
|
|
26
|
+
import { normalizeCodigoPostal } from "#es/index";
|
|
27
|
+
import { normalizeCodePostal } from "#fr/index";
|
|
28
|
+
import { normalizeUkPostcode } from "#gb/index";
|
|
29
|
+
import { normalizeCAP } from "#it/index";
|
|
30
|
+
import { normalizeJpPostalCode } from "#jp/index";
|
|
31
|
+
import { normalizeNZPostcode } from "#nz/index";
|
|
32
|
+
import { isZipCode } from "#us/index";
|
|
31
33
|
/**
|
|
32
34
|
* Per-system membership test: each entry returns true when the string is accepted by that system's own postcode shape
|
|
33
35
|
* (after that system's normalization — so `D-68161` reaches `de`, `1012 LM` reaches nothing here since NL has no slice
|
|
@@ -37,12 +39,19 @@ const SYSTEM_ACCEPTS = [
|
|
|
37
39
|
["us", (s) => isZipCode(s)],
|
|
38
40
|
["de", (s) => normalizePLZ(s) !== null],
|
|
39
41
|
["fr", (s) => normalizeCodePostal(s) !== null],
|
|
42
|
+
["es", (s) => normalizeCodigoPostal(s) !== null],
|
|
43
|
+
["it", (s) => normalizeCAP(s) !== null],
|
|
40
44
|
["ca", (s) => normalizeCaPostalCode(s) !== null],
|
|
41
45
|
["gb", (s) => normalizeUkPostcode(s) !== null],
|
|
42
46
|
["jp", (s) => normalizeJpPostalCode(s) !== null],
|
|
43
47
|
["au", (s) => normalizeAuPostcode(s) !== null],
|
|
44
48
|
["nz", (s) => normalizeNZPostcode(s) !== null],
|
|
45
49
|
];
|
|
50
|
+
/**
|
|
51
|
+
* Every address system with a postcode shape, in {@link SYSTEM_ACCEPTS} order. The one list a consumer that needs the
|
|
52
|
+
* universe of systems (rather than the systems a given code fits) should read, so it cannot drift from the table.
|
|
53
|
+
*/
|
|
54
|
+
export const SYSTEM_CODES = SYSTEM_ACCEPTS.map(([system]) => system);
|
|
46
55
|
/**
|
|
47
56
|
* Every address system whose own postcode shape accepts `postcode`. Empty when no system recognizes the shape (e.g. a
|
|
48
57
|
* bare `27`, or a 7-digit run). O(number of systems) — a handful of cheap regex tests, run only on the few
|
|
@@ -142,22 +151,28 @@ export function isUnitGradePostcodeHit(parsed, resolverName) {
|
|
|
142
151
|
* Membership is earned by a full-panel measurement, the same bar {@link UNIT_GRADE_POSTCODE} sets for CA. Coordinate
|
|
143
152
|
* p50 on the OpenAddresses panels, locality-first (the default) against the postcode point:
|
|
144
153
|
*
|
|
145
|
-
* | country | rows | locality-first | postcode point | verdict
|
|
146
|
-
* | ------- | ----: | -------------: | -------------: |
|
|
147
|
-
* | **DE** | 2,997 | 5.84 km | **1.24 km** | postcode, on EVERY percentile incl. p99 (21.50 → 10.57)
|
|
148
|
-
* | FR | 3,000 | **0.97 km** | 2.64 km | locality, closer on 77.5% of rows
|
|
149
|
-
* | IT | 2,833 | **1.34 km** | 3.05 km | locality, closer on 66.4%
|
|
150
|
-
* | ES | 2,929 | **0.68 km** | 0.97 km | locality, but near a coin flip — 46.1% of rows prefer the postcode
|
|
151
|
-
* | US | 577 | **2.28 km** | 4.15 km | locality (see below)
|
|
154
|
+
* | country | rows | locality-first | postcode point | verdict |
|
|
155
|
+
* | ------- | ----: | -------------: | -------------: | ---------------------------------------------------------------------- |
|
|
156
|
+
* | **DE** | 2,997 | 5.84 km | **1.24 km** | postcode, on EVERY percentile incl. p99 (21.50 → 10.57) |
|
|
157
|
+
* | FR | 3,000 | **0.97 km** | 2.64 km | locality, closer on 77.5% of rows |
|
|
158
|
+
* | IT | 2,833 | **1.34 km** | 3.05 km | locality, closer on 66.4% |
|
|
159
|
+
* | ES | 2,929 | **0.68 km** | 0.97 km | locality, but near a coin flip — 46.1% of rows prefer the postcode |
|
|
160
|
+
* | US | 577 | **2.28 km** | 4.15 km | locality (see below) |
|
|
161
|
+
* | **JP** | 586 | 4.93 km | **0.48 km** | postcode, closer on 97.3% of rows (p90 13.55 → 1.21, p99 19.63 → 3.54) |
|
|
152
162
|
*
|
|
153
163
|
* **The US row is measured on the population production actually sends to the ladder.** Its rooftop cascade is US-only
|
|
154
164
|
* by construction (`selectAddressPointsDB` composes `address-points-us-<slug>.db`), and it serves 94.2% of US queries,
|
|
155
|
-
* so only 577 of 10,000 panel rows reach an admin decision at all. Those are the rows no rooftop or interpolation
|
|
156
|
-
* could place, which skews rural — exactly where a locality centroid sits close and a ZIP zone is wide.
|
|
157
|
-
* all 10,000 rows instead, the US looks like a postcode-first country (2.41 km vs 3.63); that is a
|
|
158
|
-
* and it is why this table reports 577 rows for the US and full panels for the others, which have no
|
|
165
|
+
* so only 577 of 10,000 panel rows reach an admin decision at all. Those are the rows no rooftop or interpolation
|
|
166
|
+
* extract could place, which skews rural — exactly where a locality centroid sits close and a ZIP zone is wide.
|
|
167
|
+
* Measured over all 10,000 rows instead, the US looks like a postcode-first country (2.41 km vs 3.63); that is a
|
|
168
|
+
* selection effect, and it is why this table reports 577 rows for the US and full panels for the others, which have no
|
|
169
|
+
* such cascade.
|
|
170
|
+
*
|
|
171
|
+
* **The JP row is the JP board through the served path** (`jp-served-resolve.run.ts`, 2,000 rows, seed 42): the 586
|
|
172
|
+
* rows carrying a postcode the candidate table keys, graded on the row's own entrance point — the locality-first answer
|
|
173
|
+
* is the municipality centroid, the postcode answer the code's 町域 centroid from the WOF extract.
|
|
159
174
|
*/
|
|
160
|
-
export const AREA_POSTCODE_FINER_THAN_LOCALITY = new Set(["DE"]);
|
|
175
|
+
export const AREA_POSTCODE_FINER_THAN_LOCALITY = new Set(["DE", "JP"]);
|
|
161
176
|
/**
|
|
162
177
|
* True when this country's area-grade postal code outranks its locality. Absent or unknown country → false, so the
|
|
163
178
|
* locality-first convention is what an unscoped query gets.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-systems.js","sourceRoot":"","sources":["../postcode-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"postcode-systems.js","sourceRoot":"","sources":["../lib/postcode-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AACj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EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAE7E,OAAO,KAAK,CAAC,YAAY,IAAI,EAAE,CAAC,KAAK,KAAK,CAAC,KAAK,CAAC,CAAA;AAClD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAE3F;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAA2B;IACpE,OAAO,OAAO,KAAK,SAAS,IAAI,iCAAiC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;AACpG,CAAC"}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
*
|
|
35
35
|
* Source of truth: `@mailwoman/codex` (COUNTRY_SURFACE_FORMS + ISO2_TO_NAME) — the SAME data the
|
|
36
36
|
* corpus-python bridge `country-surfaces.json` is generated from (export-country-surfaces.ts), so
|
|
37
|
-
* the channel and the corpus
|
|
37
|
+
* the channel and the corpus extract synthesizer cannot diverge on what a country surface IS.
|
|
38
38
|
*
|
|
39
39
|
* Output: data/gazetteer/country-surface-lexicon-v1.json (small, committed, provenance-tracked).
|
|
40
40
|
* Regenerate: `node codex/tools/build-country-surface-lexicon.ts`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-country-surface-lexicon.d.ts","sourceRoot":"","sources":["../../tools/build-country-surface-lexicon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG"}
|
|
1
|
+
{"version":3,"file":"build-country-surface-lexicon.d.ts","sourceRoot":"","sources":["../../lib/tools/build-country-surface-lexicon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG"}
|
|
@@ -34,16 +34,17 @@
|
|
|
34
34
|
*
|
|
35
35
|
* Source of truth: `@mailwoman/codex` (COUNTRY_SURFACE_FORMS + ISO2_TO_NAME) — the SAME data the
|
|
36
36
|
* corpus-python bridge `country-surfaces.json` is generated from (export-country-surfaces.ts), so
|
|
37
|
-
* the channel and the corpus
|
|
37
|
+
* the channel and the corpus extract synthesizer cannot diverge on what a country surface IS.
|
|
38
38
|
*
|
|
39
39
|
* Output: data/gazetteer/country-surface-lexicon-v1.json (small, committed, provenance-tracked).
|
|
40
40
|
* Regenerate: `node codex/tools/build-country-surface-lexicon.ts`
|
|
41
41
|
*/
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
42
|
+
import { makeDirectories, writeLocalTextFile } from "@mailwoman/core/fs/writers";
|
|
43
|
+
import { repoRootPath } from "@mailwoman/core/paths";
|
|
44
|
+
import { dirname } from "path-ts";
|
|
45
|
+
import { COUNTRY_SURFACE_FORMS, ISO2_TO_NAME } from "#country/country";
|
|
46
|
+
import { wordNorm, wordNormLower } from "#normalize";
|
|
47
|
+
import { US_STATE_ABBREVIATIONS, US_STATE_NAMES } from "#us/state";
|
|
47
48
|
/**
|
|
48
49
|
* Ambiguous entries printed before the list is truncated.
|
|
49
50
|
*/
|
|
@@ -58,7 +59,7 @@ const SLOTS = ["country_surface", "country_ambiguous"];
|
|
|
58
59
|
* Committed output path (a codex-derived artifact, like export-country-surfaces.ts — no argv, so the no-process-globals
|
|
59
60
|
* lint policy holds; codex stays zero-runtime-dep).
|
|
60
61
|
*/
|
|
61
|
-
const OUTPUT =
|
|
62
|
+
const OUTPUT = repoRootPath("data", "gazetteer", "country-surface-lexicon-v1.json");
|
|
62
63
|
/**
|
|
63
64
|
* THE shared word-normalization rule (identical to build-gazetteer-anchor-lexicon.mjs and mirrored in
|
|
64
65
|
* gazetteer_char_paint on both sides): per whitespace-word, strip LEADING/TRAILING characters that are not Unicode
|
|
@@ -141,8 +142,8 @@ const lexicon = {
|
|
|
141
142
|
entries: Object.fromEntries([...entries].toSorted(([a], [b]) => a.localeCompare(b))),
|
|
142
143
|
code_entries: Object.fromEntries([...codeEntries].toSorted(([a], [b]) => a.localeCompare(b))),
|
|
143
144
|
};
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
await makeDirectories(dirname(OUTPUT));
|
|
146
|
+
await writeLocalTextFile(JSON.stringify(lexicon, null, 1) + "\n", OUTPUT);
|
|
146
147
|
process.stderr.write(`wrote ${OUTPUT}: ${entries.size} entries + ${codeEntries.size} code_entries, ` +
|
|
147
148
|
`max_ngram=${maxNgram}, ${ambiguousEntries.length} ambiguous: ${ambiguousEntries.slice(0, MAX_LISTED_AMBIGUOUS).join(", ")}${ambiguousEntries.length > MAX_LISTED_AMBIGUOUS ? ", …" : ""}\n`);
|
|
148
149
|
//# sourceMappingURL=build-country-surface-lexicon.js.map
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"build-country-surface-lexicon.js","sourceRoot":"","sources":["../../lib/tools/build-country-surface-lexicon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AACtE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACpD,O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,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACpF,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7F,CAAA;AAED,MAAM,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAA;AACtC,MAAM,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAA;AAEzE,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,oBAAoB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAC7L,CAAA"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* codex → corpus-python bridge: emit the authoritative country surface forms as JSON so the Python
|
|
7
|
-
*
|
|
7
|
+
* extract generators can synthesize address tails ("…, USA" / "…, United States of America") without
|
|
8
8
|
* re-deriving the country name/alias data. `@mailwoman/codex` stays the single source of truth
|
|
9
9
|
* (COUNTRY_SURFACE_FORMS + ISO2_TO_NAME, salvaged from isp-nexus spatial/countries); this writes a
|
|
10
10
|
* snapshot the language boundary can't import directly.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-country-surfaces.d.ts","sourceRoot":"","sources":["../../tools/export-country-surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
1
|
+
{"version":3,"file":"export-country-surfaces.d.ts","sourceRoot":"","sources":["../../lib/tools/export-country-surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* codex → corpus-python bridge: emit the authoritative country surface forms as JSON so the Python
|
|
7
|
-
*
|
|
7
|
+
* extract generators can synthesize address tails ("…, USA" / "…, United States of America") without
|
|
8
8
|
* re-deriving the country name/alias data. `@mailwoman/codex` stays the single source of truth
|
|
9
9
|
* (COUNTRY_SURFACE_FORMS + ISO2_TO_NAME, salvaged from isp-nexus spatial/countries); this writes a
|
|
10
10
|
* snapshot the language boundary can't import directly.
|
|
11
11
|
*
|
|
12
12
|
* Regenerate: `node codex/tools/export-country-surfaces.ts` (writes the corpus-python data file).
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { COUNTRY_SURFACE_FORMS, ISO2_TO_NAME } from "
|
|
14
|
+
import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
|
|
15
|
+
import { repoRootPath } from "@mailwoman/core/paths";
|
|
16
|
+
import { COUNTRY_SURFACE_FORMS, ISO2_TO_NAME } from "#country/country";
|
|
17
17
|
// Merge: rich surface forms where the codex curates them, else the canonical English name for every
|
|
18
18
|
// ISO 3166-1 alpha-2. Canonical-name-first (the codex's own ordering) so the common form leads.
|
|
19
19
|
const surfaces = {};
|
|
@@ -25,10 +25,10 @@ for (const [iso2, name] of ISO2_TO_NAME) {
|
|
|
25
25
|
surfaces[iso2] = [name];
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const out =
|
|
29
|
-
|
|
28
|
+
const out = repoRootPath("corpus-python", "src", "mailwoman_train", "data", "country-surfaces.json");
|
|
29
|
+
await writeLocalTextFile(JSON.stringify({
|
|
30
30
|
_generated: "codex/tools/export-country-surfaces.ts from @mailwoman/codex COUNTRY_SURFACE_FORMS + ISO2_TO_NAME",
|
|
31
31
|
surfaces,
|
|
32
|
-
}, null, 2) + "\n");
|
|
32
|
+
}, null, 2) + "\n", out);
|
|
33
33
|
process.stderr.write(`wrote ${Object.keys(surfaces).length} countries → ${out}\n`);
|
|
34
34
|
//# sourceMappingURL=export-country-surfaces.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-country-surfaces.js","sourceRoot":"","sources":["../../tools/export-country-surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"export-country-surfaces.js","sourceRoot":"","sources":["../../lib/tools/export-country-surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAEtE,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,YAAY,CAAC,eAAe,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,uBAAuB,CAAC,CAAA;AAEpG,MAAM,kBAAkB,CACvB,IAAI,CAAC,SAAS,CACb;IACC,UAAU,EAAE,mGAAmG;IAC/G,QAAQ;CACR,EACD,IAAI,EACJ,CAAC,CACD,GAAG,IAAI,EACR,GAAG,CACH,CAAA;AAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-country-population.d.ts","sourceRoot":"","sources":["../../tools/generate-country-population.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"generate-country-population.d.ts","sourceRoot":"","sources":["../../lib/tools/generate-country-population.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAmCH;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,GAAE,gCAAqC,EAC9C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,gCAAgC,CAAC,CA8D3C"}
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
*
|
|
20
20
|
* Usage: mailwoman dev generate country-population
|
|
21
21
|
*/
|
|
22
|
-
import { writeFileSync } from "node:fs";
|
|
23
|
-
import { fileURLToPath } from "node:url";
|
|
24
22
|
import { APIClient, pluckResponseData } from "@mailwoman/core/api";
|
|
23
|
+
import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
|
|
24
|
+
import { resolvePackagePath } from "@mailwoman/core/module/resolvers";
|
|
25
25
|
const SOURCE = "https://download.geonames.org/export/dump/countryInfo.txt";
|
|
26
26
|
/**
|
|
27
27
|
* The committed output path, resolved relative to this module (codex/tools/ → codex/country/). See
|
|
28
28
|
* `generate-country-reference.ts` for why this is `import.meta.url` rather than a `core` path helper (codex is
|
|
29
29
|
* zero-runtime-dep and `core` already references `codex` — importing core here would cycle the project graph).
|
|
30
30
|
*/
|
|
31
|
-
const DEFAULT_OUT =
|
|
31
|
+
const DEFAULT_OUT = resolvePackagePath("@mailwoman/codex", "lib", "country", "population.ts");
|
|
32
32
|
/**
|
|
33
33
|
* Tab positions this tool reads from `countryInfo.txt`'s 19-column rows. Named so the parse states which columns it
|
|
34
34
|
* believes in; a GeoNames format change fails the count guard below rather than silently reading the wrong column.
|
|
@@ -99,7 +99,7 @@ export async function generateCountryPopulation(options = {}, report) {
|
|
|
99
99
|
* ISO 3166-1 alpha-2 → population estimate.
|
|
100
100
|
*/
|
|
101
101
|
export const COUNTRY_POPULATION: Readonly<Record<string, number>> = {`;
|
|
102
|
-
|
|
102
|
+
await writeLocalTextFile(`${header}\n${body}\n}\n`, outPath);
|
|
103
103
|
report?.(`wrote ${outPath} (${Object.keys(rows).length} countries)`);
|
|
104
104
|
return { countries: Object.keys(rows).length, outPath };
|
|
105
105
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-country-population.js","sourceRoot":"","sources":["../../tools/generate-country-population.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate-country-population.js","sourceRoot":"","sources":["../../lib/tools/generate-country-population.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS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MAAM,EAAE,CAAC,SAAS,OAAO,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,CAAA;IAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAA;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-country-reference.d.ts","sourceRoot":"","sources":["../../tools/generate-country-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"generate-country-reference.d.ts","sourceRoot":"","sources":["../../lib/tools/generate-country-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiCH;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CACf;AA6BD;;GAEG;AACH,wBAAsB,wBAAwB,CAC7C,OAAO,GAAE,+BAAoC,EAC7C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,+BAA+B,CAAC,CAqE1C"}
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Usage: mailwoman dev generate country-reference
|
|
15
15
|
*/
|
|
16
|
-
import { writeFileSync } from "node:fs";
|
|
17
|
-
import { fileURLToPath } from "node:url";
|
|
18
16
|
import { APIClient, pluckResponseData } from "@mailwoman/core/api";
|
|
17
|
+
import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
|
|
18
|
+
import { resolvePackagePath } from "@mailwoman/core/module/resolvers";
|
|
19
19
|
const SOURCE = "https://raw.githubusercontent.com/mledoze/countries/master/countries.json";
|
|
20
20
|
/**
|
|
21
21
|
* The committed output path, resolved relative to this module (codex/tools/ → codex/country/). The codegen is
|
|
@@ -23,7 +23,7 @@ const SOURCE = "https://raw.githubusercontent.com/mledoze/countries/master/count
|
|
|
23
23
|
* `import.meta.url` points at the source tree. (`@mailwoman/core`'s `repoRootPath` would also work, but codex is
|
|
24
24
|
* zero-runtime-dep and `core` already references `codex` — importing core here would cycle the project graph.)
|
|
25
25
|
*/
|
|
26
|
-
const DEFAULT_OUT =
|
|
26
|
+
const DEFAULT_OUT = resolvePackagePath("@mailwoman/codex", "lib", "country", "reference-data.ts");
|
|
27
27
|
function callingCode(country) {
|
|
28
28
|
const root = (country.idd?.root ?? "").replace("+", "");
|
|
29
29
|
const suffixes = country.idd?.suffixes ?? [];
|
|
@@ -100,7 +100,7 @@ export interface CountryReference {
|
|
|
100
100
|
|
|
101
101
|
/** ISO 3166-1 alpha-2 → reference. */
|
|
102
102
|
export const COUNTRY_REFERENCE: Record<string, CountryReference> = {`;
|
|
103
|
-
|
|
103
|
+
await writeLocalTextFile(`${header}\n${body}\n}\n`, outPath);
|
|
104
104
|
report?.(`wrote ${outPath} (${Object.keys(rows).length} countries)`);
|
|
105
105
|
return { countries: Object.keys(rows).length, outPath };
|
|
106
106
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-country-reference.js","sourceRoot":"","sources":["../../tools/generate-country-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate-country-reference.js","sourceRoot":"","sources":["../../lib/tools/generate-country-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAErE,MAAM,MAAM,GAAG,2EAA2E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gBACjB,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;YACpC,CAAC;QACF,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,GAAG,KAAK,CAAA;QACrB,CAAC;IACF,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5B,QAAQ,EAAE;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,GAAG,CAAC;SAC7C,IAAI,CAAC,IAAI,CAAC,CAAA;IAEZ,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;qEAiBqD,CAAA;IAEpE,MAAM,kBAAkB,CAAC,GAAG,MAAM,KAAK,IAAI,OAAO,EAAE,OAAO,CAAC,CAAA;IAC5D,MAAM,EAAE,CAAC,SAAS,OAAO,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,aAAa,CAAC,CAAA;IAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,CAAA;AACxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-official-languages.d.ts","sourceRoot":"","sources":["../../tools/generate-official-languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;
|
|
1
|
+
{"version":3,"file":"generate-official-languages.d.ts","sourceRoot":"","sources":["../../lib/tools/generate-official-languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAcH;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CACf;AAsBD;;GAEG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,GAAE,gCAAqC,EAC9C,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,gCAAgC,CAAC,CA2H3C"}
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
* With `cldrDir`, reads cldr-territoryInfo.json + cldr-aliases.json from disk; otherwise fetches
|
|
19
19
|
* the pinned cldr-core release from jsdelivr.
|
|
20
20
|
*/
|
|
21
|
-
import { readFileSync, writeFileSync } from "node:fs";
|
|
22
|
-
import { join } from "node:path";
|
|
23
|
-
import { fileURLToPath } from "node:url";
|
|
24
21
|
import { APIClient, pluckResponseData } from "@mailwoman/core/api";
|
|
25
|
-
import {
|
|
22
|
+
import { readLocalJSONFile } from "@mailwoman/core/fs/readers";
|
|
23
|
+
import { writeLocalFile } from "@mailwoman/core/fs/writers";
|
|
24
|
+
import { resolvePackagePath } from "@mailwoman/core/module/resolvers";
|
|
25
|
+
import { join } from "path-ts";
|
|
26
26
|
/**
|
|
27
27
|
* The committed output path, resolved relative to this module (codex/tools/ → codex/country/). The codegen is
|
|
28
28
|
* repo-only, and in the repo `@mailwoman/codex/tools` always loads from source via the `node` exports condition, so
|
|
29
29
|
* `import.meta.url` points at the source tree.
|
|
30
30
|
*/
|
|
31
|
-
const DEFAULT_OUT =
|
|
31
|
+
const DEFAULT_OUT = resolvePackagePath("@mailwoman/codex", "lib", "country", "official-languages.ts");
|
|
32
32
|
/**
|
|
33
33
|
* One call per CLDR supplemental file, against a CDN that throttles. Retry only — the caller makes a handful of
|
|
34
34
|
* requests, so a rate budget would be ceremony over a burst that never happens.
|
|
@@ -36,7 +36,7 @@ const DEFAULT_OUT = fileURLToPath(new URL("../country/official-languages.ts", im
|
|
|
36
36
|
const cldrClient = new APIClient({ displayName: "cldr", retry: true });
|
|
37
37
|
async function loadCLDR(file, cldrDir, cldrVersion) {
|
|
38
38
|
if (cldrDir) {
|
|
39
|
-
return
|
|
39
|
+
return await readLocalJSONFile(join(cldrDir, `cldr-${file}.json`));
|
|
40
40
|
}
|
|
41
41
|
const url = `https://cdn.jsdelivr.net/npm/cldr-core@${cldrVersion}/supplemental/${file}.json`;
|
|
42
42
|
return cldrClient.fetch({ url }).then(pluckResponseData);
|
|
@@ -142,7 +142,7 @@ export function isOfficialLanguage(country: string, language: string, includeReg
|
|
|
142
142
|
return entry.official.includes(lang) || (includeRegional && (entry.regional?.includes(lang) ?? false))
|
|
143
143
|
}
|
|
144
144
|
`;
|
|
145
|
-
|
|
145
|
+
await writeLocalFile(header, outPath);
|
|
146
146
|
report?.(`Wrote ${outPath}: ${Object.keys(table).length} territories (CLDR ${cldrVersion})`);
|
|
147
147
|
return { territories: Object.keys(table).length, cldrVersion, outPath };
|
|
148
148
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-official-languages.js","sourceRoot":"","sources":["../../tools/generate-official-languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate-official-languages.js","sourceRoot":"","sources":["../../lib/tools/generate-official-languages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,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3F,OAAO,KAAK,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;IACvF,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAA;IAEZ,MAAM,MAAM,GAAG;;;;;;oBAMI,WAAW;;;;;;;;;;;;;;;;;;EAkB7B,OAAO;;;;;;;;;;;;;;;CAeR,CAAA;IAEA,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,MAAM,EAAE,CAAC,SAAS,OAAO,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,sBAAsB,WAAW,GAAG,CAAC,CAAA;IAE5F,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,CAAA;AACxE,CAAC"}
|
package/out/tools/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Codex operator tools — the `run()`-style modules behind `mailwoman dev generate …` commands. No
|
|
7
7
|
* argv, no `process.exit`: commands own parsing, rendering, and exit codes.
|
|
8
8
|
*/
|
|
9
|
-
export * from "
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
9
|
+
export * from "#tools/generate-country-population";
|
|
10
|
+
export * from "#tools/generate-country-reference";
|
|
11
|
+
export * from "#tools/generate-official-languages";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/out/tools/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA"}
|
package/out/tools/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Codex operator tools — the `run()`-style modules behind `mailwoman dev generate …` commands. No
|
|
7
7
|
* argv, no `process.exit`: commands own parsing, rendering, and exit codes.
|
|
8
8
|
*/
|
|
9
|
-
export * from "
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
9
|
+
export * from "#tools/generate-country-population";
|
|
10
|
+
export * from "#tools/generate-country-reference";
|
|
11
|
+
export * from "#tools/generate-official-languages";
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/out/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,oCAAoC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floor-designator.d.ts","sourceRoot":"","sources":["../../us/floor-designator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;IAC3B;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;EAKgB,CAAA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0B,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAA;AAC/F,CAAC"}
|
package/out/us/index.d.ts
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* (USPS Pub 28 Chapter 7: APO/FPO/DPO + PSC/CMR/UNIT), ZIP codes, and the state abbreviations
|
|
9
9
|
* they hang off of.
|
|
10
10
|
*/
|
|
11
|
-
export * from "
|
|
12
|
-
export * from "
|
|
13
|
-
export * from "
|
|
14
|
-
export * from "
|
|
15
|
-
export * from "
|
|
16
|
-
export * from "
|
|
17
|
-
export * from "
|
|
18
|
-
export * from "
|
|
11
|
+
export * from "#us/floor-designator";
|
|
12
|
+
export * from "#us/military-address";
|
|
13
|
+
export * from "#us/po-box";
|
|
14
|
+
export * from "#us/state";
|
|
15
|
+
export * from "#us/street-directional";
|
|
16
|
+
export * from "#us/street-suffix";
|
|
17
|
+
export * from "#us/unit-designator";
|
|
18
|
+
export * from "#us/zipcode";
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/out/us/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../us/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/us/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA"}
|
package/out/us/index.js
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
* (USPS Pub 28 Chapter 7: APO/FPO/DPO + PSC/CMR/UNIT), ZIP codes, and the state abbreviations
|
|
9
9
|
* they hang off of.
|
|
10
10
|
*/
|
|
11
|
-
export * from "
|
|
12
|
-
export * from "
|
|
13
|
-
export * from "
|
|
14
|
-
export * from "
|
|
15
|
-
export * from "
|
|
16
|
-
export * from "
|
|
17
|
-
export * from "
|
|
18
|
-
export * from "
|
|
11
|
+
export * from "#us/floor-designator";
|
|
12
|
+
export * from "#us/military-address";
|
|
13
|
+
export * from "#us/po-box";
|
|
14
|
+
export * from "#us/state";
|
|
15
|
+
export * from "#us/street-directional";
|
|
16
|
+
export * from "#us/street-suffix";
|
|
17
|
+
export * from "#us/unit-designator";
|
|
18
|
+
export * from "#us/zipcode";
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
package/out/us/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../us/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/us/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"military-address.d.ts","sourceRoot":"","sources":["../../us/military-address.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAchC,CAAA;AAEV,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7F;;;GAGG;AACH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U,kBAAkB,CAAC,KAAc;IAChD,OAAO,qBAAqB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAA;AAC7C,CAAC"}
|
package/out/us/po-box.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export interface PoBoxMatch {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* If `input` is a PO-box phrase ("PO Box 123", "P.O. Box 12-A", "Post Office Box 7"), return the designator phrase and
|
|
42
|
-
* the id. Null otherwise. Useful for the corpus po_box
|
|
42
|
+
* the id. Null otherwise. Useful for the corpus po_box extract (split the designator from the number) and for
|
|
43
43
|
* resolver/parsing reuse.
|
|
44
44
|
*/
|
|
45
45
|
export declare function matchPOBox(input: unknown): PoBoxMatch | null;
|