@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
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
sibling arms cover the other countries. A layout call would answer the same string for the only country that reaches
|
|
6
6
|
it. */
|
|
7
7
|
|
|
8
|
+
import { matchLeadingDirectional, matchTrailingSuffix } from "@mailwoman/codex/us"
|
|
8
9
|
import { sample } from "@mailwoman/core/random"
|
|
9
10
|
|
|
10
11
|
import { makePoBoxPhrase } from "#recipes/po/box/cedex/phrases"
|
|
@@ -56,11 +57,51 @@ export function renderPoBoxUs(random: () => number, tuple: USTuple): Rendered {
|
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
|
|
60
|
+
const LEADING_WORD = /^(\S+)\s+/u,
|
|
61
|
+
TRAILING_WORD = /\s+(\S+)$/u,
|
|
62
|
+
TRAILING_SUFFIX_AND_DIRECTIONAL = /\s+((\S+)\s+(\S+))$/u
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Splits a US skeleton's street into the schema's `street_prefix`, `street`
|
|
66
|
+
* and `street_suffix`, keeping each span's text as the skeleton writes it.
|
|
67
|
+
*
|
|
68
|
+
* The suffix is the terminal Pub-28 word (`matchTrailingSuffix`), with a post-directional
|
|
69
|
+
* after it joining the suffix as the schema states (`AVENUE NW`).
|
|
70
|
+
* The prefix is a leading directional (`matchLeadingDirectional`).
|
|
71
|
+
*
|
|
72
|
+
* Each is split off only when a street name is left beside it, so `N ST` keeps
|
|
73
|
+
* `N` as its name and a one-word street stays whole.
|
|
74
|
+
*/
|
|
75
|
+
export function splitUSStreet(street: string): Record<string, string> {
|
|
76
|
+
let name = street.trim()
|
|
77
|
+
const parts: Record<string, string> = {}
|
|
78
|
+
const pair = TRAILING_SUFFIX_AND_DIRECTIONAL.exec(name)
|
|
79
|
+
const trailing = TRAILING_WORD.exec(name)
|
|
80
|
+
|
|
81
|
+
if (pair && matchTrailingSuffix(pair[2]!) && matchLeadingDirectional(pair[3]!)) {
|
|
82
|
+
parts.street_suffix = pair[1]!
|
|
83
|
+
name = name.slice(0, pair.index)
|
|
84
|
+
} else if (trailing && matchTrailingSuffix(trailing[1]!)) {
|
|
85
|
+
parts.street_suffix = trailing[1]!
|
|
86
|
+
name = name.slice(0, trailing.index)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const leading = LEADING_WORD.exec(name)
|
|
90
|
+
|
|
91
|
+
if (leading && matchLeadingDirectional(leading[1]!)) {
|
|
92
|
+
parts.street_prefix = leading[1]!
|
|
93
|
+
name = name.slice(leading[0].length)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return { ...parts, street: name }
|
|
97
|
+
}
|
|
98
|
+
|
|
59
99
|
export function renderPmbUs(random: () => number, tuple: USTuple): Rendered {
|
|
60
100
|
const phrase = makePoBoxPhrase(random, US_PMB_LEADERS)
|
|
61
101
|
const { house_number, street, locality, region, postcode } = tuple
|
|
62
102
|
const road = `${house_number} ${street}`
|
|
63
|
-
const
|
|
103
|
+
const streetParts = splitUSStreet(street)
|
|
104
|
+
const components = { house_number, ...streetParts, po_box: phrase, locality, region, postcode }
|
|
64
105
|
const draw = random()
|
|
65
106
|
|
|
66
107
|
if (draw < PMB_AFTER_STREET_CUTOFF)
|
|
@@ -69,5 +110,5 @@ export function renderPmbUs(random: () => number, tuple: USTuple): Rendered {
|
|
|
69
110
|
if (draw < PMB_COMMA_CUTOFF)
|
|
70
111
|
return { fmt: "pmb-comma", raw: `${road}, ${phrase}, ${locality}, ${region} ${postcode}`, components }
|
|
71
112
|
|
|
72
|
-
return { fmt: "pmb-bare", raw: `${road} ${phrase}`, components: { house_number,
|
|
113
|
+
return { fmt: "pmb-bare", raw: `${road} ${phrase}`, components: { house_number, ...streetParts, po_box: phrase } }
|
|
73
114
|
}
|
package/lib/recipes/scaffold.ts
CHANGED
|
@@ -444,7 +444,7 @@ export interface RecipeOptions {
|
|
|
444
444
|
/**
|
|
445
445
|
* `german`: the WOF admin database the Ortsteil pool is read from.
|
|
446
446
|
*
|
|
447
|
-
* @defaultValue `$MAILWOMAN_DATA_ROOT/db/wof/admin-global-priority
|
|
447
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/db/wof/admin-global-priority.db`
|
|
448
448
|
*/
|
|
449
449
|
adminDB?: string
|
|
450
450
|
/**
|
package/lib/recipes/sources.ts
CHANGED
|
@@ -113,6 +113,7 @@ function entries(
|
|
|
113
113
|
|
|
114
114
|
const LOCALE_RECIPE = "international/recipes/locale.ts"
|
|
115
115
|
const TRAILING_REGION = "recipes/trailing-region.ts"
|
|
116
|
+
const US_COUNTY_RECIPE = "us/recipes/county.ts"
|
|
116
117
|
|
|
117
118
|
/**
|
|
118
119
|
* Every recipe-output source that a corpus on disk, a training config
|
|
@@ -159,6 +160,21 @@ export const RECIPE_SOURCES: ReadonlyArray<RecipeSource> = [
|
|
|
159
160
|
["no-street-led", "no/recipes/street/led.ts"],
|
|
160
161
|
["si-bare-village", "si/recipes/bare-village.ts"],
|
|
161
162
|
["nl-postcode", "nl/recipes/postcode.ts"],
|
|
163
|
+
[
|
|
164
|
+
"us-county",
|
|
165
|
+
US_COUNTY_RECIPE,
|
|
166
|
+
"A WOF county and its state, in two rows per county. The retired spelling never reached a corpus: the recipe was written after the rename.",
|
|
167
|
+
],
|
|
168
|
+
[
|
|
169
|
+
"us-city-county",
|
|
170
|
+
US_COUNTY_RECIPE,
|
|
171
|
+
"A WOF locality, the one county WOF places it in, its state and one of its ZIP Codes on half the rows. The retired spelling never reached a corpus.",
|
|
172
|
+
],
|
|
173
|
+
[
|
|
174
|
+
"us-city-state",
|
|
175
|
+
US_COUNTY_RECIPE,
|
|
176
|
+
"A WOF locality and its state, with one of its ZIP Codes on half the rows. The retired spelling never reached a corpus.",
|
|
177
|
+
],
|
|
162
178
|
]),
|
|
163
179
|
// Germany is the one locale the retired names spelled as a language word
|
|
164
180
|
// where every other reads as an ISO code, so its tail becomes `de`.
|
package/lib/recipes.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { venueRecipe } from "#recipes/venue"
|
|
|
46
46
|
import { sgRegisterRecipe } from "#sg/recipes/register"
|
|
47
47
|
import { siBareVillageRecipe } from "#si/recipes/bare-village"
|
|
48
48
|
import { bdRegisterRecipe, pkRegisterRecipe } from "#south-asia/recipes/register"
|
|
49
|
+
import { usCountyRecipe } from "#us/recipes/county"
|
|
49
50
|
import { reviewedPostcodeTailRecipe } from "#ve/recipes/reviewed-postcode-tail"
|
|
50
51
|
|
|
51
52
|
export * from "#recipes/scaffold"
|
|
@@ -56,6 +57,7 @@ export * from "#recipes/scaffold"
|
|
|
56
57
|
const RECIPES: readonly CorpusRecipe[] = [
|
|
57
58
|
bareCountryRecipe,
|
|
58
59
|
trailingRegionRecipe,
|
|
60
|
+
usCountyRecipe,
|
|
59
61
|
reviewedPostcodeTailRecipe,
|
|
60
62
|
streetRecipe,
|
|
61
63
|
streetBareRecipe,
|
package/lib/registers.ts
CHANGED
|
@@ -220,6 +220,32 @@ export const SourceRegister = {
|
|
|
220
220
|
* The education ministry's Annuaire de l'éducation, the directory of schools and education offices.
|
|
221
221
|
*/
|
|
222
222
|
AnnuaireEducation: "fr-annuaire-education",
|
|
223
|
+
/**
|
|
224
|
+
* La Poste's list of its points of contact: post offices, postal agencies,
|
|
225
|
+
* relais poste and partner points.
|
|
226
|
+
*/
|
|
227
|
+
LaPostePoincont: "fr-laposte-poincont",
|
|
228
|
+
/**
|
|
229
|
+
* OPT-NC's list of its agencies in New Caledonia.
|
|
230
|
+
*/
|
|
231
|
+
OPTNCAgences: "nc-opt-agences",
|
|
232
|
+
/**
|
|
233
|
+
* The Ministerio de Sanidad's catalogue of the national health system's primary-care centers.
|
|
234
|
+
*/
|
|
235
|
+
SanidadCentrosAP: "es-sanidad-centros-ap",
|
|
236
|
+
/**
|
|
237
|
+
* The Ministero dell'Istruzione e del Merito's register of state schools (`Anagrafe scuole statali`).
|
|
238
|
+
*/
|
|
239
|
+
MIURScuole: "it-miur-scuole",
|
|
240
|
+
/**
|
|
241
|
+
* The Australian Charities and Not-for-profits Commission's register of charities.
|
|
242
|
+
*/
|
|
243
|
+
ACNCRegister: "au-acnc-register",
|
|
244
|
+
/**
|
|
245
|
+
* The Charities Register that Charities Services, Department of Internal Affairs,
|
|
246
|
+
* publishes for New Zealand.
|
|
247
|
+
*/
|
|
248
|
+
NZCharitiesRegister: "nz-charities-register",
|
|
223
249
|
/**
|
|
224
250
|
* The CORDIS organization files for the participants in the EU's research framework programmes
|
|
225
251
|
* (FP7, Horizon 2020, Horizon Europe), published by the Publications Office of the European Union.
|
|
@@ -280,9 +306,9 @@ export const SourceRegister = {
|
|
|
280
306
|
*/
|
|
281
307
|
IRSBusinessMasterFile: "us-irs-bmf",
|
|
282
308
|
/**
|
|
283
|
-
* The
|
|
309
|
+
* The USGS National Structures Dataset, served by the National Map structures MapServer.
|
|
284
310
|
*/
|
|
285
|
-
|
|
311
|
+
USGSStructures: "us-usgs-structures",
|
|
286
312
|
/**
|
|
287
313
|
* SAMHSA's behavioral health treatment services locator.
|
|
288
314
|
*/
|
|
@@ -2,28 +2,36 @@
|
|
|
2
2
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* The contract
|
|
5
|
+
* The contract an official list of public structures satisfies to join the structures layer.
|
|
6
6
|
*
|
|
7
|
-
* `mailwoman gazetteer build
|
|
8
|
-
* (`#
|
|
7
|
+
* `mailwoman gazetteer build structures` folds every source in `STRUCTURE_SOURCES`
|
|
8
|
+
* (`#structures/sources`) into one `structures.db`.
|
|
9
9
|
* A source's identity, terms and reader live in its entry, under its country's
|
|
10
|
-
* directory (`lib/<cc>/
|
|
10
|
+
* directory (`lib/<cc>/structures/`).
|
|
11
|
+
*
|
|
12
|
+
* A source may hold one category of structure, such as a postal operator's list of its post offices.
|
|
13
|
+
* Every record of such a list is filed under the post-office category.
|
|
14
|
+
*
|
|
15
|
+
* A source may also hold several categories, such as the USGS National Structures Dataset.
|
|
16
|
+
* The post-office parse suite reads the records filed under {@linkcode postOfficeCategoryID}.
|
|
11
17
|
*
|
|
12
18
|
* The layer builder reads only the fields below and never branches on a country.
|
|
13
19
|
*/
|
|
14
20
|
|
|
15
21
|
import type { ComponentTag } from "@mailwoman/codex/component"
|
|
22
|
+
import { lookupPOICategory } from "@mailwoman/poi-taxonomy/lookup"
|
|
16
23
|
import type { PathBuilder } from "path-ts"
|
|
17
24
|
|
|
18
25
|
/**
|
|
19
|
-
* Who compiled a
|
|
26
|
+
* Who compiled a list of structures.
|
|
20
27
|
*
|
|
21
|
-
*
|
|
28
|
+
* An operator's own facility list, such as a postal operator's list of its post offices,
|
|
29
|
+
* is the operator's record of where it serves the public.
|
|
22
30
|
* A mapping agency's compilation is another body's observation of those facilities.
|
|
23
31
|
*
|
|
24
32
|
* The layer records the class beside each source so a reader can prefer the operator's record.
|
|
25
33
|
*/
|
|
26
|
-
export const
|
|
34
|
+
export const StructureProvenance = {
|
|
27
35
|
/**
|
|
28
36
|
* The postal operator's own list of its facilities.
|
|
29
37
|
*/
|
|
@@ -34,17 +42,22 @@ export const PostOfficeProvenance = {
|
|
|
34
42
|
MappingAgency: "mapping-agency",
|
|
35
43
|
} as const
|
|
36
44
|
|
|
37
|
-
export type
|
|
45
|
+
export type StructureProvenance = (typeof StructureProvenance)[keyof typeof StructureProvenance]
|
|
38
46
|
|
|
39
47
|
/**
|
|
40
|
-
* One
|
|
48
|
+
* One structure as a source reads it.
|
|
41
49
|
*/
|
|
42
|
-
export interface
|
|
50
|
+
export interface StructureRecord {
|
|
43
51
|
/**
|
|
44
52
|
* The publisher's own identifier for the facility, unique within the source.
|
|
45
53
|
*/
|
|
46
54
|
id: string
|
|
47
55
|
name: string | null
|
|
56
|
+
/**
|
|
57
|
+
* The `@mailwoman/poi-taxonomy` category id the structure is filed under.
|
|
58
|
+
* The layer refuses an id the taxonomy doesn't hold.
|
|
59
|
+
*/
|
|
60
|
+
category: string
|
|
48
61
|
/**
|
|
49
62
|
* `null` when the publisher records no point for the facility.
|
|
50
63
|
* The layer counts such a record and leaves it out.
|
|
@@ -64,18 +77,18 @@ export interface PostOfficeRecord {
|
|
|
64
77
|
/**
|
|
65
78
|
* What one read of a source's fetched input yields.
|
|
66
79
|
*/
|
|
67
|
-
export interface
|
|
80
|
+
export interface StructureSourceRead {
|
|
68
81
|
/**
|
|
69
82
|
* The vintage of the input read, such as the date its fetch recorded.
|
|
70
83
|
*/
|
|
71
84
|
vintage: string
|
|
72
|
-
records: AsyncIterable<
|
|
85
|
+
records: AsyncIterable<StructureRecord>
|
|
73
86
|
}
|
|
74
87
|
|
|
75
88
|
/**
|
|
76
|
-
* One country's official
|
|
89
|
+
* One country's official list of structures.
|
|
77
90
|
*/
|
|
78
|
-
export interface
|
|
91
|
+
export interface StructureSource {
|
|
79
92
|
/**
|
|
80
93
|
* The stable source id, stored on every row the source contributes (`<id>:<record id>`).
|
|
81
94
|
*/
|
|
@@ -97,7 +110,7 @@ export interface PostOfficeSource {
|
|
|
97
110
|
* The `sourceID` of the source's row in `data/address-source-register.json`.
|
|
98
111
|
*/
|
|
99
112
|
registerSource: string
|
|
100
|
-
provenance:
|
|
113
|
+
provenance: StructureProvenance
|
|
101
114
|
/**
|
|
102
115
|
* The command that fetches the input `read` takes.
|
|
103
116
|
*/
|
|
@@ -108,5 +121,25 @@ export interface PostOfficeSource {
|
|
|
108
121
|
*
|
|
109
122
|
* @throws When the input or the record of its fetch is missing.
|
|
110
123
|
*/
|
|
111
|
-
read(sourcesRoot: PathBuilder): Promise<
|
|
124
|
+
read(sourcesRoot: PathBuilder): Promise<StructureSourceRead>
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The phrase the post-office category is looked up by in the POI taxonomy.
|
|
129
|
+
*/
|
|
130
|
+
const POST_OFFICE_PHRASE = "post office"
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The POI taxonomy's category id for a post office, resolved from its phrase.
|
|
134
|
+
*
|
|
135
|
+
* @throws When the taxonomy holds no category for the phrase.
|
|
136
|
+
*/
|
|
137
|
+
export function postOfficeCategoryID(): string {
|
|
138
|
+
const [match] = lookupPOICategory(POST_OFFICE_PHRASE)
|
|
139
|
+
|
|
140
|
+
if (!match) {
|
|
141
|
+
throw new Error(`the POI taxonomy holds no category for the phrase "${POST_OFFICE_PHRASE}"`)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return match.category.id
|
|
112
145
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The official lists of structures `mailwoman gazetteer build structures` folds into `structures.db`.
|
|
6
|
+
*
|
|
7
|
+
* One entry per source.
|
|
8
|
+
* A new country's list, such as a postal operator's list of its post offices, is written
|
|
9
|
+
* under `lib/<cc>/structures/` to the contract in `#structures/source` and added here.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { LAPOSTE_POINCONT_STRUCTURE_SOURCES } from "#fr/structures/laposte"
|
|
13
|
+
import { optNCAgencesStructures } from "#nc/structures/opt-nc"
|
|
14
|
+
import type { StructureSource } from "#structures/source"
|
|
15
|
+
import { chunghwaPostStructures } from "#tw/structures/chunghwa-post"
|
|
16
|
+
import { usgsNationalMapStructures } from "#us/structures/usgs/national-map"
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Every registered structure source, in the order the layer reads them.
|
|
20
|
+
*/
|
|
21
|
+
export const STRUCTURE_SOURCES: readonly StructureSource[] = [
|
|
22
|
+
usgsNationalMapStructures,
|
|
23
|
+
...LAPOSTE_POINCONT_STRUCTURE_SOURCES,
|
|
24
|
+
optNCAgencesStructures,
|
|
25
|
+
chunghwaPostStructures,
|
|
26
|
+
]
|
|
@@ -204,12 +204,17 @@ export function synthesizeHouseVenueRow(
|
|
|
204
204
|
|
|
205
205
|
// The layout decides the tail's order and which parts it prints: FR prints no region,
|
|
206
206
|
// VE keeps the region after the postcode, GB puts the postcode after the locality.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
207
|
+
// A country with written orders beside its postal one, such as IN, renders a mix of them.
|
|
208
|
+
const tail = layoutAdminTail(
|
|
209
|
+
base.country,
|
|
210
|
+
{
|
|
211
|
+
locality: base.locality,
|
|
212
|
+
region: base.region,
|
|
213
|
+
postcode: base.postcode,
|
|
214
|
+
country: countrySurface,
|
|
215
|
+
},
|
|
216
|
+
{ random }
|
|
217
|
+
)
|
|
213
218
|
|
|
214
219
|
if (!tail) return null
|
|
215
220
|
|
package/lib/synthesizers/tail.ts
CHANGED
|
@@ -9,11 +9,14 @@
|
|
|
9
9
|
* The layout decides which parts print: the FR layout prints no region,
|
|
10
10
|
* so a FR tail holds none and the returned components say so.
|
|
11
11
|
* The lines the layout writes are joined with the country's line join.
|
|
12
|
+
*
|
|
12
13
|
* The result is the one-line form the corpus rows take.
|
|
14
|
+
* A caller that passes its seeded draw also gets the written orders the codex
|
|
15
|
+
* records beside the postal one.
|
|
13
16
|
*/
|
|
14
17
|
|
|
15
18
|
import { formatAddressRow } from "@mailwoman/codex/address/format"
|
|
16
|
-
import { lineJoinForCountry } from "@mailwoman/codex/address/layouts"
|
|
19
|
+
import { lineJoinForCountry, WRITTEN_LAYOUTS, writtenLayoutForCountry } from "@mailwoman/codex/address/layouts"
|
|
17
20
|
import type { ComponentDict } from "@mailwoman/codex/address/render"
|
|
18
21
|
|
|
19
22
|
/**
|
|
@@ -34,11 +37,30 @@ export interface RenderedTail {
|
|
|
34
37
|
components: ComponentDict
|
|
35
38
|
}
|
|
36
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Options for {@link layoutAdminTail}.
|
|
42
|
+
*/
|
|
43
|
+
export interface AdminTailOptions {
|
|
44
|
+
/**
|
|
45
|
+
* The synthesizer's seeded draw.
|
|
46
|
+
*
|
|
47
|
+
* Given one, a country that records written orders beside its postal layout
|
|
48
|
+
* (`WRITTEN_LAYOUTS` in `@mailwoman/codex/address/layouts`) renders the mix those orders' shares state.
|
|
49
|
+
* The draw is taken only for such a country, so every other country's rows keep their stream.
|
|
50
|
+
* Without one, every row takes the postal layout.
|
|
51
|
+
*/
|
|
52
|
+
random?: () => number
|
|
53
|
+
}
|
|
54
|
+
|
|
37
55
|
/**
|
|
38
56
|
* Renders the admin parts through the layout of `country`, or returns `null`
|
|
39
57
|
* when the codex has no layout for the country or the layout prints none of the parts.
|
|
40
58
|
*/
|
|
41
|
-
export function layoutAdminTail(
|
|
59
|
+
export function layoutAdminTail(
|
|
60
|
+
country: string,
|
|
61
|
+
parts: AdminTailParts,
|
|
62
|
+
opts: AdminTailOptions = {}
|
|
63
|
+
): RenderedTail | null {
|
|
42
64
|
const components: ComponentDict = {}
|
|
43
65
|
|
|
44
66
|
for (const [tag, value] of Object.entries(parts) as Array<[keyof AdminTailParts, string | undefined]>) {
|
|
@@ -47,7 +69,9 @@ export function layoutAdminTail(country: string, parts: AdminTailParts): Rendere
|
|
|
47
69
|
}
|
|
48
70
|
}
|
|
49
71
|
|
|
50
|
-
const
|
|
72
|
+
const code = country.trim().toUpperCase()
|
|
73
|
+
const layout = opts.random && WRITTEN_LAYOUTS[code] ? writtenLayoutForCountry(code, opts.random()) : null
|
|
74
|
+
const row = formatAddressRow(components, country, layout ? { layout } : {})
|
|
51
75
|
|
|
52
76
|
if (!row || !row.raw.trim()) return null
|
|
53
77
|
|
package/lib/tools/audit.ts
CHANGED
|
@@ -161,7 +161,7 @@ const KNOWN_SOURCE_PREFIXES: ReadonlyArray<string> = [
|
|
|
161
161
|
"usgov-nppes",
|
|
162
162
|
"usgov-hrsa-fqhc",
|
|
163
163
|
"usgov-imls-pls",
|
|
164
|
-
"usgov-usgs-
|
|
164
|
+
"usgov-usgs-structures",
|
|
165
165
|
"state-ia-contractors",
|
|
166
166
|
"state-tx-notaries",
|
|
167
167
|
"state-ny-notaries",
|
|
@@ -77,6 +77,9 @@ export const SOURCE_STORAGE_CLASSES = {
|
|
|
77
77
|
"fr-annuaire-education-overseas": StorageClass.current,
|
|
78
78
|
// `etalab-cs1100502-stock-YYYYMMDD-HHMM.csv`: each extract's file name states its extraction date.
|
|
79
79
|
"fr-finess-overseas": StorageClass.snapshot,
|
|
80
|
+
// The data.laposte.fr dataset.
|
|
81
|
+
// La Poste refreshes it in place.
|
|
82
|
+
"fr-laposte-poincont": StorageClass.current,
|
|
80
83
|
"gb-os-open": StorageClass.current,
|
|
81
84
|
"gcis-tw": StorageClass.current,
|
|
82
85
|
"geonames-dump": StorageClass.current,
|
|
@@ -91,6 +94,8 @@ export const SOURCE_STORAGE_CLASSES = {
|
|
|
91
94
|
"localdata-kr": StorageClass.current,
|
|
92
95
|
"lv-varis": StorageClass.current,
|
|
93
96
|
matrikkelen: StorageClass.current,
|
|
97
|
+
// A query over OPT-NC's live agencies FeatureServer.
|
|
98
|
+
"nc-opt-agences": StorageClass.current,
|
|
94
99
|
"nl-kadaster": StorageClass.current,
|
|
95
100
|
openaddresses: StorageClass.current,
|
|
96
101
|
ourairports: StorageClass.current,
|
|
@@ -107,10 +112,15 @@ export const SOURCE_STORAGE_CLASSES = {
|
|
|
107
112
|
"state-wa-health-providers": StorageClass.current,
|
|
108
113
|
// The `tl_2024` files of one yearly TIGER release.
|
|
109
114
|
tiger: StorageClass.snapshot,
|
|
115
|
+
// Chunghwa Post's CSV at an undated link, replaced in place.
|
|
116
|
+
"tw-chunghwa-post-offices": StorageClass.current,
|
|
110
117
|
"usgov-hrsa-fqhc": StorageClass.current,
|
|
111
|
-
// A query over the live
|
|
112
|
-
// The publisher refreshes
|
|
113
|
-
"usgov-usgs-
|
|
118
|
+
// A query over the live geonames MapServer's Populated Places layer.
|
|
119
|
+
// The publisher refreshes it in place.
|
|
120
|
+
"usgov-usgs-gnis": StorageClass.current,
|
|
121
|
+
// A query over the live structures MapServer's point layers.
|
|
122
|
+
// The publisher refreshes them in place.
|
|
123
|
+
"usgov-usgs-structures": StorageClass.current,
|
|
114
124
|
// `pls_fy2023_csv.zip`, a pinned survey year.
|
|
115
125
|
"usgov-imls-pls": StorageClass.snapshot,
|
|
116
126
|
"usgov-nad": {
|
|
@@ -186,6 +196,7 @@ export const FETCH_SOURCE_DIRECTORIES = {
|
|
|
186
196
|
"es-navarra": ["es-navarra"],
|
|
187
197
|
"fr-annuaire-education-overseas": ["fr-annuaire-education-overseas"],
|
|
188
198
|
"fr-finess-overseas": ["fr-finess-overseas"],
|
|
199
|
+
"fr-laposte-poincont": ["fr-laposte-poincont"],
|
|
189
200
|
"gb-os-open": ["gb-os-open"],
|
|
190
201
|
"gcis-tw": ["gcis-tw"],
|
|
191
202
|
"geonames-dump": ["geonames-dump"],
|
|
@@ -200,6 +211,7 @@ export const FETCH_SOURCE_DIRECTORIES = {
|
|
|
200
211
|
"lv-varis": ["lv-varis"],
|
|
201
212
|
matrikkelen: ["matrikkelen"],
|
|
202
213
|
nad: ["usgov-nad"],
|
|
214
|
+
"nc-opt-agences": ["nc-opt-agences"],
|
|
203
215
|
"nl-kadaster": ["nl-kadaster"],
|
|
204
216
|
nppes: ["usgov-nppes"],
|
|
205
217
|
openaddresses: ["openaddresses"],
|
|
@@ -218,7 +230,9 @@ export const FETCH_SOURCE_DIRECTORIES = {
|
|
|
218
230
|
"state-wa-health-providers",
|
|
219
231
|
],
|
|
220
232
|
"tiger-full": ["tiger"],
|
|
221
|
-
"
|
|
233
|
+
"tw-chunghwa-post-offices": ["tw-chunghwa-post-offices"],
|
|
234
|
+
"usgs-gnis": ["usgov-usgs-gnis"],
|
|
235
|
+
"usgs-structures": ["usgov-usgs-structures"],
|
|
222
236
|
vlaanderen: ["vlaanderen"],
|
|
223
237
|
wallonie: ["wallonie"],
|
|
224
238
|
"wikidata-subvenue": ["wikidata-subvenue"],
|
package/lib/tools/fetch.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { fetchRyhti } from "#fi/tools/fetch/ryhti"
|
|
|
20
20
|
import { fetchAnnuaireEducationOverseas } from "#fr/tools/fetch/annuaire-education"
|
|
21
21
|
import { fetchBan } from "#fr/tools/fetch/ban"
|
|
22
22
|
import { fetchFinessOverseas } from "#fr/tools/fetch/finess"
|
|
23
|
+
import { fetchLaPostePoincont } from "#fr/tools/fetch/laposte-poincont"
|
|
23
24
|
import { fetchGBOSOpen } from "#gb/tools/fetch/os-open"
|
|
24
25
|
import { fetchITANAC } from "#it/tools/fetch/anac"
|
|
25
26
|
import { fetchHoujinJP } from "#jp/tools/fetch/houjin"
|
|
@@ -27,6 +28,7 @@ import { fetchJusoKR } from "#kr/tools/fetch/juso"
|
|
|
27
28
|
import { fetchLocaldataKR } from "#kr/tools/fetch/localdata"
|
|
28
29
|
import { fetchBDAdresses } from "#lu/tools/fetch/bd-adresses"
|
|
29
30
|
import { fetchVaris } from "#lv/tools/fetch/varis"
|
|
31
|
+
import { fetchOPTNCAgences } from "#nc/tools/fetch/opt-nc"
|
|
30
32
|
import { fetchNLKadaster } from "#nl/tools/fetch/kadaster"
|
|
31
33
|
import { fetchMatrikkelen } from "#no/tools/fetch/matrikkelen"
|
|
32
34
|
import { fetchEMUiAPL } from "#pl/tools/fetch/emuia"
|
|
@@ -42,6 +44,7 @@ import { fetchOurAirports } from "#tools/fetch/ourairports"
|
|
|
42
44
|
import { fetchVlaanderenAD } from "#tools/fetch/vlaanderen-ad"
|
|
43
45
|
import { fetchWikidataSubVenue } from "#tools/fetch/wikidata/subvenue"
|
|
44
46
|
import { fetchWikidataVitalPlaces } from "#tools/fetch/wikidata/vital-places"
|
|
47
|
+
import { fetchTWChunghwaPost } from "#tw/tools/fetch/chunghwa-post"
|
|
45
48
|
import { fetchGCISTW } from "#tw/tools/fetch/gcis"
|
|
46
49
|
import { fetchHRSA } from "#us/tools/fetch/hrsa"
|
|
47
50
|
import { fetchIMLSPLS } from "#us/tools/fetch/imls-pls"
|
|
@@ -50,7 +53,8 @@ import { fetchNPPES } from "#us/tools/fetch/nppes"
|
|
|
50
53
|
import { fetchStateHISchools } from "#us/tools/fetch/state/hi-schools"
|
|
51
54
|
import { fetchStateSources } from "#us/tools/fetch/state/sources"
|
|
52
55
|
import { fetchTigerFull } from "#us/tools/fetch/tiger-full"
|
|
53
|
-
import {
|
|
56
|
+
import { fetchUSGSGNIS } from "#us/tools/fetch/usgs/gnis"
|
|
57
|
+
import { fetchUSGSStructures } from "#us/tools/fetch/usgs/structures"
|
|
54
58
|
|
|
55
59
|
/**
|
|
56
60
|
* The fetcher for each source id that `mailwoman corpus fetch` accepts.
|
|
@@ -71,6 +75,7 @@ export const FETCH_SOURCES = {
|
|
|
71
75
|
"es-navarra": fetchESNavarra,
|
|
72
76
|
"fr-annuaire-education-overseas": fetchAnnuaireEducationOverseas,
|
|
73
77
|
"fr-finess-overseas": fetchFinessOverseas,
|
|
78
|
+
"fr-laposte-poincont": fetchLaPostePoincont,
|
|
74
79
|
"gb-os-open": fetchGBOSOpen,
|
|
75
80
|
"gcis-tw": fetchGCISTW,
|
|
76
81
|
gleif: fetchGLEIF,
|
|
@@ -81,6 +86,7 @@ export const FETCH_SOURCES = {
|
|
|
81
86
|
"lv-varis": fetchVaris,
|
|
82
87
|
matrikkelen: fetchMatrikkelen,
|
|
83
88
|
nad: fetchNAD,
|
|
89
|
+
"nc-opt-agences": fetchOPTNCAgences,
|
|
84
90
|
"nl-kadaster": fetchNLKadaster,
|
|
85
91
|
"ro-retea-scolara": fetchReteaScolara,
|
|
86
92
|
ryhti: fetchRyhti,
|
|
@@ -97,7 +103,9 @@ export const FETCH_SOURCES = {
|
|
|
97
103
|
"state-sources": fetchStateSources,
|
|
98
104
|
"state-hi-schools": fetchStateHISchools,
|
|
99
105
|
"tiger-full": fetchTigerFull,
|
|
100
|
-
"
|
|
106
|
+
"tw-chunghwa-post-offices": fetchTWChunghwaPost,
|
|
107
|
+
"usgs-gnis": fetchUSGSGNIS,
|
|
108
|
+
"usgs-structures": fetchUSGSStructures,
|
|
101
109
|
"wikidata-subvenue": fetchWikidataSubVenue,
|
|
102
110
|
"wikidata-vital-places": fetchWikidataVitalPlaces,
|
|
103
111
|
} as const
|
|
@@ -27,6 +27,7 @@ import { moduleGraphHash } from "#build/code-hash"
|
|
|
27
27
|
import { corpusDirectoryName } from "#directory"
|
|
28
28
|
import { PARQUET_COLUMNS, PARQUET_COMPRESSION, ROW_GROUP_SIZE } from "#parquet/schema"
|
|
29
29
|
import { type ParquetManifest, writeParquetSplits } from "#parquet/writers"
|
|
30
|
+
import { KRYPTONITE_COUNTRY } from "#recipes/deepseek/batches"
|
|
30
31
|
import { baseManifestFiles } from "#tools/overlay/manifest"
|
|
31
32
|
import { type CanonicalRow, type LabeledRow, requireSurface } from "#types"
|
|
32
33
|
import { alignRow } from "#utils"
|
|
@@ -69,11 +70,14 @@ export async function* canonicalRows(jsonl: string): AsyncIterable<CanonicalRow>
|
|
|
69
70
|
)
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
// The generator tagged its `french-saint` rows FR, though they're US addresses like every kryptonite row.
|
|
74
|
+
const tagged = source === "deepseek-kryptonite" ? KRYPTONITE_COUNTRY : null
|
|
75
|
+
|
|
72
76
|
yield {
|
|
73
77
|
raw: raw["raw"] as string,
|
|
74
78
|
components,
|
|
75
|
-
country: (raw["country"] as string) ?? "US",
|
|
76
|
-
locale: (raw["locale"] as string) ?? undefined,
|
|
79
|
+
country: tagged?.country ?? (raw["country"] as string) ?? "US",
|
|
80
|
+
locale: tagged?.locale ?? (raw["locale"] as string) ?? undefined,
|
|
77
81
|
source,
|
|
78
82
|
source_id: raw["source_id"] as string,
|
|
79
83
|
license: (raw["license"] as string) ?? "Synthetic (DeepSeek-v4-flash, AGPL-compatible)",
|
|
@@ -19,6 +19,7 @@ import { canonicalJSON } from "@mailwoman/core/json"
|
|
|
19
19
|
import { moduleGraphHash } from "#build/code-hash"
|
|
20
20
|
import type { ShapeSupplyEntry, SplitRetention } from "#utils/retention"
|
|
21
21
|
import type { CountryHoldout, SplitName } from "#utils/split"
|
|
22
|
+
import type { EvaluationGroupPolicyIdentity } from "#utils/validation-groups"
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* The module whose `splitForRow` the policy hash covers, repository-relative.
|
|
@@ -36,7 +37,14 @@ export const SPLIT_ATTRIBUTE = "split"
|
|
|
36
37
|
export interface SplitAttributeFile {
|
|
37
38
|
attribute: typeof SPLIT_ATTRIBUTE
|
|
38
39
|
policyHash: string
|
|
39
|
-
policy: {
|
|
40
|
+
policy: {
|
|
41
|
+
holdouts: Record<string, CountryHoldout>
|
|
42
|
+
codeHash: string
|
|
43
|
+
/**
|
|
44
|
+
* The frozen and validation group lists the split applied, when it ran under that policy.
|
|
45
|
+
*/
|
|
46
|
+
evaluationGroups?: EvaluationGroupPolicyIdentity
|
|
47
|
+
}
|
|
40
48
|
/**
|
|
41
49
|
* The parquet file the attribute describes, by name and sha256.
|
|
42
50
|
*/
|
|
@@ -59,10 +67,12 @@ export interface SplitAttributeFile {
|
|
|
59
67
|
*
|
|
60
68
|
* A registered retention table joins the hashed payload, so a table change writes
|
|
61
69
|
* a new attribute file rather than relabeling the old one.
|
|
70
|
+
* The evaluation-group policy's two lists and its validation quota join it the same way.
|
|
62
71
|
*/
|
|
63
72
|
export async function splitPolicyHash(
|
|
64
73
|
holdouts: Record<string, CountryHoldout>,
|
|
65
|
-
retention?: SplitRetention
|
|
74
|
+
retention?: SplitRetention,
|
|
75
|
+
evaluationGroups?: EvaluationGroupPolicyIdentity
|
|
66
76
|
): Promise<{ policyHash: string; codeHash: string }> {
|
|
67
77
|
const codeHash = await moduleGraphHash([SPLIT_POLICY_MODULE])
|
|
68
78
|
|
|
@@ -72,6 +82,8 @@ export async function splitPolicyHash(
|
|
|
72
82
|
...(retention
|
|
73
83
|
? { retention: { floor: retention.floor, protectedShapes: [...retention.protectedShapes].toSorted() } }
|
|
74
84
|
: {}),
|
|
85
|
+
// The evaluation-group policy flag: both lists' sha256, the frozen sets and the validation quota.
|
|
86
|
+
...(evaluationGroups ? { evaluationGroups } : {}),
|
|
75
87
|
}
|
|
76
88
|
|
|
77
89
|
return { policyHash: sha256Hex(canonicalJSON(payload)), codeHash }
|