@mailwoman/codex 9.2.0 → 9.4.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 +4 -3
- package/lib/jp/municipality-register.ts +62 -0
- package/{jp → lib/jp}/prefecture.ts +7 -5
- package/lib/kr/index.ts +10 -0
- package/lib/kr/sigungu-register.ts +294 -0
- 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/lib/register-completion.ts +24 -0
- 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 +4 -3
- package/out/jp/index.d.ts.map +1 -1
- package/out/jp/index.js +4 -3
- package/out/jp/index.js.map +1 -1
- package/out/jp/municipality-register.d.ts +48 -0
- package/out/jp/municipality-register.d.ts.map +1 -0
- package/out/jp/municipality-register.js +41 -0
- package/out/jp/municipality-register.js.map +1 -0
- 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/kr/index.d.ts +10 -0
- package/out/kr/index.d.ts.map +1 -0
- package/out/kr/index.js +10 -0
- package/out/kr/index.js.map +1 -0
- package/out/kr/sigungu-register.d.ts +37 -0
- package/out/kr/sigungu-register.d.ts.map +1 -0
- package/out/kr/sigungu-register.js +283 -0
- package/out/kr/sigungu-register.js.map +1 -0
- 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/register-completion.d.ts +14 -0
- package/out/register-completion.d.ts.map +1 -0
- package/out/register-completion.js +23 -0
- package/out/register-completion.js.map +1 -0
- 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 +78 -267
- 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/normalize.d.ts
CHANGED
|
@@ -33,4 +33,12 @@ export declare function wordNorm(s: string): string;
|
|
|
33
33
|
* {@link wordNorm}, lower-cased — the case-insensitive lexicon key.
|
|
34
34
|
*/
|
|
35
35
|
export declare function wordNormLower(s: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Fold a single token to its lowercase, diacritic-free form: lower-cased, NFD-decomposed, combining marks stripped —
|
|
38
|
+
* `"Côte"` → `"cote"`, `"Tōkyō"` → `"tokyo"`.
|
|
39
|
+
*
|
|
40
|
+
* The shared core of the per-country token matchers. Unlike {@link foldName} it does not touch punctuation or whitespace
|
|
41
|
+
* — each matcher layers its own character filtering (letters-only, hyphen-keeping, suffix-stripping) on top.
|
|
42
|
+
*/
|
|
43
|
+
export declare function foldToken(s: string): string;
|
|
36
44
|
//# sourceMappingURL=normalize.d.ts.map
|
package/out/normalize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO1C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C"}
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../lib/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAO1C;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAK3C"}
|
package/out/normalize.js
CHANGED
|
@@ -39,7 +39,7 @@ export function wordNorm(s) {
|
|
|
39
39
|
return s
|
|
40
40
|
.split(/\s+/)
|
|
41
41
|
.map((w) => w.replaceAll(/^[^\p{L}\p{N}]+|[^\p{L}\p{N}]+$/gu, ""))
|
|
42
|
-
.filter(
|
|
42
|
+
.filter((w) => w.length > 0)
|
|
43
43
|
.join(" ");
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
@@ -48,4 +48,17 @@ export function wordNorm(s) {
|
|
|
48
48
|
export function wordNormLower(s) {
|
|
49
49
|
return wordNorm(s).toLowerCase();
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Fold a single token to its lowercase, diacritic-free form: lower-cased, NFD-decomposed, combining marks stripped —
|
|
53
|
+
* `"Côte"` → `"cote"`, `"Tōkyō"` → `"tokyo"`.
|
|
54
|
+
*
|
|
55
|
+
* The shared core of the per-country token matchers. Unlike {@link foldName} it does not touch punctuation or whitespace
|
|
56
|
+
* — each matcher layers its own character filtering (letters-only, hyphen-keeping, suffix-stripping) on top.
|
|
57
|
+
*/
|
|
58
|
+
export function foldToken(s) {
|
|
59
|
+
return s
|
|
60
|
+
.toLowerCase()
|
|
61
|
+
.normalize("NFD")
|
|
62
|
+
.replaceAll(/[\u0300-\u036F]/g, "");
|
|
63
|
+
}
|
|
51
64
|
//# sourceMappingURL=normalize.js.map
|
package/out/normalize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAClC,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;SAC9B,IAAI,EAAE,CAAA;AACT,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,mCAAmC,EAAE,EAAE,CAAC,CAAC;SACjE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../lib/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC;SAClC,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;SAC9B,IAAI,EAAE,CAAA;AACT,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,mCAAmC,EAAE,EAAE,CAAC,CAAC;SACjE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,IAAI,CAAC,GAAG,CAAC,CAAA;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,CAAS;IACtC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;AACjC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IAClC,OAAO,CAAC;SACN,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAAA;AACrC,CAAC"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* mail, accessed 2026-06-11) name only the six types above. However, real NZ mail and the postal
|
|
34
34
|
* arena's gold rows carry "Private Box" as a colloquial synonym for a numbered PO Box (same
|
|
35
35
|
* numbered format, different label). Operator ruling 2026-06-11: "Private Box = recognize-as-used
|
|
36
|
-
* — codex documents it unofficial/colloquial WITH the 'officially invalid' citation; the
|
|
36
|
+
* — codex documents it unofficial/colloquial WITH the 'officially invalid' citation; the extract
|
|
37
37
|
* teaches recognition (validity and recognition are separate disciplines, same as the AU legacy
|
|
38
38
|
* flags)." This is encoded in {@link NZ_PRIVATE_BOX_ALIAS} — a distinct export from
|
|
39
39
|
* {@link NZ_DELIVERY_SERVICE_TYPES} so callers can choose whether to include the unofficial form.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-service.d.ts","sourceRoot":"","sources":["../../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C,KAAK,EAAE,MAAM,GAAG,MAAM,CAMhE"}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* mail, accessed 2026-06-11) name only the six types above. However, real NZ mail and the postal
|
|
34
34
|
* arena's gold rows carry "Private Box" as a colloquial synonym for a numbered PO Box (same
|
|
35
35
|
* numbered format, different label). Operator ruling 2026-06-11: "Private Box = recognize-as-used
|
|
36
|
-
* — codex documents it unofficial/colloquial WITH the 'officially invalid' citation; the
|
|
36
|
+
* — codex documents it unofficial/colloquial WITH the 'officially invalid' citation; the extract
|
|
37
37
|
* teaches recognition (validity and recognition are separate disciplines, same as the AU legacy
|
|
38
38
|
* flags)." This is encoded in {@link NZ_PRIVATE_BOX_ALIAS} — a distinct export from
|
|
39
39
|
* {@link NZ_DELIVERY_SERVICE_TYPES} so callers can choose whether to include the unofficial form.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-service.js","sourceRoot":"","sources":["../../nz/delivery-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AA2BH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACxC,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,uBAAuB,EAAE;IACxF,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE;IAC3E,EAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,sCAAsC,EAAE,UAAU,EAAE,uBAAuB,EAAE;IAClH;QACC,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,0DAA0D;QACvE,UAAU,EAAE,uBAAuB;KACnC;IACD;QACC,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE,sDAAsD;QACnE,UAAU,EAAE,UAAU;KACtB;IACD;QACC,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,yDAAyD;Q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CAAA;AACzD,CAAC"}
|
package/out/nz/index.d.ts
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* delivery-service types (PO Box, Private Bag, CMB, Response Bag, Counter Delivery, Poste
|
|
8
8
|
* Restante) and the 4-digit postcode. NZ addresses carry no state/region line.
|
|
9
9
|
*/
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
10
|
+
export * from "#nz/delivery-service";
|
|
11
|
+
export * from "#nz/postcode";
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/out/nz/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../nz/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/nz/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA"}
|
package/out/nz/index.js
CHANGED
|
@@ -7,6 +7,6 @@
|
|
|
7
7
|
* delivery-service types (PO Box, Private Bag, CMB, Response Bag, Counter Delivery, Poste
|
|
8
8
|
* Restante) and the 4-digit postcode. NZ addresses carry no state/region line.
|
|
9
9
|
*/
|
|
10
|
-
export * from "
|
|
11
|
-
export * from "
|
|
10
|
+
export * from "#nz/delivery-service";
|
|
11
|
+
export * from "#nz/postcode";
|
|
12
12
|
//# sourceMappingURL=index.js.map
|
package/out/nz/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../nz/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/nz/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,cAAc,sBAAsB,CAAA;AACpC,cAAc,cAAc,CAAA"}
|
package/out/nz/postcode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode.d.ts","sourceRoot":"","sources":["../../nz/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAY,CAAA;AAE5C;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAKnE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
|
|
1
|
+
{"version":3,"file":"postcode.d.ts","sourceRoot":"","sources":["../../lib/nz/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;AAErD;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAY,CAAA;AAE5C;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAKnE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
|
package/out/nz/postcode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode.js","sourceRoot":"","sources":["../../nz/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAE5C;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IACxC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAEpB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAgB,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACpE,CAAC"}
|
|
1
|
+
{"version":3,"file":"postcode.js","sourceRoot":"","sources":["../../lib/nz/postcode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAcH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAA;AAE5C;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IACxC,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAEpB,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAgB,CAAC,CAAC,CAAC,IAAI,CAAA;AAC9D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACpE,CAAC"}
|
|
@@ -10,20 +10,25 @@
|
|
|
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
23
|
/**
|
|
24
24
|
* A codex address-system code — the subpath under `@mailwoman/codex/<system>`.
|
|
25
25
|
*/
|
|
26
|
-
export type SystemCode = "us" | "de" | "fr" | "ca" | "gb" | "jp" | "au" | "nz";
|
|
26
|
+
export type SystemCode = "us" | "de" | "fr" | "es" | "it" | "ca" | "gb" | "jp" | "au" | "nz";
|
|
27
|
+
/**
|
|
28
|
+
* Every address system with a postcode shape, in {@link SYSTEM_ACCEPTS} order. The one list a consumer that needs the
|
|
29
|
+
* universe of systems (rather than the systems a given code fits) should read, so it cannot drift from the table.
|
|
30
|
+
*/
|
|
31
|
+
export declare const SYSTEM_CODES: readonly SystemCode[];
|
|
27
32
|
/**
|
|
28
33
|
* Every address system whose own postcode shape accepts `postcode`. Empty when no system recognizes the shape (e.g. a
|
|
29
34
|
* bare `27`, or a 7-digit run). O(number of systems) — a handful of cheap regex tests, run only on the few
|
|
@@ -93,20 +98,26 @@ export declare function isUnitGradePostcodeHit(parsed: string, resolverName: str
|
|
|
93
98
|
* Membership is earned by a full-panel measurement, the same bar {@link UNIT_GRADE_POSTCODE} sets for CA. Coordinate
|
|
94
99
|
* p50 on the OpenAddresses panels, locality-first (the default) against the postcode point:
|
|
95
100
|
*
|
|
96
|
-
* | country | rows | locality-first | postcode point | verdict
|
|
97
|
-
* | ------- | ----: | -------------: | -------------: |
|
|
98
|
-
* | **DE** | 2,997 | 5.84 km | **1.24 km** | postcode, on EVERY percentile incl. p99 (21.50 → 10.57)
|
|
99
|
-
* | FR | 3,000 | **0.97 km** | 2.64 km | locality, closer on 77.5% of rows
|
|
100
|
-
* | IT | 2,833 | **1.34 km** | 3.05 km | locality, closer on 66.4%
|
|
101
|
-
* | ES | 2,929 | **0.68 km** | 0.97 km | locality, but near a coin flip — 46.1% of rows prefer the postcode
|
|
102
|
-
* | US | 577 | **2.28 km** | 4.15 km | locality (see below)
|
|
101
|
+
* | country | rows | locality-first | postcode point | verdict |
|
|
102
|
+
* | ------- | ----: | -------------: | -------------: | ---------------------------------------------------------------------- |
|
|
103
|
+
* | **DE** | 2,997 | 5.84 km | **1.24 km** | postcode, on EVERY percentile incl. p99 (21.50 → 10.57) |
|
|
104
|
+
* | FR | 3,000 | **0.97 km** | 2.64 km | locality, closer on 77.5% of rows |
|
|
105
|
+
* | IT | 2,833 | **1.34 km** | 3.05 km | locality, closer on 66.4% |
|
|
106
|
+
* | ES | 2,929 | **0.68 km** | 0.97 km | locality, but near a coin flip — 46.1% of rows prefer the postcode |
|
|
107
|
+
* | US | 577 | **2.28 km** | 4.15 km | locality (see below) |
|
|
108
|
+
* | **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) |
|
|
103
109
|
*
|
|
104
110
|
* **The US row is measured on the population production actually sends to the ladder.** Its rooftop cascade is US-only
|
|
105
111
|
* by construction (`selectAddressPointsDB` composes `address-points-us-<slug>.db`), and it serves 94.2% of US queries,
|
|
106
|
-
* so only 577 of 10,000 panel rows reach an admin decision at all. Those are the rows no rooftop or interpolation
|
|
107
|
-
* could place, which skews rural — exactly where a locality centroid sits close and a ZIP zone is wide.
|
|
108
|
-
* all 10,000 rows instead, the US looks like a postcode-first country (2.41 km vs 3.63); that is a
|
|
109
|
-
* and it is why this table reports 577 rows for the US and full panels for the others, which have no
|
|
112
|
+
* so only 577 of 10,000 panel rows reach an admin decision at all. Those are the rows no rooftop or interpolation
|
|
113
|
+
* extract could place, which skews rural — exactly where a locality centroid sits close and a ZIP zone is wide.
|
|
114
|
+
* Measured over all 10,000 rows instead, the US looks like a postcode-first country (2.41 km vs 3.63); that is a
|
|
115
|
+
* selection effect, and it is why this table reports 577 rows for the US and full panels for the others, which have no
|
|
116
|
+
* such cascade.
|
|
117
|
+
*
|
|
118
|
+
* **The JP row is the JP board through the served path** (`jp-served-resolve.run.ts`, 2,000 rows, seed 42): the 586
|
|
119
|
+
* rows carrying a postcode the candidate table keys, graded on the row's own entrance point — the locality-first answer
|
|
120
|
+
* is the municipality centroid, the postcode answer the code's 町域 centroid from the WOF extract.
|
|
110
121
|
*/
|
|
111
122
|
export declare const AREA_POSTCODE_FINER_THAN_LOCALITY: ReadonlySet<string>;
|
|
112
123
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-systems.d.ts","sourceRoot":"","sources":["../postcode-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;
|
|
1
|
+
{"version":3,"file":"postcode-systems.d.ts","sourceRoot":"","sources":["../lib/postcode-systems.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAaH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAoB5F;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAA6C,CAAA;AAE3F;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE,CAW1E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,MAAM,CAUrD,CAAA;AAQD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAMhG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,iCAAiC,EAAE,WAAW,CAAC,MAAM,CAAyB,CAAA;AAE3F;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAE9E"}
|
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;AAE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AChC,CAAA;AAED;;;GAGG;AACH,MAAM,KAAK,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAA;AAEtF;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,YAAgC;IACtF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAA;IAE3B,IAAI,CAAC,KAAK,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* The one read every name register offers a decode-time repair: given the surface a model closed a span on and the
|
|
7
|
+
* text that follows, the characters that would extend the surface to a register name. A surface that already IS a
|
|
8
|
+
* name and is not the prefix of a longer one answers null.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The remainder of the first register name that begins with `surface` and continues into `following`, or null.
|
|
12
|
+
*/
|
|
13
|
+
export declare function completeFromRegister(names: readonly string[], surface: string, following: string): string | null;
|
|
14
|
+
//# sourceMappingURL=register-completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-completion.d.ts","sourceRoot":"","sources":["../lib/register-completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUhH"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* The one read every name register offers a decode-time repair: given the surface a model closed a span on and the
|
|
7
|
+
* text that follows, the characters that would extend the surface to a register name. A surface that already IS a
|
|
8
|
+
* name and is not the prefix of a longer one answers null.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The remainder of the first register name that begins with `surface` and continues into `following`, or null.
|
|
12
|
+
*/
|
|
13
|
+
export function completeFromRegister(names, surface, following) {
|
|
14
|
+
for (const name of names) {
|
|
15
|
+
if (name.length > surface.length && name.startsWith(surface)) {
|
|
16
|
+
const remainder = name.slice(surface.length);
|
|
17
|
+
if (following.startsWith(remainder))
|
|
18
|
+
return remainder;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=register-completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-completion.js","sourceRoot":"","sources":["../lib/register-completion.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAwB,EAAE,OAAe,EAAE,SAAiB;IAChG,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,IAAI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;YAE5C,IAAI,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC;gBAAE,OAAO,SAAS,CAAA;QACtD,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,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,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAElE;;GAEG;AACH,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAE/B;;GAEG;AACH,MAAM,wBAAwB,GAAG,CAAC,CAA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AM,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,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAErE,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C,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"}
|