@mailwoman/corpus 11.1.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -14
- package/data/address-source-register.json +618 -13
- package/data/builds/v0.8.19-overlay/OVERLAY_PLAN.json +4778 -0
- package/data/builds/v0.8.19-rebuild/inputs.json +128 -0
- package/data/builds/v0.8.20-overlay/OVERLAY_PLAN.json +3595 -0
- package/data/builds/v0.8.20-rebuild/inputs.json +131 -0
- package/data/builds/v0.8.21-overlay/OVERLAY_PLAN.json +72 -0
- package/data/corpus-source-inputs.json +104 -2
- package/data/holdout/evaluation-groups.v0.8.18.json +90511 -0
- package/data/holdout/evaluation-groups.v0.8.19.json +100537 -0
- package/data/holdout/evaluation-groups.v0.8.20.json +129215 -0
- package/data/holdout/evaluation-groups.v0.8.21.json +173286 -0
- package/data/holdout/probe-text-collisions.v0.8.20.json +1478 -0
- package/data/license-decisions.json +393 -3
- package/data/licenses/PROVENANCE.md +15 -9
- package/data/licenses/au-acnc-cc-by-3.0-au.md +37 -0
- package/data/licenses/es-sanidad-aviso-legal.md +26 -0
- package/data/licenses/it-miur-iodl-2.0.md +41 -0
- package/data/licenses/nz-charities-cc-by-3.0-nz.md +36 -0
- package/data/region-slot-second-level.json +966 -0
- package/data/source-additions.json +126 -6
- package/data/source-resolutions.json +97 -0
- package/data/training-configs/v8.7.0-base-c6-90k-usgs-structures-s42.yaml +801 -0
- package/data/training-configs/v8.7.0-base-c6-90k-usgs-structures-s43.yaml +726 -0
- package/data/training-configs/v8.8.0-base-c6-90k-v0820-county-s42.yaml +944 -0
- package/data/training-configs/v8.9.0-base-c6-90k-v0821-s42.yaml +848 -0
- package/data/training-manifests/v0.8.19-retention-overlay.json +4553 -0
- package/data/training-manifests/v0.8.20-retention-overlay.json +4579 -0
- package/data/training-manifests/v0.8.21-retention-overlay.effective.json +2521 -0
- package/data/training-manifests/v0.8.21-retention-overlay.json +4579 -0
- package/lib/adapters/cordis/adapter.ts +10 -2
- package/lib/adapters/gleif/adapter.ts +23 -5
- package/lib/adapters/osm/adapter.ts +2 -2
- package/lib/adapters/street/repetition.ts +87 -0
- package/lib/adapters/street/unit.ts +14 -0
- package/lib/adapters/wof/admin/json/adapter.ts +34 -21
- package/lib/adapters/wof/admin/json/dual-role.ts +274 -0
- package/lib/adapters/wof/admin/json/explore.ts +4 -4
- package/lib/adapters/wof/admin/json/region-codes.ts +74 -3
- package/lib/adapters/wof/json-rows.ts +36 -21
- package/lib/adapters/wof/postalcode-json/adapter.ts +10 -28
- package/lib/adapters/wof/sample.ts +15 -3
- package/lib/adapters/wof/stored-records.ts +162 -0
- package/lib/adapters.ts +18 -6
- package/lib/au/adapters/acnc-register/adapter.ts +40 -0
- package/lib/au/evaluation/acnc-register.ts +144 -0
- package/lib/build/align/range.ts +9 -0
- package/lib/build/align/totals.ts +23 -0
- package/lib/build/align.ts +74 -4
- package/lib/build/budget.ts +11 -45
- package/lib/build/checkpoint.ts +11 -0
- package/lib/build/component-check.ts +99 -3
- package/lib/build/manifest.ts +4 -0
- package/lib/build/parallel.ts +8 -34
- package/lib/build/region-names.ts +609 -0
- package/lib/build/source-record.ts +7 -0
- package/lib/build/types.ts +20 -0
- package/lib/build/worker.ts +3 -1
- package/lib/build.ts +3 -6
- package/lib/de/recipes/locale.ts +3 -2
- package/lib/env.ts +0 -6
- package/lib/es/adapters/sanidad-centros-ap/adapter.ts +40 -0
- package/lib/es/evaluation/sanidad-centros-ap.ts +164 -0
- package/lib/evaluation/corpus-adapter.ts +153 -0
- package/lib/evaluation/source.ts +209 -0
- package/lib/evaluation/sources.ts +25 -0
- package/lib/fr/adapters/laposte-poincont/adapter.ts +381 -0
- package/lib/fr/recipes/unit-line-guideline.ts +9 -4
- package/lib/fr/structures/laposte.ts +139 -0
- package/lib/fr/tools/fetch/laposte-poincont.ts +234 -0
- package/lib/it/adapters/miur-scuole/adapter.ts +39 -0
- package/lib/it/evaluation/miur-scuole.ts +125 -0
- package/lib/jp/adapters/wof-admin/adapter.ts +4 -4
- package/lib/nc/adapters/opt-nc/adapter.ts +237 -0
- package/lib/nc/structures/opt-nc.ts +101 -0
- package/lib/nc/tools/fetch/opt-nc.ts +249 -0
- package/lib/nz/adapters/charities-register/adapter.ts +40 -0
- package/lib/nz/evaluation/charities-register.ts +149 -0
- package/lib/recipes/bare/postcode.ts +14 -11
- package/lib/recipes/deepseek/batches.ts +8 -8
- package/lib/recipes/po/box/cedex/recipe.ts +12 -1
- package/lib/recipes/po/box/cedex/us.ts +43 -2
- package/lib/recipes/scaffold.ts +1 -1
- package/lib/recipes/sources.ts +16 -0
- package/lib/recipes.ts +2 -0
- package/lib/registers.ts +28 -2
- package/lib/{post-offices → structures}/source.ts +49 -16
- package/lib/structures/sources.ts +26 -0
- package/lib/synthesizers/house-venue.ts +11 -6
- package/lib/synthesizers/tail.ts +27 -3
- package/lib/tools/audit.ts +1 -1
- package/lib/tools/fetch/storage.ts +18 -4
- package/lib/tools/fetch.ts +10 -2
- package/lib/tools/overlay/kryptonite.ts +6 -2
- package/lib/tools/overlay/split/attribute.ts +14 -2
- package/lib/tools/overlay/split/overlay.ts +36 -7
- package/lib/tools/postcode/triples.ts +3 -3
- package/lib/tools/region-slot-census.run.ts +184 -0
- package/lib/training/config/load.ts +19 -0
- package/lib/training/config/schema.ts +6 -0
- package/lib/tw/registers.ts +15 -4
- package/lib/tw/structures/chunghwa-post.ts +191 -0
- package/lib/tw/tools/fetch/chunghwa-post.ts +174 -0
- package/lib/us/adapters/state/ny-notaries/adapter.ts +7 -2
- package/lib/us/adapters/state/tx-notaries/adapter.ts +126 -21
- package/lib/us/adapters/usgov/nad/adapter.ts +111 -31
- package/lib/us/adapters/usgov/nppes/adapter.ts +8 -11
- package/lib/us/adapters/usgov/{usgs-post-offices → usgs-structures}/adapter.ts +65 -35
- package/lib/us/recipes/county.ts +474 -0
- package/lib/us/street-unit.ts +15 -5
- package/lib/us/structures/usgs/layers.ts +171 -0
- package/lib/us/structures/usgs/national-map.ts +95 -0
- package/lib/us/tools/fetch/usgs/gnis.ts +288 -0
- package/lib/us/tools/fetch/usgs/structures.ts +362 -0
- package/lib/utils/align.ts +2 -2
- package/lib/utils/evaluation-groups.ts +172 -0
- package/lib/utils/split.ts +40 -4
- package/lib/utils/tokenize.ts +7 -7
- package/lib/utils/validation-groups.ts +292 -0
- package/lib/utils/wof-json.ts +96 -134
- package/out/adapters/cordis/adapter.d.ts +3 -1
- package/out/adapters/cordis/adapter.d.ts.map +1 -1
- package/out/adapters/cordis/adapter.js +8 -2
- package/out/adapters/cordis/adapter.js.map +1 -1
- package/out/adapters/gleif/adapter.d.ts.map +1 -1
- package/out/adapters/gleif/adapter.js +19 -5
- package/out/adapters/gleif/adapter.js.map +1 -1
- package/out/adapters/osm/adapter.js +2 -2
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters/street/repetition.d.ts +19 -0
- package/out/adapters/street/repetition.d.ts.map +1 -0
- package/out/adapters/street/repetition.js +71 -0
- package/out/adapters/street/repetition.js.map +1 -0
- package/out/adapters/street/unit.d.ts +10 -0
- package/out/adapters/street/unit.d.ts.map +1 -1
- package/out/adapters/street/unit.js +6 -0
- package/out/adapters/street/unit.js.map +1 -1
- package/out/adapters/wof/admin/json/adapter.d.ts +8 -0
- package/out/adapters/wof/admin/json/adapter.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/adapter.js +26 -22
- package/out/adapters/wof/admin/json/adapter.js.map +1 -1
- package/out/adapters/wof/admin/json/dual-role.d.ts +83 -0
- package/out/adapters/wof/admin/json/dual-role.d.ts.map +1 -0
- package/out/adapters/wof/admin/json/dual-role.js +183 -0
- package/out/adapters/wof/admin/json/dual-role.js.map +1 -0
- package/out/adapters/wof/admin/json/explore.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/explore.js +4 -4
- package/out/adapters/wof/admin/json/explore.js.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.d.ts +16 -0
- package/out/adapters/wof/admin/json/region-codes.d.ts.map +1 -1
- package/out/adapters/wof/admin/json/region-codes.js +62 -3
- package/out/adapters/wof/admin/json/region-codes.js.map +1 -1
- package/out/adapters/wof/json-rows.d.ts +28 -6
- package/out/adapters/wof/json-rows.d.ts.map +1 -1
- package/out/adapters/wof/json-rows.js +9 -15
- package/out/adapters/wof/json-rows.js.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.d.ts +1 -1
- package/out/adapters/wof/postalcode-json/adapter.d.ts.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.js +9 -26
- package/out/adapters/wof/postalcode-json/adapter.js.map +1 -1
- package/out/adapters/wof/sample.d.ts +8 -1
- package/out/adapters/wof/sample.d.ts.map +1 -1
- package/out/adapters/wof/sample.js +12 -4
- package/out/adapters/wof/sample.js.map +1 -1
- package/out/adapters/wof/stored-records.d.ts +62 -0
- package/out/adapters/wof/stored-records.d.ts.map +1 -0
- package/out/adapters/wof/stored-records.js +91 -0
- package/out/adapters/wof/stored-records.js.map +1 -0
- package/out/adapters.d.ts +1 -1
- package/out/adapters.d.ts.map +1 -1
- package/out/adapters.js +15 -3
- package/out/adapters.js.map +1 -1
- package/out/au/adapters/acnc-register/adapter.d.ts +9 -0
- package/out/au/adapters/acnc-register/adapter.d.ts.map +1 -0
- package/out/au/adapters/acnc-register/adapter.js +37 -0
- package/out/au/adapters/acnc-register/adapter.js.map +1 -0
- package/out/au/evaluation/acnc-register.d.ts +56 -0
- package/out/au/evaluation/acnc-register.d.ts.map +1 -0
- package/out/au/evaluation/acnc-register.js +84 -0
- package/out/au/evaluation/acnc-register.js.map +1 -0
- package/out/build/align/range.d.ts.map +1 -1
- package/out/build/align/range.js +9 -0
- package/out/build/align/range.js.map +1 -1
- package/out/build/align/totals.d.ts +5 -0
- package/out/build/align/totals.d.ts.map +1 -1
- package/out/build/align/totals.js +15 -0
- package/out/build/align/totals.js.map +1 -1
- package/out/build/align.d.ts +26 -0
- package/out/build/align.d.ts.map +1 -1
- package/out/build/align.js +35 -2
- package/out/build/align.js.map +1 -1
- package/out/build/budget.d.ts +9 -26
- package/out/build/budget.d.ts.map +1 -1
- package/out/build/budget.js +10 -31
- package/out/build/budget.js.map +1 -1
- package/out/build/checkpoint.d.ts +11 -0
- package/out/build/checkpoint.d.ts.map +1 -1
- package/out/build/checkpoint.js.map +1 -1
- package/out/build/component-check.d.ts +55 -1
- package/out/build/component-check.d.ts.map +1 -1
- package/out/build/component-check.js +65 -3
- package/out/build/component-check.js.map +1 -1
- package/out/build/manifest.d.ts.map +1 -1
- package/out/build/manifest.js +4 -0
- package/out/build/manifest.js.map +1 -1
- package/out/build/parallel.d.ts.map +1 -1
- package/out/build/parallel.js +8 -24
- package/out/build/parallel.js.map +1 -1
- package/out/build/region-names.d.ts +120 -0
- package/out/build/region-names.d.ts.map +1 -0
- package/out/build/region-names.js +430 -0
- package/out/build/region-names.js.map +1 -0
- package/out/build/source-record.d.ts.map +1 -1
- package/out/build/source-record.js +4 -0
- package/out/build/source-record.js.map +1 -1
- package/out/build/types.d.ts +20 -0
- package/out/build/types.d.ts.map +1 -1
- package/out/build/worker.js +3 -1
- package/out/build/worker.js.map +1 -1
- package/out/build.d.ts +0 -1
- package/out/build.d.ts.map +1 -1
- package/out/build.js +3 -5
- package/out/build.js.map +1 -1
- package/out/de/recipes/locale.d.ts.map +1 -1
- package/out/de/recipes/locale.js +3 -2
- package/out/de/recipes/locale.js.map +1 -1
- package/out/env.d.ts +0 -2
- package/out/env.d.ts.map +1 -1
- package/out/env.js +0 -5
- package/out/env.js.map +1 -1
- package/out/es/adapters/sanidad-centros-ap/adapter.d.ts +9 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.d.ts.map +1 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.js +36 -0
- package/out/es/adapters/sanidad-centros-ap/adapter.js.map +1 -0
- package/out/es/evaluation/sanidad-centros-ap.d.ts +34 -0
- package/out/es/evaluation/sanidad-centros-ap.d.ts.map +1 -0
- package/out/es/evaluation/sanidad-centros-ap.js +128 -0
- package/out/es/evaluation/sanidad-centros-ap.js.map +1 -0
- package/out/evaluation/corpus-adapter.d.ts +60 -0
- package/out/evaluation/corpus-adapter.d.ts.map +1 -0
- package/out/evaluation/corpus-adapter.js +100 -0
- package/out/evaluation/corpus-adapter.js.map +1 -0
- package/out/evaluation/source.d.ts +134 -0
- package/out/evaluation/source.d.ts.map +1 -0
- package/out/evaluation/source.js +80 -0
- package/out/evaluation/source.js.map +1 -0
- package/out/evaluation/sources.d.ts +6 -0
- package/out/evaluation/sources.d.ts.map +1 -0
- package/out/evaluation/sources.js +22 -0
- package/out/evaluation/sources.js.map +1 -0
- package/out/fr/adapters/laposte-poincont/adapter.d.ts +110 -0
- package/out/fr/adapters/laposte-poincont/adapter.d.ts.map +1 -0
- package/out/fr/adapters/laposte-poincont/adapter.js +315 -0
- package/out/fr/adapters/laposte-poincont/adapter.js.map +1 -0
- package/out/fr/recipes/unit-line-guideline.d.ts.map +1 -1
- package/out/fr/recipes/unit-line-guideline.js +8 -4
- package/out/fr/recipes/unit-line-guideline.js.map +1 -1
- package/out/fr/structures/laposte.d.ts +27 -0
- package/out/fr/structures/laposte.d.ts.map +1 -0
- package/out/fr/structures/laposte.js +96 -0
- package/out/fr/structures/laposte.js.map +1 -0
- package/out/fr/tools/fetch/laposte-poincont.d.ts +95 -0
- package/out/fr/tools/fetch/laposte-poincont.d.ts.map +1 -0
- package/out/fr/tools/fetch/laposte-poincont.js +135 -0
- package/out/fr/tools/fetch/laposte-poincont.js.map +1 -0
- package/out/it/adapters/miur-scuole/adapter.d.ts +9 -0
- package/out/it/adapters/miur-scuole/adapter.d.ts.map +1 -0
- package/out/it/adapters/miur-scuole/adapter.js +35 -0
- package/out/it/adapters/miur-scuole/adapter.js.map +1 -0
- package/out/it/evaluation/miur-scuole.d.ts +53 -0
- package/out/it/evaluation/miur-scuole.d.ts.map +1 -0
- package/out/it/evaluation/miur-scuole.js +68 -0
- package/out/it/evaluation/miur-scuole.js.map +1 -0
- package/out/jp/adapters/wof-admin/adapter.js +4 -4
- package/out/nc/adapters/opt-nc/adapter.d.ts +84 -0
- package/out/nc/adapters/opt-nc/adapter.d.ts.map +1 -0
- package/out/nc/adapters/opt-nc/adapter.js +173 -0
- package/out/nc/adapters/opt-nc/adapter.js.map +1 -0
- package/out/nc/structures/opt-nc.d.ts +12 -0
- package/out/nc/structures/opt-nc.d.ts.map +1 -0
- package/out/nc/structures/opt-nc.js +64 -0
- package/out/nc/structures/opt-nc.js.map +1 -0
- package/out/nc/tools/fetch/opt-nc.d.ts +81 -0
- package/out/nc/tools/fetch/opt-nc.d.ts.map +1 -0
- package/out/nc/tools/fetch/opt-nc.js +162 -0
- package/out/nc/tools/fetch/opt-nc.js.map +1 -0
- package/out/nz/adapters/charities-register/adapter.d.ts +9 -0
- package/out/nz/adapters/charities-register/adapter.d.ts.map +1 -0
- package/out/nz/adapters/charities-register/adapter.js +36 -0
- package/out/nz/adapters/charities-register/adapter.js.map +1 -0
- package/out/nz/evaluation/charities-register.d.ts +60 -0
- package/out/nz/evaluation/charities-register.d.ts.map +1 -0
- package/out/nz/evaluation/charities-register.js +84 -0
- package/out/nz/evaluation/charities-register.js.map +1 -0
- package/out/recipes/bare/postcode.d.ts +2 -1
- package/out/recipes/bare/postcode.d.ts.map +1 -1
- package/out/recipes/bare/postcode.js +14 -11
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/deepseek/batches.d.ts +11 -1
- package/out/recipes/deepseek/batches.d.ts.map +1 -1
- package/out/recipes/deepseek/batches.js +8 -7
- package/out/recipes/deepseek/batches.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +12 -1
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/us.d.ts +12 -0
- package/out/recipes/po/box/cedex/us.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/us.js +36 -2
- package/out/recipes/po/box/cedex/us.js.map +1 -1
- package/out/recipes/scaffold.d.ts +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +16 -0
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes.d.ts.map +1 -1
- package/out/recipes.js +2 -0
- package/out/recipes.js.map +1 -1
- package/out/registers.d.ts +28 -2
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +28 -2
- package/out/registers.js.map +1 -1
- package/out/{post-offices → structures}/source.d.ts +34 -16
- package/out/structures/source.d.ts.map +1 -0
- package/out/structures/source.js +39 -0
- package/out/structures/source.js.map +1 -0
- package/out/structures/sources.d.ts +6 -0
- package/out/structures/sources.d.ts.map +1 -0
- package/out/structures/sources.js +23 -0
- package/out/structures/sources.js.map +1 -0
- package/out/synthesizers/house-venue.d.ts.map +1 -1
- package/out/synthesizers/house-venue.js +2 -1
- package/out/synthesizers/house-venue.js.map +1 -1
- package/out/synthesizers/tail.d.ts +15 -1
- package/out/synthesizers/tail.d.ts.map +1 -1
- package/out/synthesizers/tail.js +8 -3
- package/out/synthesizers/tail.js.map +1 -1
- package/out/tools/audit.js +1 -1
- package/out/tools/audit.js.map +1 -1
- package/out/tools/fetch/storage.d.ts +10 -2
- package/out/tools/fetch/storage.d.ts.map +1 -1
- package/out/tools/fetch/storage.js +18 -4
- package/out/tools/fetch/storage.js.map +1 -1
- package/out/tools/fetch.d.ts +10 -2
- package/out/tools/fetch.d.ts.map +1 -1
- package/out/tools/fetch.js +10 -2
- package/out/tools/fetch.js.map +1 -1
- package/out/tools/overlay/kryptonite.d.ts.map +1 -1
- package/out/tools/overlay/kryptonite.js +5 -2
- package/out/tools/overlay/kryptonite.js.map +1 -1
- package/out/tools/overlay/split/attribute.d.ts +7 -1
- package/out/tools/overlay/split/attribute.d.ts.map +1 -1
- package/out/tools/overlay/split/attribute.js +4 -1
- package/out/tools/overlay/split/attribute.js.map +1 -1
- package/out/tools/overlay/split/overlay.d.ts +10 -0
- package/out/tools/overlay/split/overlay.d.ts.map +1 -1
- package/out/tools/overlay/split/overlay.js +17 -4
- package/out/tools/overlay/split/overlay.js.map +1 -1
- package/out/tools/postcode/triples.js +3 -3
- package/out/tools/postcode/triples.js.map +1 -1
- package/out/tools/region-slot-census.run.d.ts +2 -0
- package/out/tools/region-slot-census.run.d.ts.map +1 -0
- package/out/tools/region-slot-census.run.js +134 -0
- package/out/tools/region-slot-census.run.js.map +1 -0
- package/out/training/config/load.d.ts.map +1 -1
- package/out/training/config/load.js +10 -0
- package/out/training/config/load.js.map +1 -1
- package/out/training/config/schema.d.ts +13 -0
- package/out/training/config/schema.d.ts.map +1 -1
- package/out/training/config/schema.js +6 -0
- package/out/training/config/schema.js.map +1 -1
- package/out/tw/registers.d.ts +9 -0
- package/out/tw/registers.d.ts.map +1 -1
- package/out/tw/registers.js +11 -4
- package/out/tw/registers.js.map +1 -1
- package/out/tw/structures/chunghwa-post.d.ts +39 -0
- package/out/tw/structures/chunghwa-post.d.ts.map +1 -0
- package/out/tw/structures/chunghwa-post.js +150 -0
- package/out/tw/structures/chunghwa-post.js.map +1 -0
- package/out/tw/tools/fetch/chunghwa-post.d.ts +55 -0
- package/out/tw/tools/fetch/chunghwa-post.d.ts.map +1 -0
- package/out/tw/tools/fetch/chunghwa-post.js +110 -0
- package/out/tw/tools/fetch/chunghwa-post.js.map +1 -0
- package/out/us/adapters/state/ny-notaries/adapter.d.ts.map +1 -1
- package/out/us/adapters/state/ny-notaries/adapter.js +7 -2
- package/out/us/adapters/state/ny-notaries/adapter.js.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.d.ts +42 -0
- package/out/us/adapters/state/tx-notaries/adapter.d.ts.map +1 -1
- package/out/us/adapters/state/tx-notaries/adapter.js +92 -19
- package/out/us/adapters/state/tx-notaries/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.d.ts +35 -2
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +90 -27
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.d.ts.map +1 -1
- package/out/us/adapters/usgov/nppes/adapter.js +8 -11
- package/out/us/adapters/usgov/nppes/adapter.js.map +1 -1
- package/out/us/adapters/usgov/usgs-structures/adapter.d.ts +87 -0
- package/out/us/adapters/usgov/usgs-structures/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/{usgs-post-offices → usgs-structures}/adapter.js +36 -27
- package/out/us/adapters/usgov/usgs-structures/adapter.js.map +1 -0
- package/out/us/recipes/county.d.ts +124 -0
- package/out/us/recipes/county.d.ts.map +1 -0
- package/out/us/recipes/county.js +295 -0
- package/out/us/recipes/county.js.map +1 -0
- package/out/us/street-unit.d.ts +10 -3
- package/out/us/street-unit.d.ts.map +1 -1
- package/out/us/street-unit.js +14 -6
- package/out/us/street-unit.js.map +1 -1
- package/out/us/structures/usgs/layers.d.ts +57 -0
- package/out/us/structures/usgs/layers.d.ts.map +1 -0
- package/out/us/structures/usgs/layers.js +121 -0
- package/out/us/structures/usgs/layers.js.map +1 -0
- package/out/us/structures/usgs/national-map.d.ts +14 -0
- package/out/us/structures/usgs/national-map.d.ts.map +1 -0
- package/out/us/{post-offices/usgs-national-map.js → structures/usgs/national-map.js} +16 -14
- package/out/us/structures/usgs/national-map.js.map +1 -0
- package/out/us/tools/fetch/usgs/gnis.d.ts +118 -0
- package/out/us/tools/fetch/usgs/gnis.d.ts.map +1 -0
- package/out/us/tools/fetch/usgs/gnis.js +177 -0
- package/out/us/tools/fetch/usgs/gnis.js.map +1 -0
- package/out/us/tools/fetch/usgs/structures.d.ts +99 -0
- package/out/us/tools/fetch/usgs/structures.d.ts.map +1 -0
- package/out/us/tools/fetch/usgs/structures.js +233 -0
- package/out/us/tools/fetch/usgs/structures.js.map +1 -0
- package/out/utils/align.js.map +1 -1
- package/out/utils/evaluation-groups.d.ts +98 -0
- package/out/utils/evaluation-groups.d.ts.map +1 -0
- package/out/utils/evaluation-groups.js +92 -0
- package/out/utils/evaluation-groups.js.map +1 -0
- package/out/utils/split.d.ts +26 -1
- package/out/utils/split.d.ts.map +1 -1
- package/out/utils/split.js +28 -3
- package/out/utils/split.js.map +1 -1
- package/out/utils/tokenize.d.ts +3 -3
- package/out/utils/tokenize.d.ts.map +1 -1
- package/out/utils/tokenize.js.map +1 -1
- package/out/utils/validation-groups.d.ts +168 -0
- package/out/utils/validation-groups.d.ts.map +1 -0
- package/out/utils/validation-groups.js +135 -0
- package/out/utils/validation-groups.js.map +1 -0
- package/out/utils/wof-json.d.ts +31 -57
- package/out/utils/wof-json.d.ts.map +1 -1
- package/out/utils/wof-json.js +81 -98
- package/out/utils/wof-json.js.map +1 -1
- package/package.json +18 -18
- package/lib/adapters/wof/record-cache.ts +0 -118
- package/lib/build/heap.ts +0 -60
- package/lib/post-offices/sources.ts +0 -18
- package/lib/us/post-offices/usgs-national-map.ts +0 -89
- package/lib/us/tools/fetch/usgs-post-offices.ts +0 -362
- package/out/adapters/wof/record-cache.d.ts +0 -22
- package/out/adapters/wof/record-cache.d.ts.map +0 -1
- package/out/adapters/wof/record-cache.js +0 -89
- package/out/adapters/wof/record-cache.js.map +0 -1
- package/out/build/heap.d.ts +0 -26
- package/out/build/heap.d.ts.map +0 -1
- package/out/build/heap.js +0 -52
- package/out/build/heap.js.map +0 -1
- package/out/post-offices/source.d.ts.map +0 -1
- package/out/post-offices/source.js +0 -21
- package/out/post-offices/source.js.map +0 -1
- package/out/post-offices/sources.d.ts +0 -13
- package/out/post-offices/sources.d.ts.map +0 -1
- package/out/post-offices/sources.js +0 -8
- package/out/post-offices/sources.js.map +0 -1
- package/out/us/adapters/usgov/usgs-post-offices/adapter.d.ts +0 -66
- package/out/us/adapters/usgov/usgs-post-offices/adapter.d.ts.map +0 -1
- package/out/us/adapters/usgov/usgs-post-offices/adapter.js.map +0 -1
- package/out/us/post-offices/usgs-national-map.d.ts +0 -14
- package/out/us/post-offices/usgs-national-map.d.ts.map +0 -1
- package/out/us/post-offices/usgs-national-map.js.map +0 -1
- package/out/us/tools/fetch/usgs-post-offices.d.ts +0 -99
- package/out/us/tools/fetch/usgs-post-offices.d.ts.map +0 -1
- package/out/us/tools/fetch/usgs-post-offices.js +0 -246
- package/out/us/tools/fetch/usgs-post-offices.js.map +0 -1
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `us-county` — US counties written as an address writes them, read from Who's On First.
|
|
3
|
+
*
|
|
4
|
+
* The recipe writes three sources, so a training config weighs each shape on its own:
|
|
5
|
+
*
|
|
6
|
+
* - `rendered-us-county`: `Polk County, OR` and `Polk County, Oregon`, two rows per county.
|
|
7
|
+
* - `rendered-us-city-county`: `Dallas, Polk County, OR 97338`, a WOF locality inside
|
|
8
|
+
* that county, with one of the locality's ZIP Codes on half the rows that have one.
|
|
9
|
+
* - `rendered-us-city-state`: `Dallas, OR` and `Dallas, OR 97338`, the same localities without
|
|
10
|
+
* the county, so a trailing `, CA` has California rows to weigh against the Canadian ones.
|
|
11
|
+
*
|
|
12
|
+
* The designator (`County`, `Parish`, `Borough`, `Census Area`, `City and Borough`)
|
|
13
|
+
* is part of the `subregion` span.
|
|
14
|
+
* WOF's admin database writes a county's name bare (`Polk`), so the designator comes from
|
|
15
|
+
* the record's own `wof:label` (`Polk County`), else from an English name that writes one.
|
|
16
|
+
*
|
|
17
|
+
* A county whose records write none, and an independent city (`City of Richmond`), get no county row.
|
|
18
|
+
*/
|
|
19
|
+
import { type USCountyDesignator } from "@mailwoman/codex/us/county";
|
|
20
|
+
import { type USStateAbbreviation } from "@mailwoman/codex/us/state";
|
|
21
|
+
import type { PathBuilderLike } from "path-ts";
|
|
22
|
+
import { type CanonicalRecipeRow, type CorpusRecipe } from "#recipes/scaffold";
|
|
23
|
+
/**
|
|
24
|
+
* One county with the designator its WOF records write.
|
|
25
|
+
*/
|
|
26
|
+
export interface USCounty {
|
|
27
|
+
id: number;
|
|
28
|
+
/**
|
|
29
|
+
* The county as an address writes it: `Polk County`.
|
|
30
|
+
*/
|
|
31
|
+
surface: string;
|
|
32
|
+
designator: USCountyDesignator;
|
|
33
|
+
state: USStateAbbreviation;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* One WOF locality inside exactly one county, with the ZIP Codes whose parent it is.
|
|
37
|
+
*/
|
|
38
|
+
export interface USCountyLocality {
|
|
39
|
+
id: number;
|
|
40
|
+
name: string;
|
|
41
|
+
countyID: number;
|
|
42
|
+
postcodes: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* What {@link readUSCountyPool} read, and what it set aside with the reason.
|
|
46
|
+
*/
|
|
47
|
+
export interface USCountyPool {
|
|
48
|
+
counties: readonly USCounty[];
|
|
49
|
+
localities: readonly USCountyLocality[];
|
|
50
|
+
/**
|
|
51
|
+
* Current US county records the pool holds no county for, keyed by why.
|
|
52
|
+
*/
|
|
53
|
+
setAside: Readonly<Record<"noDesignator" | "noState", readonly string[]>>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The surface a county's WOF record writes it with: the first of `wof:label`
|
|
57
|
+
* and its English names that's its own name followed by a designator.
|
|
58
|
+
*/
|
|
59
|
+
export declare function countySurface(name: string, written: readonly unknown[]): {
|
|
60
|
+
surface: string;
|
|
61
|
+
designator: USCountyDesignator;
|
|
62
|
+
} | null;
|
|
63
|
+
/**
|
|
64
|
+
* Where {@link readUSCountyPool} reads.
|
|
65
|
+
*/
|
|
66
|
+
export interface USCountyPoolPaths {
|
|
67
|
+
/**
|
|
68
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/db/wof/admin-global-priority.db`
|
|
69
|
+
*/
|
|
70
|
+
adminDB?: PathBuilderLike;
|
|
71
|
+
/**
|
|
72
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/db/wof/postalcode-us.db`
|
|
73
|
+
*/
|
|
74
|
+
postcodeDB?: PathBuilderLike;
|
|
75
|
+
/**
|
|
76
|
+
* The WOF record store.
|
|
77
|
+
* It keeps each record's `wof:label`.
|
|
78
|
+
*
|
|
79
|
+
* @defaultValue the store for `$MAILWOMAN_DATA_ROOT/src/wof-repos`
|
|
80
|
+
*/
|
|
81
|
+
recordStore?: PathBuilderLike;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Reads every current US county, its state and its designator, and every current locality
|
|
85
|
+
* that WOF places in exactly one of those counties, with its ZIP Codes.
|
|
86
|
+
*
|
|
87
|
+
* @throws When a database is absent, because a pool read without one would hold
|
|
88
|
+
* no designators or no ZIP Codes and still look whole.
|
|
89
|
+
*/
|
|
90
|
+
export declare function readUSCountyPool(paths?: USCountyPoolPaths): Promise<USCountyPool>;
|
|
91
|
+
/**
|
|
92
|
+
* The three sources this recipe writes, in the table spelling {@linkcode defaultRecipeSource} answers.
|
|
93
|
+
*/
|
|
94
|
+
export declare const US_COUNTY_SOURCES: {
|
|
95
|
+
readonly county: string;
|
|
96
|
+
readonly cityCounty: string;
|
|
97
|
+
readonly cityState: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* One row the recipe writes, before alignment, with the template that shaped it.
|
|
101
|
+
*/
|
|
102
|
+
export interface USCountyRow {
|
|
103
|
+
canonical: CanonicalRecipeRow;
|
|
104
|
+
template: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Every county's two bare rows, `Polk County, OR` and `Polk County, Oregon`.
|
|
108
|
+
*/
|
|
109
|
+
export declare function countyRows(counties: readonly USCounty[]): USCountyRow[];
|
|
110
|
+
/**
|
|
111
|
+
* `<City>, <Name> County, <ST>[ <ZIP>]` rows, at most `count`, spread so every
|
|
112
|
+
* county contributes a row before any contributes a second.
|
|
113
|
+
*/
|
|
114
|
+
export declare function cityCountyRows(pool: USCountyPool, count: number, random: () => number): USCountyRow[];
|
|
115
|
+
/**
|
|
116
|
+
* `<City>, <ST>[ <ZIP>]` rows, at most `count`, spread so every state contributes a row
|
|
117
|
+
* before any contributes a second.
|
|
118
|
+
*/
|
|
119
|
+
export declare function cityStateRows(pool: USCountyPool, count: number, random: () => number): USCountyRow[];
|
|
120
|
+
/**
|
|
121
|
+
* Recipe registered with the corpus builder.
|
|
122
|
+
*/
|
|
123
|
+
export declare const usCountyRecipe: CorpusRecipe;
|
|
124
|
+
//# sourceMappingURL=county.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"county.d.ts","sourceRoot":"","sources":["../../../lib/us/recipes/county.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAA2B,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EAA2C,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAY7G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAiB,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAkB,MAAM,mBAAmB,CAAA;AAK7G;;GAEG;AACH,MAAM,WAAW,QAAQ;IACxB,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,kBAAkB,CAAA;IAC9B,KAAK,EAAE,mBAAmB,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC7B,UAAU,EAAE,SAAS,gBAAgB,EAAE,CAAA;IACvC;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,GAAG,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAA;CACzE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,IAAI,EAAE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US counties written as an address writes them, read from Who's On First.
|
|
5
|
+
*
|
|
6
|
+
* The recipe writes three sources, so a training config weighs each shape on its own:
|
|
7
|
+
*
|
|
8
|
+
* - `rendered-us-county`: `Polk County, OR` and `Polk County, Oregon`, two rows per county.
|
|
9
|
+
* - `rendered-us-city-county`: `Dallas, Polk County, OR 97338`, a WOF locality inside
|
|
10
|
+
* that county, with one of the locality's ZIP Codes on half the rows that have one.
|
|
11
|
+
* - `rendered-us-city-state`: `Dallas, OR` and `Dallas, OR 97338`, the same localities without
|
|
12
|
+
* the county, so a trailing `, CA` has California rows to weigh against the Canadian ones.
|
|
13
|
+
*
|
|
14
|
+
* The designator (`County`, `Parish`, `Borough`, `Census Area`, `City and Borough`)
|
|
15
|
+
* is part of the `subregion` span.
|
|
16
|
+
* WOF's admin database writes a county's name bare (`Polk`), so the designator comes from
|
|
17
|
+
* the record's own `wof:label` (`Polk County`), else from an English name that writes one.
|
|
18
|
+
*
|
|
19
|
+
* A county whose records write none, and an independent city (`City of Richmond`), get no county row.
|
|
20
|
+
*/
|
|
21
|
+
import { splitUSCountyDesignator } from "@mailwoman/codex/us/county";
|
|
22
|
+
import { lookupUSState, US_STATE_BY_ABBREVIATION } from "@mailwoman/codex/us/state";
|
|
23
|
+
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
24
|
+
import { assertPathExists } from "@mailwoman/core/fs/readers/stat";
|
|
25
|
+
import { mulberry32, shuffleWith } from "@mailwoman/core/random";
|
|
26
|
+
import { storedWOFRecords, wofRecordStorePathFor, } from "@mailwoman/gazetteer/whosonfirst/record-store";
|
|
27
|
+
import { wofDatabasePath } from "@mailwoman/resolver-wof-sqlite/paths";
|
|
28
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
29
|
+
import { alignAndWrite, recipeSourceID } from "#recipes/scaffold";
|
|
30
|
+
import { defaultRecipeSource } from "#recipes/sources";
|
|
31
|
+
import { SourceRegister } from "#registers";
|
|
32
|
+
import { SurfaceOrigin } from "#types";
|
|
33
|
+
/**
|
|
34
|
+
* The surface a county's WOF record writes it with: the first of `wof:label`
|
|
35
|
+
* and its English names that's its own name followed by a designator.
|
|
36
|
+
*/
|
|
37
|
+
export function countySurface(name, written) {
|
|
38
|
+
for (const candidate of written) {
|
|
39
|
+
if (typeof candidate !== "string")
|
|
40
|
+
continue;
|
|
41
|
+
const split = splitUSCountyDesignator(candidate);
|
|
42
|
+
if (split && split.name.toLowerCase() === name.trim().toLowerCase()) {
|
|
43
|
+
return { surface: `${split.name} ${split.designator}`, designator: split.designator };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Reads every current US county, its state and its designator, and every current locality
|
|
50
|
+
* that WOF places in exactly one of those counties, with its ZIP Codes.
|
|
51
|
+
*
|
|
52
|
+
* @throws When a database is absent, because a pool read without one would hold
|
|
53
|
+
* no designators or no ZIP Codes and still look whole.
|
|
54
|
+
*/
|
|
55
|
+
export async function readUSCountyPool(paths = {}) {
|
|
56
|
+
const adminDB = paths.adminDB ?? wofDatabasePath("admin-global-priority.db");
|
|
57
|
+
const postcodeDB = paths.postcodeDB ?? wofDatabasePath("postalcode-us.db");
|
|
58
|
+
const recordStore = paths.recordStore ?? wofRecordStorePathFor(dataRootPath("src", "wof-repos"));
|
|
59
|
+
await assertPathExists(adminDB, `us-county: no admin gazetteer at ${adminDB}`);
|
|
60
|
+
await assertPathExists(postcodeDB, `us-county: no US postcode database at ${postcodeDB}`);
|
|
61
|
+
await assertPathExists(recordStore, `us-county: no WOF record store at ${recordStore}`);
|
|
62
|
+
const written = new Map();
|
|
63
|
+
{
|
|
64
|
+
using store = new DatabaseClient(recordStore, { readOnly: true });
|
|
65
|
+
for (const record of storedWOFRecords(store, { country: "US", placetypes: new Set(["county"]) })) {
|
|
66
|
+
const properties = record.feature.properties ?? {};
|
|
67
|
+
const variants = properties["name:eng_x_variant"];
|
|
68
|
+
written.set(record.id, [properties["wof:label"], ...(Array.isArray(variants) ? variants : [])]);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
using db = new DatabaseClient(adminDB, { readOnly: true });
|
|
72
|
+
const countyRecords = db
|
|
73
|
+
.prepare(`SELECT s.id AS id, s.name AS name, min(r.name) AS region
|
|
74
|
+
FROM spr s
|
|
75
|
+
JOIN ancestors a ON a.id = s.id AND a.ancestor_placetype = 'region'
|
|
76
|
+
JOIN spr r ON r.id = a.ancestor_id
|
|
77
|
+
WHERE s.country = 'US' AND s.placetype = 'county' AND s.is_current != 0 AND s.is_deprecated = 0
|
|
78
|
+
GROUP BY s.id ORDER BY s.id`)
|
|
79
|
+
.all();
|
|
80
|
+
const englishVariants = db.prepare(`SELECT name FROM names WHERE id = ? AND language = 'eng' AND privateuse = 'variant' ORDER BY name`);
|
|
81
|
+
const counties = [];
|
|
82
|
+
const noDesignator = [];
|
|
83
|
+
const noState = [];
|
|
84
|
+
for (const row of countyRecords) {
|
|
85
|
+
const state = lookupUSState(row.region);
|
|
86
|
+
if (!state) {
|
|
87
|
+
noState.push(`${row.id} ${row.name}, ${row.region}`);
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
const variants = englishVariants.all(row.id).map((v) => v.name);
|
|
91
|
+
const found = countySurface(row.name, [...(written.get(row.id) ?? []), ...variants]);
|
|
92
|
+
if (!found) {
|
|
93
|
+
noDesignator.push(`${row.id} ${row.name}, ${state}`);
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
counties.push({ id: row.id, ...found, state });
|
|
97
|
+
}
|
|
98
|
+
const known = new Set(counties.map((county) => county.id));
|
|
99
|
+
const postcodes = new Map();
|
|
100
|
+
{
|
|
101
|
+
using pc = new DatabaseClient(postcodeDB, { readOnly: true });
|
|
102
|
+
for (const row of pc
|
|
103
|
+
.prepare(`SELECT parent_id, name FROM spr WHERE placetype = 'postalcode' AND parent_id > 0 AND is_current != 0 ORDER BY name`)
|
|
104
|
+
.all()) {
|
|
105
|
+
const list = postcodes.get(row.parent_id) ?? [];
|
|
106
|
+
list.push(row.name);
|
|
107
|
+
postcodes.set(row.parent_id, list);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// A locality WOF places in two counties names neither as its own.
|
|
111
|
+
const localityRows = db
|
|
112
|
+
.prepare(`SELECT s.id AS id, s.name AS name, min(a.ancestor_id) AS county_id
|
|
113
|
+
FROM spr s
|
|
114
|
+
JOIN ancestors a ON a.id = s.id AND a.ancestor_placetype = 'county'
|
|
115
|
+
WHERE s.country = 'US' AND s.placetype = 'locality' AND s.is_current != 0 AND s.is_deprecated = 0
|
|
116
|
+
GROUP BY s.id HAVING count(DISTINCT a.ancestor_id) = 1 ORDER BY s.id`)
|
|
117
|
+
.all();
|
|
118
|
+
const localities = localityRows
|
|
119
|
+
.filter((row) => row.name.trim() && known.has(row.county_id))
|
|
120
|
+
.map((row) => ({
|
|
121
|
+
id: row.id,
|
|
122
|
+
name: row.name.trim(),
|
|
123
|
+
countyID: row.county_id,
|
|
124
|
+
postcodes: postcodes.get(row.id) ?? [],
|
|
125
|
+
}));
|
|
126
|
+
return { counties, localities, setAside: { noDesignator, noState } };
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The three sources this recipe writes, in the table spelling {@linkcode defaultRecipeSource} answers.
|
|
130
|
+
*/
|
|
131
|
+
export const US_COUNTY_SOURCES = {
|
|
132
|
+
county: defaultRecipeSource("synth-us-county"),
|
|
133
|
+
cityCounty: defaultRecipeSource("synth-us-city-county"),
|
|
134
|
+
cityState: defaultRecipeSource("synth-us-city-state"),
|
|
135
|
+
};
|
|
136
|
+
const LICENSE = "Who's On First — us-county; county, locality and ZIP Code records (CC0/ODC-By per source)";
|
|
137
|
+
function recipeRow(source, template, raw, components, parts) {
|
|
138
|
+
return {
|
|
139
|
+
template,
|
|
140
|
+
canonical: {
|
|
141
|
+
raw,
|
|
142
|
+
components,
|
|
143
|
+
country: "US",
|
|
144
|
+
locale: "en-US",
|
|
145
|
+
source,
|
|
146
|
+
source_id: recipeSourceID(source, { template, ...parts }),
|
|
147
|
+
license: LICENSE,
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Every county's two bare rows, `Polk County, OR` and `Polk County, Oregon`.
|
|
153
|
+
*/
|
|
154
|
+
export function countyRows(counties) {
|
|
155
|
+
return counties.flatMap((county) => {
|
|
156
|
+
const stateName = US_STATE_BY_ABBREVIATION[county.state];
|
|
157
|
+
const parts = { county: String(county.id) };
|
|
158
|
+
return [
|
|
159
|
+
recipeRow(US_COUNTY_SOURCES.county, "us-county:code", `${county.surface}, ${county.state}`, { subregion: county.surface, region: county.state }, parts),
|
|
160
|
+
recipeRow(US_COUNTY_SOURCES.county, "us-county:name", `${county.surface}, ${stateName}`, { subregion: county.surface, region: stateName }, parts),
|
|
161
|
+
];
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Localities in a seeded order that reaches every group before any group's second:
|
|
166
|
+
* each round takes the next locality of every group.
|
|
167
|
+
*/
|
|
168
|
+
function roundRobin(localities, groupOf, random) {
|
|
169
|
+
const groups = new Map();
|
|
170
|
+
for (const locality of localities) {
|
|
171
|
+
const key = groupOf(locality);
|
|
172
|
+
const list = groups.get(key) ?? [];
|
|
173
|
+
list.push(locality);
|
|
174
|
+
groups.set(key, list);
|
|
175
|
+
}
|
|
176
|
+
const order = [...groups.keys()];
|
|
177
|
+
shuffleWith(order, random);
|
|
178
|
+
for (const list of groups.values()) {
|
|
179
|
+
shuffleWith(list, random);
|
|
180
|
+
}
|
|
181
|
+
const out = [];
|
|
182
|
+
const deepest = Math.max(0, ...[...groups.values()].map((list) => list.length));
|
|
183
|
+
for (let round = 0; round < deepest; round++) {
|
|
184
|
+
for (const key of order) {
|
|
185
|
+
const locality = groups.get(key)[round];
|
|
186
|
+
if (locality) {
|
|
187
|
+
out.push(locality);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return out;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Draws a ZIP Code for every other row whose locality has one, from that locality's own,
|
|
195
|
+
* so the rows with a ZIP Code and those without split the localities that have one.
|
|
196
|
+
*/
|
|
197
|
+
function postcodeDrawer(random) {
|
|
198
|
+
let eligible = 0;
|
|
199
|
+
return (locality) => {
|
|
200
|
+
if (!locality.postcodes.length || eligible++ % 2 === 1)
|
|
201
|
+
return null;
|
|
202
|
+
return locality.postcodes[Math.floor(random() * locality.postcodes.length)];
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* `<City>, <Name> County, <ST>[ <ZIP>]` rows, at most `count`, spread so every
|
|
207
|
+
* county contributes a row before any contributes a second.
|
|
208
|
+
*/
|
|
209
|
+
export function cityCountyRows(pool, count, random) {
|
|
210
|
+
const counties = new Map(pool.counties.map((county) => [county.id, county]));
|
|
211
|
+
const drawPostcode = postcodeDrawer(random);
|
|
212
|
+
return roundRobin(pool.localities, (locality) => String(locality.countyID), random)
|
|
213
|
+
.slice(0, count)
|
|
214
|
+
.map((locality) => {
|
|
215
|
+
const county = counties.get(locality.countyID);
|
|
216
|
+
const postcode = drawPostcode(locality);
|
|
217
|
+
const tail = postcode ? `${county.state} ${postcode}` : county.state;
|
|
218
|
+
return recipeRow(US_COUNTY_SOURCES.cityCounty, postcode ? "us-county:city-county-zip" : "us-county:city-county", `${locality.name}, ${county.surface}, ${tail}`, {
|
|
219
|
+
locality: locality.name,
|
|
220
|
+
subregion: county.surface,
|
|
221
|
+
region: county.state,
|
|
222
|
+
...(postcode ? { postcode } : {}),
|
|
223
|
+
}, { locality: String(locality.id), county: String(county.id), postcode: postcode ?? "" });
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* `<City>, <ST>[ <ZIP>]` rows, at most `count`, spread so every state contributes a row
|
|
228
|
+
* before any contributes a second.
|
|
229
|
+
*/
|
|
230
|
+
export function cityStateRows(pool, count, random) {
|
|
231
|
+
const counties = new Map(pool.counties.map((county) => [county.id, county]));
|
|
232
|
+
const drawPostcode = postcodeDrawer(random);
|
|
233
|
+
return roundRobin(pool.localities, (locality) => counties.get(locality.countyID).state, random)
|
|
234
|
+
.slice(0, count)
|
|
235
|
+
.map((locality) => {
|
|
236
|
+
const state = counties.get(locality.countyID).state;
|
|
237
|
+
const postcode = drawPostcode(locality);
|
|
238
|
+
return recipeRow(US_COUNTY_SOURCES.cityState, postcode ? "us-county:city-state-zip" : "us-county:city-state", postcode ? `${locality.name}, ${state} ${postcode}` : `${locality.name}, ${state}`, { locality: locality.name, region: state, ...(postcode ? { postcode } : {}) }, { locality: String(locality.id), postcode: postcode ?? "" });
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The rows read straight from a published record, so the register is WOF's.
|
|
243
|
+
*/
|
|
244
|
+
const US_COUNTY_PROVENANCE = {
|
|
245
|
+
register: SourceRegister.WhosOnFirst,
|
|
246
|
+
surface: SurfaceOrigin.Composed,
|
|
247
|
+
// The WOF ids that make each row are in its `source_id` parts.
|
|
248
|
+
// No corpus row stands behind it.
|
|
249
|
+
baseSourceID: null,
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Recipe registered with the corpus builder.
|
|
253
|
+
*/
|
|
254
|
+
export const usCountyRecipe = {
|
|
255
|
+
name: "us-county",
|
|
256
|
+
description: "US counties from WOF: 'Polk County, OR', 'Polk County, Oregon', 'Dallas, Polk County, OR 97338' and 'Dallas, OR[ 97338]'",
|
|
257
|
+
mode: "generate",
|
|
258
|
+
options: [
|
|
259
|
+
{
|
|
260
|
+
flag: "--count <n>",
|
|
261
|
+
description: "Rows for each of rendered-us-city-county and rendered-us-city-state. Every county writes its two rendered-us-county rows regardless.",
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
flag: "--admin-db <path>",
|
|
265
|
+
description: "WOF admin database. Default $MAILWOMAN_DATA_ROOT/db/wof/admin-global-priority.db",
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
async run(opts, write) {
|
|
269
|
+
const count = opts.count ?? 0;
|
|
270
|
+
if (!(count >= 0))
|
|
271
|
+
throw new Error(`us-county: --count must be a non-negative number, got ${opts.count}`);
|
|
272
|
+
const pool = await readUSCountyPool({ adminDB: opts.adminDB });
|
|
273
|
+
console.error(` us-county: ${pool.counties.length} counties, ${pool.localities.length} localities; ` +
|
|
274
|
+
`set aside ${pool.setAside.noDesignator.length} with no designator (${pool.setAside.noDesignator.join("; ")}) ` +
|
|
275
|
+
`and ${pool.setAside.noState.length} with no state`);
|
|
276
|
+
const random = mulberry32(opts.seed);
|
|
277
|
+
const rows = [
|
|
278
|
+
...countyRows(pool.counties),
|
|
279
|
+
...cityCountyRows(pool, count, random),
|
|
280
|
+
...cityStateRows(pool, count, random),
|
|
281
|
+
];
|
|
282
|
+
let emitted = 0;
|
|
283
|
+
let skipped = 0;
|
|
284
|
+
for (const { canonical, template } of rows) {
|
|
285
|
+
if (alignAndWrite(write, canonical, template, US_COUNTY_PROVENANCE)) {
|
|
286
|
+
emitted++;
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
skipped++;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return { read: pool.counties.length + pool.localities.length, emitted, skipped };
|
|
293
|
+
},
|
|
294
|
+
};
|
|
295
|
+
//# sourceMappingURL=county.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"county.js","sourceRoot":"","sources":["../../../lib/us/recipes/county.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,uBAAuB,EAA2B,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAA4B,MAAM,2BAA2B,CAAA;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,O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C,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAA;IACjF,CAAC;CACD,CAAA"}
|
package/out/us/street-unit.d.ts
CHANGED
|
@@ -21,11 +21,18 @@ export type USStreetLineComponents = {
|
|
|
21
21
|
unit?: string;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Splits one US street line, as a register writes it, into its address components.
|
|
25
|
-
*
|
|
26
24
|
* A whole line that's a box designator and an identifier holding a digit
|
|
27
|
-
* (`PO BOX 846`, `P.O. Box 10240`)
|
|
25
|
+
* (`PO BOX 846`, `P.O. Box 10240`, `POB 1088`) as the `po_box` component, or `null` for any other line.
|
|
26
|
+
*
|
|
28
27
|
* The digit requirement keeps a street such as `BOX ELDER RD` a street.
|
|
28
|
+
*/
|
|
29
|
+
export declare function usPOBoxLine(line: string): {
|
|
30
|
+
po_box: string;
|
|
31
|
+
} | null;
|
|
32
|
+
/**
|
|
33
|
+
* Splits one US street line, as a register writes it, into its address components.
|
|
34
|
+
*
|
|
35
|
+
* A whole-line PO box ({@linkcode usPOBoxLine}) becomes `po_box`.
|
|
29
36
|
*
|
|
30
37
|
* Any other line takes the house number off its start with `splitStreetLine`
|
|
31
38
|
* and a secondary unit off its end with the shared unit splitter (`#adapters/street/unit`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"street-unit.d.ts","sourceRoot":"","sources":["../../lib/us/street-unit.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEtE;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUpD;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAElH
|
|
1
|
+
{"version":3,"file":"street-unit.d.ts","sourceRoot":"","sources":["../../lib/us/street-unit.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEtE;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUpD;AAED;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAElH;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAInE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAChC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,YAAY,EACnB,KAAK,GAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAM,GACtC,sBAAsB,GAAG,IAAI,CAc/B"}
|
package/out/us/street-unit.js
CHANGED
|
@@ -26,11 +26,19 @@ export function unitLine(line) {
|
|
|
26
26
|
return matchLeadingDesignator(first.replace(/[.,]$/u, "")) ? trimmed : null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Splits one US street line, as a register writes it, into its address components.
|
|
30
|
-
*
|
|
31
29
|
* A whole line that's a box designator and an identifier holding a digit
|
|
32
|
-
* (`PO BOX 846`, `P.O. Box 10240`)
|
|
30
|
+
* (`PO BOX 846`, `P.O. Box 10240`, `POB 1088`) as the `po_box` component, or `null` for any other line.
|
|
31
|
+
*
|
|
33
32
|
* The digit requirement keeps a street such as `BOX ELDER RD` a street.
|
|
33
|
+
*/
|
|
34
|
+
export function usPOBoxLine(line) {
|
|
35
|
+
const box = matchPOBox(line);
|
|
36
|
+
return box && /\d/u.test(box.id) ? { po_box: line.trim() } : null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Splits one US street line, as a register writes it, into its address components.
|
|
40
|
+
*
|
|
41
|
+
* A whole-line PO box ({@linkcode usPOBoxLine}) becomes `po_box`.
|
|
34
42
|
*
|
|
35
43
|
* Any other line takes the house number off its start with `splitStreetLine`
|
|
36
44
|
* and a secondary unit off its end with the shared unit splitter (`#adapters/street/unit`),
|
|
@@ -39,9 +47,9 @@ export function unitLine(line) {
|
|
|
39
47
|
* @returns `null` for a blank line.
|
|
40
48
|
*/
|
|
41
49
|
export function splitUSStreetLine(line, units, place = {}) {
|
|
42
|
-
const box =
|
|
43
|
-
if (box
|
|
44
|
-
return
|
|
50
|
+
const box = usPOBoxLine(line);
|
|
51
|
+
if (box)
|
|
52
|
+
return box;
|
|
45
53
|
const split = splitStreetLine(line);
|
|
46
54
|
if (!split)
|
|
47
55
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"street-unit.js","sourceRoot":"","sources":["../../lib/us/street-unit.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAGvD;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAE3B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAEzB,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAA;IAE5C,MAA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AAE,CAAC,CAAC,CAAC,IAAI,CAAA;AAClE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAChC,IAAY,EACZ,KAAmB,EACnB,KAAK,GAAiC,EAAE;IAExC,MAAM,GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IAE7B,IAAI,GAAG;QAAE,OAAO,GAAG,CAAA;IACnB,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA;IAEnC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IAEvE,OAAO;QACN,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,CAAC,MAAM;QACxC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC5C,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The point layers of the USGS National Map structures MapServer, one entry per layer the
|
|
3
|
+
* fetcher pulls, the adapter trains on, and the structures layer folds into `structures.db`.
|
|
4
|
+
*
|
|
5
|
+
* The service publishes every layer twice: layers 0–34 are the `Labels` group
|
|
6
|
+
* and serve the same rows as the `Features` layers 35 ids above them.
|
|
7
|
+
* The table lists the `Features` layers.
|
|
8
|
+
*
|
|
9
|
+
* The group layers (35, 36, 48, 52, 55, 59, 68) hold no features.
|
|
10
|
+
*
|
|
11
|
+
* Each layer is queried by its own id rather than by feature code, because a feature
|
|
12
|
+
* code isn't unique to a layer: Campgrounds (60) and Shelters (63) are both FCODE 82008.
|
|
13
|
+
*
|
|
14
|
+
* Layer 69, `Alaska Pipeline`, is left out: it holds polylines with no name, address
|
|
15
|
+
* or feature-level identifier, so it is neither a venue nor an address.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* One point layer of the structures MapServer.
|
|
19
|
+
*/
|
|
20
|
+
export interface USGSStructureLayer {
|
|
21
|
+
/**
|
|
22
|
+
* The layer's id in the MapServer's `Features` group.
|
|
23
|
+
*/
|
|
24
|
+
layerID: number;
|
|
25
|
+
/**
|
|
26
|
+
* A stable identifier for the layer, stored on every fetched feature as `layer`.
|
|
27
|
+
*/
|
|
28
|
+
slug: string;
|
|
29
|
+
/**
|
|
30
|
+
* The layer's name as the service states it.
|
|
31
|
+
*/
|
|
32
|
+
name: string;
|
|
33
|
+
/**
|
|
34
|
+
* The `@mailwoman/poi-taxonomy` category id a feature of the layer is filed under.
|
|
35
|
+
*/
|
|
36
|
+
poiCategory: string;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the adapter emits venue-and-address training rows for the layer.
|
|
39
|
+
*
|
|
40
|
+
* A layer whose features have no street address (picnic areas, cabins, trailheads)
|
|
41
|
+
* is a retrieval layer only: its few addressed features describe the access road
|
|
42
|
+
* of a remote site rather than a delivery address.
|
|
43
|
+
*/
|
|
44
|
+
trains: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Every point layer of the structures MapServer, in layer-id order.
|
|
48
|
+
*/
|
|
49
|
+
export declare const USGS_STRUCTURE_LAYERS: readonly USGSStructureLayer[];
|
|
50
|
+
/**
|
|
51
|
+
* The layer with id `layerID`.
|
|
52
|
+
*
|
|
53
|
+
* @throws When the table holds no such layer, so a feature from an unlisted layer
|
|
54
|
+
* is never filed under a guessed category.
|
|
55
|
+
*/
|
|
56
|
+
export declare function usgsStructureLayer(layerID: number): USGSStructureLayer;
|
|
57
|
+
//# sourceMappingURL=layers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layers.d.ts","sourceRoot":"","sources":["../../../../lib/us/structures/usgs/layers.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;;;;;OAMG;IACH,MAAM,EAAE,OAAO,CAAA;CACf;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,kBAAkB,EAqG9D,CAAA;AAID;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,kBAAkB,CAMtE"}
|