@mailwoman/corpus 10.6.0 → 10.7.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/data/PROVENANCE.md +24 -0
- package/data/address-source-register.json +18948 -8757
- package/data/corpus-source-inputs.json +4756 -0
- package/data/license-decisions.json +7260 -0
- package/data/licenses/whosonfirst-licenses.md +3 -2
- package/data/reviewed-ve-postcode-tuples.json +5 -72
- package/data/source-additions.json +2450 -0
- package/data/source-resolutions.json +87 -0
- package/data/training-manifests/v0.7.10-gb-county.effective.json +2335 -0
- package/data/training-manifests/v0.7.10-gb-county.json +1132 -0
- package/data/training-manifests/v0.7.2-address-systems.effective.json +3 -2
- package/data/training-manifests/v0.7.7-no-ppd.json +550 -0
- package/data/training-manifests/v0.7.8-rights-clean.json +538 -0
- package/data/training-manifests/v0.7.9-country-gap.json +1132 -0
- package/data/us-situs-sources.json +128 -0
- package/lib/adapters/cordis/adapter.ts +1 -1
- package/lib/adapters/libpostal-dictionary.ts +23 -3
- package/lib/adapters/osm/adapter.ts +42 -11
- package/lib/adapters.ts +14 -0
- package/lib/az/adapters/opendata/adapter.ts +389 -0
- package/lib/bs/adapters/gbpa/adapter.ts +248 -0
- package/lib/build/types.ts +16 -0
- package/lib/build.ts +21 -0
- package/lib/ee/adapters/ads/adapter.ts +18 -0
- package/lib/fo/adapters/adressur/adapter.ts +242 -0
- package/lib/gb/adapters/os-open/adapter.ts +12 -0
- package/lib/gb/county.ts +59 -0
- package/lib/gb/os-open/open/names.ts +41 -0
- package/lib/gu/adapters/bsp/adapter.ts +434 -0
- package/lib/im/adapters/land-registry/adapter.ts +340 -0
- package/lib/international/recipes/locale.ts +164 -19
- package/lib/li/adapters/llv/adapter.ts +246 -0
- package/lib/recipes/bare/postcode.ts +10 -34
- package/lib/recipes/country-balanced.ts +95 -78
- package/lib/recipes/intersection.ts +22 -30
- package/lib/recipes/po/box/cedex/recipe.ts +8 -5
- package/lib/recipes/po/box/cedex/sources.ts +2 -23
- package/lib/recipes/scaffold.ts +28 -3
- package/lib/recipes/sources.ts +112 -1
- package/lib/recipes/street/affix.ts +17 -29
- package/lib/recipes/sub/venue/context.ts +33 -9
- package/lib/recipes/sub/venue/sources.ts +54 -13
- package/lib/recipes/sub/venue.ts +68 -23
- package/lib/recipes/unit.ts +20 -7
- package/lib/registers.ts +33 -0
- package/lib/source-register/corpus-inputs.ts +528 -0
- package/lib/source-register/effective-manifest.ts +37 -5
- package/lib/source-register/types.ts +20 -0
- package/lib/south-asia/recipes/register.ts +1 -1
- package/lib/tools/overlay/manifest.ts +109 -1
- package/lib/tools/source-register/build.ts +47 -1
- package/lib/tools/variety-sample.ts +633 -0
- package/lib/us/adapters/usgov/nad/adapter.ts +39 -10
- package/lib/us/recipes/skeleton-sources.ts +156 -0
- package/lib/us/tools/nad-skeletons.ts +395 -0
- package/lib/uy/adapters/ide/adapter.ts +275 -0
- package/lib/ve/recipes/reviewed-postcode-tail.ts +29 -6
- package/out/adapters/cordis/adapter.d.ts +1 -1
- package/out/adapters/cordis/adapter.js +1 -1
- package/out/adapters/libpostal-dictionary.d.ts +9 -0
- package/out/adapters/libpostal-dictionary.d.ts.map +1 -1
- package/out/adapters/libpostal-dictionary.js +19 -3
- package/out/adapters/libpostal-dictionary.js.map +1 -1
- package/out/adapters/osm/adapter.d.ts +12 -1
- package/out/adapters/osm/adapter.d.ts.map +1 -1
- package/out/adapters/osm/adapter.js +30 -13
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +14 -0
- package/out/adapters.js.map +1 -1
- package/out/az/adapters/opendata/adapter.d.ts +88 -0
- package/out/az/adapters/opendata/adapter.d.ts.map +1 -0
- package/out/az/adapters/opendata/adapter.js +282 -0
- package/out/az/adapters/opendata/adapter.js.map +1 -0
- package/out/bs/adapters/gbpa/adapter.d.ts +64 -0
- package/out/bs/adapters/gbpa/adapter.d.ts.map +1 -0
- package/out/bs/adapters/gbpa/adapter.js +187 -0
- package/out/bs/adapters/gbpa/adapter.js.map +1 -0
- package/out/build/types.d.ts +15 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/types.js.map +1 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +17 -0
- package/out/build.js.map +1 -1
- package/out/ee/adapters/ads/adapter.d.ts +6 -0
- package/out/ee/adapters/ads/adapter.d.ts.map +1 -1
- package/out/ee/adapters/ads/adapter.js +16 -0
- package/out/ee/adapters/ads/adapter.js.map +1 -1
- package/out/fo/adapters/adressur/adapter.d.ts +63 -0
- package/out/fo/adapters/adressur/adapter.d.ts.map +1 -0
- package/out/fo/adapters/adressur/adapter.js +177 -0
- package/out/fo/adapters/adressur/adapter.js.map +1 -0
- package/out/gb/adapters/os-open/adapter.d.ts +8 -0
- package/out/gb/adapters/os-open/adapter.d.ts.map +1 -1
- package/out/gb/adapters/os-open/adapter.js +11 -0
- package/out/gb/adapters/os-open/adapter.js.map +1 -1
- package/out/gb/county.d.ts +30 -0
- package/out/gb/county.d.ts.map +1 -0
- package/out/gb/county.js +51 -0
- package/out/gb/county.js.map +1 -0
- package/out/gb/os-open/open/names.d.ts +17 -0
- package/out/gb/os-open/open/names.d.ts.map +1 -1
- package/out/gb/os-open/open/names.js +19 -0
- package/out/gb/os-open/open/names.js.map +1 -1
- package/out/gu/adapters/bsp/adapter.d.ts +83 -0
- package/out/gu/adapters/bsp/adapter.d.ts.map +1 -0
- package/out/gu/adapters/bsp/adapter.js +346 -0
- package/out/gu/adapters/bsp/adapter.js.map +1 -0
- package/out/im/adapters/land-registry/adapter.d.ts +68 -0
- package/out/im/adapters/land-registry/adapter.d.ts.map +1 -0
- package/out/im/adapters/land-registry/adapter.js +261 -0
- package/out/im/adapters/land-registry/adapter.js.map +1 -0
- package/out/international/recipes/locale.d.ts +24 -4
- package/out/international/recipes/locale.d.ts.map +1 -1
- package/out/international/recipes/locale.js +107 -15
- package/out/international/recipes/locale.js.map +1 -1
- package/out/li/adapters/llv/adapter.d.ts +69 -0
- package/out/li/adapters/llv/adapter.d.ts.map +1 -0
- package/out/li/adapters/llv/adapter.js +181 -0
- package/out/li/adapters/llv/adapter.js.map +1 -0
- package/out/recipes/bare/postcode.d.ts.map +1 -1
- package/out/recipes/bare/postcode.js +9 -30
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/country-balanced.d.ts.map +1 -1
- package/out/recipes/country-balanced.js +82 -73
- package/out/recipes/country-balanced.js.map +1 -1
- package/out/recipes/intersection.d.ts +3 -2
- package/out/recipes/intersection.d.ts.map +1 -1
- package/out/recipes/intersection.js +20 -26
- package/out/recipes/intersection.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +5 -4
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/sources.d.ts +2 -45
- package/out/recipes/po/box/cedex/sources.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/sources.js +0 -20
- package/out/recipes/po/box/cedex/sources.js.map +1 -1
- package/out/recipes/scaffold.d.ts +15 -2
- package/out/recipes/scaffold.d.ts.map +1 -1
- package/out/recipes/scaffold.js +21 -1
- package/out/recipes/scaffold.js.map +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +112 -1
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes/street/affix.d.ts.map +1 -1
- package/out/recipes/street/affix.js +8 -20
- package/out/recipes/street/affix.js.map +1 -1
- package/out/recipes/sub/venue/context.d.ts +14 -3
- package/out/recipes/sub/venue/context.d.ts.map +1 -1
- package/out/recipes/sub/venue/context.js +29 -9
- package/out/recipes/sub/venue/context.js.map +1 -1
- package/out/recipes/sub/venue/sources.d.ts +41 -8
- package/out/recipes/sub/venue/sources.d.ts.map +1 -1
- package/out/recipes/sub/venue/sources.js +26 -7
- package/out/recipes/sub/venue/sources.js.map +1 -1
- package/out/recipes/sub/venue.d.ts.map +1 -1
- package/out/recipes/sub/venue.js +35 -14
- package/out/recipes/sub/venue.js.map +1 -1
- package/out/recipes/unit.d.ts +4 -0
- package/out/recipes/unit.d.ts.map +1 -1
- package/out/recipes/unit.js +7 -6
- package/out/recipes/unit.js.map +1 -1
- package/out/registers.d.ts +33 -0
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +33 -0
- package/out/registers.js.map +1 -1
- package/out/source-register/corpus-inputs.d.ts +240 -0
- package/out/source-register/corpus-inputs.d.ts.map +1 -0
- package/out/source-register/corpus-inputs.js +275 -0
- package/out/source-register/corpus-inputs.js.map +1 -0
- package/out/source-register/effective-manifest.d.ts +2 -0
- package/out/source-register/effective-manifest.d.ts.map +1 -1
- package/out/source-register/effective-manifest.js +33 -4
- package/out/source-register/effective-manifest.js.map +1 -1
- package/out/source-register/types.d.ts +21 -1
- package/out/source-register/types.d.ts.map +1 -1
- package/out/source-register/types.js +20 -0
- package/out/source-register/types.js.map +1 -1
- package/out/south-asia/recipes/register.js +1 -1
- package/out/south-asia/recipes/register.js.map +1 -1
- package/out/tools/overlay/manifest.d.ts +7 -0
- package/out/tools/overlay/manifest.d.ts.map +1 -1
- package/out/tools/overlay/manifest.js +72 -1
- package/out/tools/overlay/manifest.js.map +1 -1
- package/out/tools/source-register/build.d.ts +9 -0
- package/out/tools/source-register/build.d.ts.map +1 -1
- package/out/tools/source-register/build.js +25 -3
- package/out/tools/source-register/build.js.map +1 -1
- package/out/tools/variety-sample.d.ts +196 -0
- package/out/tools/variety-sample.d.ts.map +1 -0
- package/out/tools/variety-sample.js +417 -0
- package/out/tools/variety-sample.js.map +1 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts +80 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +27 -8
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/recipes/skeleton-sources.d.ts +92 -0
- package/out/us/recipes/skeleton-sources.d.ts.map +1 -0
- package/out/us/recipes/skeleton-sources.js +121 -0
- package/out/us/recipes/skeleton-sources.js.map +1 -0
- package/out/us/tools/nad-skeletons.d.ts +120 -0
- package/out/us/tools/nad-skeletons.d.ts.map +1 -0
- package/out/us/tools/nad-skeletons.js +262 -0
- package/out/us/tools/nad-skeletons.js.map +1 -0
- package/out/uy/adapters/ide/adapter.d.ts +64 -0
- package/out/uy/adapters/ide/adapter.d.ts.map +1 -0
- package/out/uy/adapters/ide/adapter.js +206 -0
- package/out/uy/adapters/ide/adapter.js.map +1 -0
- package/out/ve/recipes/reviewed-postcode-tail.d.ts +6 -2
- package/out/ve/recipes/reviewed-postcode-tail.d.ts.map +1 -1
- package/out/ve/recipes/reviewed-postcode-tail.js +16 -5
- package/out/ve/recipes/reviewed-postcode-tail.js.map +1 -1
- package/package.json +14 -14
- package/lib/recipes/unit/sources.ts +0 -44
- package/lib/tools/fetch/ppd.ts +0 -121
- package/out/recipes/unit/sources.d.ts +0 -28
- package/out/recipes/unit/sources.d.ts.map +0 -1
- package/out/recipes/unit/sources.js +0 -30
- package/out/recipes/unit/sources.js.map +0 -1
- package/out/tools/fetch/ppd.d.ts +0 -15
- package/out/tools/fetch/ppd.d.ts.map +0 -1
- package/out/tools/fetch/ppd.js +0 -86
- package/out/tools/fetch/ppd.js.map +0 -1
|
@@ -14,6 +14,86 @@ export declare const USGOV_NAD_ADAPTER_ID = "usgov-nad";
|
|
|
14
14
|
* The license label on every emitted row, because US federal works are public domain under 17 U.S.C. § 105.
|
|
15
15
|
*/
|
|
16
16
|
export declare const USGOV_NAD_DEFAULT_LICENSE = "Public Domain";
|
|
17
|
+
/**
|
|
18
|
+
* One NAD address point as the FeatureServer pages publish it, limited to the fields a reader here uses.
|
|
19
|
+
*/
|
|
20
|
+
export interface NADRecord {
|
|
21
|
+
OBJECTID?: number;
|
|
22
|
+
UUID?: string | null;
|
|
23
|
+
AddNum_Pre?: string | null;
|
|
24
|
+
Add_Number?: number | string | null;
|
|
25
|
+
AddNum_Suf?: string | null;
|
|
26
|
+
AddNo_Full?: string | null;
|
|
27
|
+
St_PreMod?: string | null;
|
|
28
|
+
St_PreDir?: string | null;
|
|
29
|
+
St_PreTyp?: string | null;
|
|
30
|
+
St_PreSep?: string | null;
|
|
31
|
+
St_Name?: string | null;
|
|
32
|
+
St_PosTyp?: string | null;
|
|
33
|
+
St_PosDir?: string | null;
|
|
34
|
+
St_PosMod?: string | null;
|
|
35
|
+
StNam_Full?: string | null;
|
|
36
|
+
Building?: string | null;
|
|
37
|
+
Floor?: string | null;
|
|
38
|
+
Unit?: string | null;
|
|
39
|
+
Room?: string | null;
|
|
40
|
+
Seat?: string | null;
|
|
41
|
+
Addtl_Loc?: string | null;
|
|
42
|
+
SubAddress?: string | null;
|
|
43
|
+
LandmkName?: string | null;
|
|
44
|
+
County?: string | null;
|
|
45
|
+
Inc_Muni?: string | null;
|
|
46
|
+
Post_City?: string | null;
|
|
47
|
+
Census_Plc?: string | null;
|
|
48
|
+
Uninc_Comm?: string | null;
|
|
49
|
+
Nbrhd_Comm?: string | null;
|
|
50
|
+
NatAmArea?: string | null;
|
|
51
|
+
NatAmSub?: string | null;
|
|
52
|
+
Urbnztn_PR?: string | null;
|
|
53
|
+
PlaceOther?: string | null;
|
|
54
|
+
PlaceNmTyp?: string | null;
|
|
55
|
+
State?: string | null;
|
|
56
|
+
Zip_Code?: string | null;
|
|
57
|
+
Plus_4?: string | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The house number a NAD record states, read from its own four columns.
|
|
61
|
+
*
|
|
62
|
+
* NAD publishes `AddNo_Full` already assembled and the parts beside it, so this prefers the
|
|
63
|
+
* assembled column and falls back to joining `AddNum_Pre`, `Add_Number` and `AddNum_Suf`.
|
|
64
|
+
* The shared `composeHouseNumber` in `#adapters/street-line` joins exactly two columns with
|
|
65
|
+
* one separator, so it fits a publisher that splits the number in two rather than in four.
|
|
66
|
+
*/
|
|
67
|
+
export declare function nadHouseNumber(r: NADRecord): string | null;
|
|
68
|
+
/**
|
|
69
|
+
* A NAD street split into the prefix, name and suffix its structured columns state,
|
|
70
|
+
* with the whole street beside them.
|
|
71
|
+
*/
|
|
72
|
+
export interface DecomposedNADStreet {
|
|
73
|
+
prefix?: string;
|
|
74
|
+
street?: string;
|
|
75
|
+
suffix?: string;
|
|
76
|
+
full: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The street a NAD record states.
|
|
80
|
+
*
|
|
81
|
+
* Structured street fields take precedence.
|
|
82
|
+
* If they are empty, `StNam_Full` supplies the whole street.
|
|
83
|
+
*/
|
|
84
|
+
export declare function decomposeNADStreet(r: NADRecord): DecomposedNADStreet | null;
|
|
85
|
+
/**
|
|
86
|
+
* The locality a NAD record states.
|
|
87
|
+
*
|
|
88
|
+
* The postal city comes first because it is the name that people write on mail.
|
|
89
|
+
* NAD fills an unknown `Post_City` with the domain value `Not stated`
|
|
90
|
+
* (99,998 rows of a 100,000-row Massachusetts sample and 11,713 of a Texas one), and an address
|
|
91
|
+
* outside any municipality has `Inc_Muni` `Unincorporated` (the same 11,713 Texas rows).
|
|
92
|
+
*
|
|
93
|
+
* Another 23 rows of that Texas sample read `0`.
|
|
94
|
+
* Each of these values counts as absent, and the next column supplies the place name.
|
|
95
|
+
*/
|
|
96
|
+
export declare function composeNADLocality(r: NADRecord): string | null;
|
|
17
97
|
/**
|
|
18
98
|
* Creates the NAD adapter.
|
|
19
99
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../lib/us/adapters/usgov/nad/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,EAAuD,KAAK,aAAa,EAAiB,MAAM,QAAQ,CAAA;AAE/G;;GAEG;AACH,eAAO,MAAM,oBAAoB,cAAc,CAAA;AAC/C;;GAEG;AACH,eAAO,MAAM,yBAAyB,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../lib/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AAgB,kBAAkB,CAAC,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAK9D;AAWD;;;;;GAKG;AACH,wBAAgB,qBAAqB,IAAI,aAAa,CAgGrD;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,eAA0B,CAAA"}
|
|
@@ -47,7 +47,7 @@ function nonEmpty(...values) {
|
|
|
47
47
|
* The shared `composeHouseNumber` in `#adapters/street-line` joins exactly two columns with
|
|
48
48
|
* one separator, so it fits a publisher that splits the number in two rather than in four.
|
|
49
49
|
*/
|
|
50
|
-
function nadHouseNumber(r) {
|
|
50
|
+
export function nadHouseNumber(r) {
|
|
51
51
|
const full = (r.AddNo_Full ?? "").toString().trim();
|
|
52
52
|
if (full)
|
|
53
53
|
return full;
|
|
@@ -58,9 +58,13 @@ function nadHouseNumber(r) {
|
|
|
58
58
|
const suf = (r.AddNum_Suf ?? "").toString().trim();
|
|
59
59
|
return [pre, num, suf].filter(isPresent).join(" ").trim() || null;
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
/**
|
|
62
|
+
* The street a NAD record states.
|
|
63
|
+
*
|
|
64
|
+
* Structured street fields take precedence.
|
|
65
|
+
* If they are empty, `StNam_Full` supplies the whole street.
|
|
66
|
+
*/
|
|
67
|
+
export function decomposeNADStreet(r) {
|
|
64
68
|
const name = (r.St_Name ?? "").toString().trim();
|
|
65
69
|
if (name) {
|
|
66
70
|
const preDir = (r.St_PreDir ?? "").toString().trim();
|
|
@@ -78,9 +82,24 @@ function decomposeNADStreet(r) {
|
|
|
78
82
|
return { full, street: full };
|
|
79
83
|
return null;
|
|
80
84
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
/**
|
|
86
|
+
* The NAD domain values that fill a place-name column without naming a place, lower-cased.
|
|
87
|
+
*/
|
|
88
|
+
const NAD_PLACEHOLDER_PLACE_NAMES = new Set(["not stated", "unincorporated", "0"]);
|
|
89
|
+
/**
|
|
90
|
+
* The locality a NAD record states.
|
|
91
|
+
*
|
|
92
|
+
* The postal city comes first because it is the name that people write on mail.
|
|
93
|
+
* NAD fills an unknown `Post_City` with the domain value `Not stated`
|
|
94
|
+
* (99,998 rows of a 100,000-row Massachusetts sample and 11,713 of a Texas one), and an address
|
|
95
|
+
* outside any municipality has `Inc_Muni` `Unincorporated` (the same 11,713 Texas rows).
|
|
96
|
+
*
|
|
97
|
+
* Another 23 rows of that Texas sample read `0`.
|
|
98
|
+
* Each of these values counts as absent, and the next column supplies the place name.
|
|
99
|
+
*/
|
|
100
|
+
export function composeNADLocality(r) {
|
|
101
|
+
const stated = (value) => NAD_PLACEHOLDER_PLACE_NAMES.has(value?.trim().toLowerCase() ?? "") ? null : value;
|
|
102
|
+
return nonEmpty(stated(r.Post_City), stated(r.Inc_Muni), stated(r.Census_Plc), stated(r.Uninc_Comm));
|
|
84
103
|
}
|
|
85
104
|
function composePostcode(r) {
|
|
86
105
|
const zip = (r.Zip_Code ?? "").toString().trim();
|
|
@@ -132,7 +151,7 @@ export function createUsgovNADAdapter() {
|
|
|
132
151
|
const state = (record.State ?? "").toString().trim().toUpperCase();
|
|
133
152
|
if (!US_STATES_SET.has(state))
|
|
134
153
|
continue;
|
|
135
|
-
const locality =
|
|
154
|
+
const locality = composeNADLocality(record);
|
|
136
155
|
if (!locality)
|
|
137
156
|
continue;
|
|
138
157
|
const postcode = composePostcode(record);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../../lib/us/adapters/usgov/nad/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,E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AI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;wBACzB,QAAQ;wBACR,MAAM,EAAE,KAAK;wBACb,QAAQ;qBACR,CAAA;oBAED,MAAM,QAAQ,GAAG,gBAAgB,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;oBAEzE,IAAI,CAAC,QAAQ;wBAAE,SAAQ;oBAEvB,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAA;oBAE7C,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC;wBAAE,SAAQ;oBAE9C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI;wBAC3B,CAAC,CAAC,GAAG,oBAAoB,IAAI,MAAM,CAAC,IAAI,EAAE;wBAC1C,CAAC,CAAC,GAAG,oBAAoB,IAAI,MAAM,CAAC,QAAQ,IAAI,GAAG,IAAI,IAAI,OAAO,EAAE,EAAE,CAAA;oBAEvE,MAAM;wBACL,GAAG;wBACH,UAAU,EAAE,OAAO;wBACnB,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE,OAAO;wBACf,MAAM,EAAE,oBAAoB;wBAC5B,SAAS,EAAE,QAAQ;wBACnB,cAAc,EAAE,EAAE;wBAClB,OAAO,EAAE,yBAAyB;qBAClC,CAAA;oBAED,OAAO,EAAE,CAAA;gBACV,CAAC;YACF,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The US address skeletons the OA-shaped recipes read: two elected OpenAddresses extracts and one
|
|
6
|
+
* National Address Database sample per chosen state, with Vermont held out for the golden sets.
|
|
7
|
+
*
|
|
8
|
+
* `unit`, `street-affix`, `suffix-boundary`, `po-box-cedex` and `country-balanced` read these files
|
|
9
|
+
* through the same zipped-CSV reader, so a NAD sample is written in OpenAddresses' column layout by
|
|
10
|
+
* `packages/mailwoman/tools/dev-tools/corpus/nad-skeletons.run.ts`.
|
|
11
|
+
*/
|
|
12
|
+
import type { PathBuilderLike } from "path-ts";
|
|
13
|
+
/**
|
|
14
|
+
* The register a skeleton file's rows were published in.
|
|
15
|
+
*
|
|
16
|
+
* It prefixes the `base_source_id` a recipe derives from the file.
|
|
17
|
+
*/
|
|
18
|
+
export declare const USSkeletonRegister: {
|
|
19
|
+
readonly OpenAddresses: "openaddresses";
|
|
20
|
+
readonly NationalAddressDatabase: "usgov-nad";
|
|
21
|
+
};
|
|
22
|
+
export type USSkeletonRegister = (typeof USSkeletonRegister)[keyof typeof USSkeletonRegister];
|
|
23
|
+
/**
|
|
24
|
+
* One cached US skeleton file: the zip, its CSV member and the region every row of it lies in.
|
|
25
|
+
*/
|
|
26
|
+
export interface USSkeletonSource {
|
|
27
|
+
zip: PathBuilderLike;
|
|
28
|
+
csv: string;
|
|
29
|
+
region: string;
|
|
30
|
+
register: USSkeletonRegister;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The data-root directory holding the NAD samples and ZIP-to-city tables the NAD skeleton tool writes.
|
|
34
|
+
*/
|
|
35
|
+
export declare const NAD_SKELETON_DIRECTORY = "nad-skeletons";
|
|
36
|
+
/**
|
|
37
|
+
* The states sampled from NAD, chosen for address shapes the OpenAddresses files lack
|
|
38
|
+
* rather than for row count.
|
|
39
|
+
*
|
|
40
|
+
* Distinct tuples of those six files carry a unit on 0.6% of rows, and none has
|
|
41
|
+
* a hyphenated or direction-prefixed house number.
|
|
42
|
+
*
|
|
43
|
+
* Each comment states the shape measured over the usable rows of the FeatureServer
|
|
44
|
+
* pages fetched on 2026-05-18.
|
|
45
|
+
* `nad-skeletons.run.ts` prints the table for every state.
|
|
46
|
+
*
|
|
47
|
+
* Vermont is absent because it is the eval holdout.
|
|
48
|
+
* No state's rows match a rural-route street pattern, so NAD adds no rural-route form.
|
|
49
|
+
*/
|
|
50
|
+
export declare const NAD_SKELETON_STATES: readonly ["IL", "MA", "UT", "WI", "NY", "TX"];
|
|
51
|
+
/**
|
|
52
|
+
* The zip and CSV member the NAD skeleton tool writes for one state.
|
|
53
|
+
*/
|
|
54
|
+
export declare function nadSkeletonFile(region: string): {
|
|
55
|
+
zip: PathBuilderLike;
|
|
56
|
+
csv: string;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* The NAD skeleton file for every state in {@link NAD_SKELETON_STATES}.
|
|
60
|
+
*/
|
|
61
|
+
export declare const NAD_SKELETON_SOURCES: readonly USSkeletonSource[];
|
|
62
|
+
/**
|
|
63
|
+
* The cached OpenAddresses US extracts used for training.
|
|
64
|
+
*
|
|
65
|
+
* `us/il/cook` is absent because Cook County's terms restrict redistribution.
|
|
66
|
+
* NAD's Illinois sample stands in for its city grid.
|
|
67
|
+
*/
|
|
68
|
+
export declare const OA_SKELETON_TRAIN_SOURCES: readonly USSkeletonSource[];
|
|
69
|
+
/**
|
|
70
|
+
* Every US training skeleton: the OpenAddresses extracts and the NAD samples.
|
|
71
|
+
*/
|
|
72
|
+
export declare const US_SKELETON_TRAIN_SOURCES: readonly USSkeletonSource[];
|
|
73
|
+
/**
|
|
74
|
+
* Vermont, the corpus holdout — `--golden` reads this and no other US source.
|
|
75
|
+
*/
|
|
76
|
+
export declare const US_SKELETON_EVAL_SOURCE: USSkeletonSource;
|
|
77
|
+
/**
|
|
78
|
+
* A county whose NAD rows give the ZIP-to-city table the `intersection` recipe renders city tails from.
|
|
79
|
+
*/
|
|
80
|
+
export interface NADZipCityCounty {
|
|
81
|
+
region: string;
|
|
82
|
+
county: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The counties of the `intersection` recipe's TIGER training crossings, Cook IL and Morris NJ.
|
|
86
|
+
*/
|
|
87
|
+
export declare const NAD_ZIP_CITY_COUNTIES: readonly NADZipCityCounty[];
|
|
88
|
+
/**
|
|
89
|
+
* The ZIP-to-city CSV the NAD skeleton tool writes for one county.
|
|
90
|
+
*/
|
|
91
|
+
export declare function nadZipCityPath(entry: NADZipCityCounty): PathBuilderLike;
|
|
92
|
+
//# sourceMappingURL=skeleton-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-sources.d.ts","sourceRoot":"","sources":["../../../lib/us/recipes/skeleton-sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;aAC9B,aAAa,EAAE,eAAe;aAC9B,uBAAuB,EAAE,WAAW;CAC3B,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAA;AAE7F;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,GAAG,EAAE,eAAe,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,kBAAkB,CAAA;CAC5B;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,kBAAkB,CAAA;AAErD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,YAE/B,IAAI,EAEJ,IAAI,EAEJ,IAAI,EAEJ,IAAI,EAEJ,IAAI,EAEJ,IAAI,CACK,CAAA;AAEV;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAOrF;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,SAAS,gBAAgB,EAIzD,CAAA;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,gBAAgB,EAc9D,CAAA;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,gBAAgB,EAGhE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAKrC,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,gBAAgB,EAG5D,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,eAAe,CAIvE"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file The US address skeletons the OA-shaped recipes read: two elected OpenAddresses extracts and one
|
|
6
|
+
* National Address Database sample per chosen state, with Vermont held out for the golden sets.
|
|
7
|
+
*
|
|
8
|
+
* `unit`, `street-affix`, `suffix-boundary`, `po-box-cedex` and `country-balanced` read these files
|
|
9
|
+
* through the same zipped-CSV reader, so a NAD sample is written in OpenAddresses' column layout by
|
|
10
|
+
* `packages/mailwoman/tools/dev-tools/corpus/nad-skeletons.run.ts`.
|
|
11
|
+
*/
|
|
12
|
+
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
13
|
+
/**
|
|
14
|
+
* The register a skeleton file's rows were published in.
|
|
15
|
+
*
|
|
16
|
+
* It prefixes the `base_source_id` a recipe derives from the file.
|
|
17
|
+
*/
|
|
18
|
+
export const USSkeletonRegister = {
|
|
19
|
+
OpenAddresses: "openaddresses",
|
|
20
|
+
NationalAddressDatabase: "usgov-nad",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The data-root directory holding the NAD samples and ZIP-to-city tables the NAD skeleton tool writes.
|
|
24
|
+
*/
|
|
25
|
+
export const NAD_SKELETON_DIRECTORY = "nad-skeletons";
|
|
26
|
+
/**
|
|
27
|
+
* The states sampled from NAD, chosen for address shapes the OpenAddresses files lack
|
|
28
|
+
* rather than for row count.
|
|
29
|
+
*
|
|
30
|
+
* Distinct tuples of those six files carry a unit on 0.6% of rows, and none has
|
|
31
|
+
* a hyphenated or direction-prefixed house number.
|
|
32
|
+
*
|
|
33
|
+
* Each comment states the shape measured over the usable rows of the FeatureServer
|
|
34
|
+
* pages fetched on 2026-05-18.
|
|
35
|
+
* `nad-skeletons.run.ts` prints the table for every state.
|
|
36
|
+
*
|
|
37
|
+
* Vermont is absent because it is the eval holdout.
|
|
38
|
+
* No state's rows match a rural-route street pattern, so NAD adds no rural-route form.
|
|
39
|
+
*/
|
|
40
|
+
export const NAD_SKELETON_STATES = [
|
|
41
|
+
// Chicago's city grid, which `us/il/cook` supplied before it was withdrawn: 8.9% unit, 1,268 ZIPs.
|
|
42
|
+
"IL",
|
|
43
|
+
// 36.6% unit, the most of any state with over a million rows, and 154 street types.
|
|
44
|
+
"MA",
|
|
45
|
+
// The numbered grid: 43.1% numeric street names and 42.6% post-directionals, as in `500 E`.
|
|
46
|
+
"UT",
|
|
47
|
+
// Direction-prefixed rural grid house numbers such as `S9878` on 1.3% of rows, and lettered county roads.
|
|
48
|
+
"WI",
|
|
49
|
+
// Hyphenated Queens house numbers such as `244-32` on 5.3% of rows, and 15.8% unit.
|
|
50
|
+
"NY",
|
|
51
|
+
// Farm to Market, Ranch Road and County Road prefix types on 5.4% of rows, and 161 street types.
|
|
52
|
+
"TX",
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* The zip and CSV member the NAD skeleton tool writes for one state.
|
|
56
|
+
*/
|
|
57
|
+
export function nadSkeletonFile(region) {
|
|
58
|
+
const state = region.toLowerCase();
|
|
59
|
+
return {
|
|
60
|
+
zip: dataRootPath(NAD_SKELETON_DIRECTORY, `us__${state}__nad.zip`),
|
|
61
|
+
csv: `us/${state}/nad.csv`,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The NAD skeleton file for every state in {@link NAD_SKELETON_STATES}.
|
|
66
|
+
*/
|
|
67
|
+
export const NAD_SKELETON_SOURCES = NAD_SKELETON_STATES.map((region) => ({
|
|
68
|
+
...nadSkeletonFile(region),
|
|
69
|
+
region,
|
|
70
|
+
register: USSkeletonRegister.NationalAddressDatabase,
|
|
71
|
+
}));
|
|
72
|
+
/**
|
|
73
|
+
* The cached OpenAddresses US extracts used for training.
|
|
74
|
+
*
|
|
75
|
+
* `us/il/cook` is absent because Cook County's terms restrict redistribution.
|
|
76
|
+
* NAD's Illinois sample stands in for its city grid.
|
|
77
|
+
*/
|
|
78
|
+
export const OA_SKELETON_TRAIN_SOURCES = [
|
|
79
|
+
["us__ca__berkeley.zip", "us/ca/berkeley.csv", "CA"],
|
|
80
|
+
["us__ca__marin.zip", "us/ca/marin.csv", "CA"],
|
|
81
|
+
["us__dc__statewide.zip", "us/dc/statewide.csv", "DC"],
|
|
82
|
+
["us__ia__statewide.zip", "us/ia/statewide.csv", "IA"],
|
|
83
|
+
["us__mt__statewide.zip", "us/mt/statewide.csv", "MT"],
|
|
84
|
+
["us__sd__statewide.zip", "us/sd/statewide.csv", "SD"],
|
|
85
|
+
].map(([zip, csv, region]) => ({
|
|
86
|
+
zip: dataRootPath("oa-cache", zip),
|
|
87
|
+
csv,
|
|
88
|
+
region,
|
|
89
|
+
register: USSkeletonRegister.OpenAddresses,
|
|
90
|
+
}));
|
|
91
|
+
/**
|
|
92
|
+
* Every US training skeleton: the OpenAddresses extracts and the NAD samples.
|
|
93
|
+
*/
|
|
94
|
+
export const US_SKELETON_TRAIN_SOURCES = [
|
|
95
|
+
...OA_SKELETON_TRAIN_SOURCES,
|
|
96
|
+
...NAD_SKELETON_SOURCES,
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* Vermont, the corpus holdout — `--golden` reads this and no other US source.
|
|
100
|
+
*/
|
|
101
|
+
export const US_SKELETON_EVAL_SOURCE = {
|
|
102
|
+
zip: dataRootPath("oa-cache", "us__vt__statewide.zip"),
|
|
103
|
+
csv: "us/vt/statewide.csv",
|
|
104
|
+
region: "VT",
|
|
105
|
+
register: USSkeletonRegister.OpenAddresses,
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* The counties of the `intersection` recipe's TIGER training crossings, Cook IL and Morris NJ.
|
|
109
|
+
*/
|
|
110
|
+
export const NAD_ZIP_CITY_COUNTIES = [
|
|
111
|
+
{ region: "IL", county: "Cook" },
|
|
112
|
+
{ region: "NJ", county: "Morris" },
|
|
113
|
+
];
|
|
114
|
+
/**
|
|
115
|
+
* The ZIP-to-city CSV the NAD skeleton tool writes for one county.
|
|
116
|
+
*/
|
|
117
|
+
export function nadZipCityPath(entry) {
|
|
118
|
+
const county = entry.county.toLowerCase().replaceAll(/[^a-z0-9]+/g, "-");
|
|
119
|
+
return dataRootPath(NAD_SKELETON_DIRECTORY, `us__${entry.region.toLowerCase()}__${county}__zip-city.csv`);
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=skeleton-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-sources.js","sourceRoot":"","sources":["../../../lib/us/recipes/skeleton-sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAGxD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,aAAa,EAAE,eAAe;IAC9B,uBAAuB,EAAE,WAAW;CAC3B,CAAA;AAcV;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,eAAe,CAAA;AAErD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC,mGAAmG;IACnG,IAAI;IACJ,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G;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAgC;IACrE,GAAG,yBAAyB;IAC5B,GAAG,oBAAoB;CACvB,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAqB;IACxD,GAAG,EAAE,YAAY,CAAC,UAAU,EAAE,uBAAuB,CAAC;IACtD,GAAG,EAAE,qBAAqB;IAC1B,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,kBAAkB,CAAC,aAAa;CAC1C,CAAA;AAUD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAgC;IACjE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;IAChC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE;CAClC,CAAA;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAuB;IACrD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC,CAAA;IAExE,OAAO,YAAY,CAAC,sBAAsB,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,MAAM,gBAAgB,CAAC,CAAA;AAC1G,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file Samples National Address Database rows into OpenAddresses-layout CSV skeletons, measures the address
|
|
6
|
+
* shapes each state's rows carry, and tallies county ZIP-to-city tables.
|
|
7
|
+
*
|
|
8
|
+
* The OA-skeleton recipes read a zipped CSV with OpenAddresses' columns, so a NAD sample written in that
|
|
9
|
+
* layout reaches them through the same reader as the OpenAddresses extracts they also read.
|
|
10
|
+
*/
|
|
11
|
+
import { type PathBuilderLike } from "path-ts";
|
|
12
|
+
import { type NADRecord } from "#us/adapters/usgov/nad/adapter";
|
|
13
|
+
import { type NADZipCityCounty } from "#us/recipes/skeleton-sources";
|
|
14
|
+
/**
|
|
15
|
+
* The OpenAddresses columns a skeleton CSV carries, in OpenAddresses' order.
|
|
16
|
+
*/
|
|
17
|
+
export declare const NAD_SKELETON_COLUMNS: readonly ["NUMBER", "STREET", "UNIT", "CITY", "DISTRICT", "REGION", "POSTCODE", "ID"];
|
|
18
|
+
/**
|
|
19
|
+
* One NAD row projected onto {@link NAD_SKELETON_COLUMNS}.
|
|
20
|
+
*/
|
|
21
|
+
export type NADSkeletonRow = Record<(typeof NAD_SKELETON_COLUMNS)[number], string>;
|
|
22
|
+
/**
|
|
23
|
+
* The unit identifier of a NAD row without its designator, as OpenAddresses' `UNIT` column mostly states it.
|
|
24
|
+
*
|
|
25
|
+
* NAD writes `APT 6`, `UNIT D` or a bare `200`; the recipes add their own designator in
|
|
26
|
+
* front of the identifier, so the designator NAD wrote is dropped rather than doubled.
|
|
27
|
+
*/
|
|
28
|
+
export declare function nadUnitIdentifier(record: NADRecord): string;
|
|
29
|
+
/**
|
|
30
|
+
* Projects one NAD record onto the OpenAddresses columns, or returns null
|
|
31
|
+
* when it lacks a house number, street, locality, state or five-digit ZIP.
|
|
32
|
+
*
|
|
33
|
+
* A street whose name NAD publishes in capitals is written wholly in capitals,
|
|
34
|
+
* because NAD spells its structured types in title case (`East MAIN Street`)
|
|
35
|
+
* and a recipe would otherwise teach that mixed case.
|
|
36
|
+
*/
|
|
37
|
+
export declare function nadSkeletonRow(record: NADRecord): NADSkeletonRow | null;
|
|
38
|
+
/**
|
|
39
|
+
* The address-shape measures for one state's usable NAD rows.
|
|
40
|
+
*/
|
|
41
|
+
export interface NADStateShape {
|
|
42
|
+
region: string;
|
|
43
|
+
/**
|
|
44
|
+
* Rows with a house number, street, locality and five-digit ZIP.
|
|
45
|
+
*/
|
|
46
|
+
usable: number;
|
|
47
|
+
unitShare: number;
|
|
48
|
+
/**
|
|
49
|
+
* Distinct `St_PosTyp` and `St_PreTyp` values.
|
|
50
|
+
*/
|
|
51
|
+
streetTypes: number;
|
|
52
|
+
zips: number;
|
|
53
|
+
/**
|
|
54
|
+
* Share of rows whose street opens with a type, such as `County Road 12` or `Farm to Market 1960`.
|
|
55
|
+
*/
|
|
56
|
+
prefixTypeShare: number;
|
|
57
|
+
numericNameShare: number;
|
|
58
|
+
postDirectionalShare: number;
|
|
59
|
+
ruralRouteShare: number;
|
|
60
|
+
hyphenatedNumberShare: number;
|
|
61
|
+
/**
|
|
62
|
+
* Share of house numbers that open with a direction letter, as Wisconsin's `E2755` does.
|
|
63
|
+
*/
|
|
64
|
+
gridNumberShare: number;
|
|
65
|
+
}
|
|
66
|
+
export interface BuildNADSkeletonsOptions {
|
|
67
|
+
/**
|
|
68
|
+
* The directory of FeatureServer NDJSON pages the NAD fetcher writes.
|
|
69
|
+
*/
|
|
70
|
+
inputDirectory: PathBuilderLike;
|
|
71
|
+
/**
|
|
72
|
+
* The states to sample, as USPS abbreviations.
|
|
73
|
+
*/
|
|
74
|
+
states: readonly string[];
|
|
75
|
+
/**
|
|
76
|
+
* The most rows any one state's sample keeps.
|
|
77
|
+
*/
|
|
78
|
+
cap: number;
|
|
79
|
+
seed: number;
|
|
80
|
+
zipCityCounties: readonly NADZipCityCounty[];
|
|
81
|
+
/**
|
|
82
|
+
* Called after each page with the count read so far.
|
|
83
|
+
*/
|
|
84
|
+
onPage?: (pagesRead: number, pages: number) => void;
|
|
85
|
+
}
|
|
86
|
+
export interface NADSkeletonSummary {
|
|
87
|
+
pages: number;
|
|
88
|
+
cap: number;
|
|
89
|
+
seed: number;
|
|
90
|
+
shapes: NADStateShape[];
|
|
91
|
+
samples: Array<{
|
|
92
|
+
region: string;
|
|
93
|
+
rows: number;
|
|
94
|
+
zip: string;
|
|
95
|
+
csv: string;
|
|
96
|
+
csvSHA256: string;
|
|
97
|
+
}>;
|
|
98
|
+
zipCity: Array<{
|
|
99
|
+
region: string;
|
|
100
|
+
county: string;
|
|
101
|
+
zips: number;
|
|
102
|
+
path: string;
|
|
103
|
+
sha256: string;
|
|
104
|
+
}>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Reads every NAD page once, measures every state's address shapes,
|
|
108
|
+
* keeps a uniform reservoir sample of at most `cap` rows for each requested state,
|
|
109
|
+
* and tallies the majority city of each ZIP in each requested county.
|
|
110
|
+
*
|
|
111
|
+
* The sample is written in reservoir order rather than page order, so a reader that
|
|
112
|
+
* takes the first N rows still draws across the whole state.
|
|
113
|
+
* It refuses to replace a file that already exists.
|
|
114
|
+
*/
|
|
115
|
+
export declare function buildNADSkeletons(options: BuildNADSkeletonsOptions): Promise<NADSkeletonSummary>;
|
|
116
|
+
/**
|
|
117
|
+
* Writes the summary beside the skeletons it describes.
|
|
118
|
+
*/
|
|
119
|
+
export declare function writeNADSkeletonSummary(summary: NADSkeletonSummary, path: PathBuilderLike): Promise<void>;
|
|
120
|
+
//# sourceMappingURL=nad-skeletons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nad-skeletons.d.ts","sourceRoot":"","sources":["../../../lib/us/tools/nad-skeletons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAIlE,OAAO,EAA0D,KAAK,SAAS,EAAE,MAAM,gCAAgC,CAAA;AACvH,OAAO,EAAmC,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAErG;;GAEG;AACH,eAAO,MAAM,oBAAoB,YAChC,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,UAAU,EACV,QAAQ,EACR,UAAU,EACV,IAAI,CACK,CAAA;AAEV;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAA;AAKlF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,S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