@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,292 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @file The validation groups of the evaluation-group policy, chosen by a per-country quota.
|
|
6
|
+
*
|
|
7
|
+
* Under the evaluation-group policy (HOLDOUT_AND_EVALUATION section 4.6) `val` holds only what the trainer's
|
|
8
|
+
* validation loss and the launch preflight's validation audits read. For each country the quota walks the
|
|
9
|
+
* groups of the holdout policy's held-out places in the order of their group hash, lowest first, and takes
|
|
10
|
+
* groups until the country reaches its target rows and target street rows, or the cap. A country whose whole
|
|
11
|
+
* pool is under its target keeps the pool.
|
|
12
|
+
*
|
|
13
|
+
* A target is `min(cap, max(margin × floor, minimum))`, the floor being the training config's
|
|
14
|
+
* `required_validation_coverage` entry for the country. The street target is `min(cap, margin × street floor)`.
|
|
15
|
+
* The quota parameters and the list's sha256 join the split policy hash.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { readLocalJSONFile } from "@mailwoman/core/fs/readers"
|
|
19
|
+
import { sha256File } from "@mailwoman/core/hash"
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
type EvaluationGroups,
|
|
23
|
+
type EvaluationGroupsIdentity,
|
|
24
|
+
evaluationGroupsIdentity,
|
|
25
|
+
readEvaluationGroups,
|
|
26
|
+
} from "#utils/evaluation-groups"
|
|
27
|
+
import { hashUint32 } from "#utils/split"
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The attribute name a validation-group file declares.
|
|
31
|
+
*/
|
|
32
|
+
export const VALIDATION_GROUPS_ATTRIBUTE = "validation-groups"
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The quota's parameters.
|
|
36
|
+
*/
|
|
37
|
+
export interface ValidationQuota {
|
|
38
|
+
/**
|
|
39
|
+
* The multiple of a country's validation floor its target asks for.
|
|
40
|
+
*/
|
|
41
|
+
margin: number
|
|
42
|
+
/**
|
|
43
|
+
* The rows every country with a held-out pool aims at, floor or none.
|
|
44
|
+
*/
|
|
45
|
+
minimumRows: number
|
|
46
|
+
/**
|
|
47
|
+
* The most rows one country's validation groups may hold.
|
|
48
|
+
*/
|
|
49
|
+
capRows: number
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The quota the v0.8.19 corpus is split under.
|
|
54
|
+
*/
|
|
55
|
+
export const DEFAULT_VALIDATION_QUOTA: ValidationQuota = { margin: 2, minimumRows: 200, capRows: 20_000 }
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A country's validation floor, as the training config states it.
|
|
59
|
+
*/
|
|
60
|
+
export interface ValidationFloor {
|
|
61
|
+
minRows: number
|
|
62
|
+
minStreetRows: number
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* A country's quota target.
|
|
67
|
+
*/
|
|
68
|
+
export interface ValidationTarget {
|
|
69
|
+
rows: number
|
|
70
|
+
streetRows: number
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The target of one country under a quota: `min(cap, max(margin × floor, minimum))` rows
|
|
75
|
+
* and `min(cap, margin × street floor)` street rows.
|
|
76
|
+
* A country without a floor aims at the minimum.
|
|
77
|
+
*/
|
|
78
|
+
export function validationTarget(floor: ValidationFloor | undefined, quota: ValidationQuota): ValidationTarget {
|
|
79
|
+
return {
|
|
80
|
+
rows: Math.min(quota.capRows, Math.max(Math.ceil(quota.margin * (floor?.minRows ?? 0)), quota.minimumRows)),
|
|
81
|
+
streetRows: Math.min(quota.capRows, Math.ceil(quota.margin * (floor?.minStreetRows ?? 0))),
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* One group of a country's held-out pool.
|
|
87
|
+
*/
|
|
88
|
+
export interface ValidationCandidate {
|
|
89
|
+
country: string
|
|
90
|
+
group: string
|
|
91
|
+
rows: number
|
|
92
|
+
streetRows: number
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* What the quota took from one country.
|
|
97
|
+
*/
|
|
98
|
+
export interface ValidationCountrySelection {
|
|
99
|
+
target: ValidationTarget
|
|
100
|
+
/**
|
|
101
|
+
* The country's held-out pool, as far as the caller read it.
|
|
102
|
+
*/
|
|
103
|
+
poolRows: number
|
|
104
|
+
poolGroups: number
|
|
105
|
+
rows: number
|
|
106
|
+
streetRows: number
|
|
107
|
+
groups: number
|
|
108
|
+
/**
|
|
109
|
+
* The pool ran out before the target was met, so the country keeps all of it.
|
|
110
|
+
*/
|
|
111
|
+
exhausted: boolean
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Takes each country's groups lowest `hashUint32` first, ties broken by the group string,
|
|
116
|
+
* until the country holds its target rows and street rows or reaches the cap.
|
|
117
|
+
*
|
|
118
|
+
* A caller may pass only the head of a country's pool in hash order, as long as the head reaches the cap.
|
|
119
|
+
* `poolRows` and `poolGroups` then describe that head, and the caller records the whole pool's figures.
|
|
120
|
+
*/
|
|
121
|
+
export function selectValidationGroups(
|
|
122
|
+
candidates: Iterable<ValidationCandidate>,
|
|
123
|
+
targetOf: (country: string) => ValidationTarget,
|
|
124
|
+
quota: ValidationQuota
|
|
125
|
+
): { groups: string[]; countries: Record<string, ValidationCountrySelection> } {
|
|
126
|
+
const byCountry = Map.groupBy(candidates, (candidate) => candidate.country)
|
|
127
|
+
const groups: string[] = []
|
|
128
|
+
const countries: Record<string, ValidationCountrySelection> = {}
|
|
129
|
+
|
|
130
|
+
for (const country of [...byCountry.keys()].toSorted()) {
|
|
131
|
+
const pool = byCountry
|
|
132
|
+
.get(country)!
|
|
133
|
+
.map((candidate) => ({ ...candidate, hash: hashUint32(candidate.group) }))
|
|
134
|
+
.toSorted((a, b) => a.hash - b.hash || (a.group < b.group ? -1 : a.group > b.group ? 1 : 0))
|
|
135
|
+
|
|
136
|
+
const target = targetOf(country)
|
|
137
|
+
|
|
138
|
+
const selection: ValidationCountrySelection = {
|
|
139
|
+
target,
|
|
140
|
+
poolRows: pool.reduce((sum, candidate) => sum + candidate.rows, 0),
|
|
141
|
+
poolGroups: pool.length,
|
|
142
|
+
rows: 0,
|
|
143
|
+
streetRows: 0,
|
|
144
|
+
groups: 0,
|
|
145
|
+
exhausted: false,
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
for (const candidate of pool) {
|
|
149
|
+
const met = selection.rows >= target.rows && selection.streetRows >= target.streetRows
|
|
150
|
+
|
|
151
|
+
if (met || selection.rows >= quota.capRows) break
|
|
152
|
+
|
|
153
|
+
groups.push(candidate.group)
|
|
154
|
+
selection.rows += candidate.rows
|
|
155
|
+
selection.streetRows += candidate.streetRows
|
|
156
|
+
|
|
157
|
+
selection.groups++
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
selection.exhausted =
|
|
161
|
+
selection.groups === pool.length && (selection.rows < target.rows || selection.streetRows < target.streetRows)
|
|
162
|
+
|
|
163
|
+
countries[country] = selection
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return { groups: groups.toSorted(), countries }
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The file a quota pass writes beside the corpus it measured.
|
|
171
|
+
*/
|
|
172
|
+
export interface ValidationGroupsFile {
|
|
173
|
+
attribute: typeof VALIDATION_GROUPS_ATTRIBUTE
|
|
174
|
+
/**
|
|
175
|
+
* The corpus manifest whose held-out pool was read.
|
|
176
|
+
*/
|
|
177
|
+
drawnFrom: { manifest: string; sha256: string; corpusVersion: string | null }
|
|
178
|
+
/**
|
|
179
|
+
* The training config whose validation floors set the targets.
|
|
180
|
+
*/
|
|
181
|
+
config: { path: string; sha256: string }
|
|
182
|
+
/**
|
|
183
|
+
* The frozen group list the pool excluded.
|
|
184
|
+
*/
|
|
185
|
+
evaluationGroups: EvaluationGroupsIdentity
|
|
186
|
+
quota: ValidationQuota
|
|
187
|
+
countries: Record<string, ValidationCountrySelection>
|
|
188
|
+
groups: string[]
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The validation lookup a split applies.
|
|
193
|
+
*/
|
|
194
|
+
export interface ValidationGroups {
|
|
195
|
+
path: string
|
|
196
|
+
sha256: string
|
|
197
|
+
quota: ValidationQuota
|
|
198
|
+
/**
|
|
199
|
+
* The frozen list's sha256 the pool excluded.
|
|
200
|
+
*/
|
|
201
|
+
evaluationGroupsSHA256: string
|
|
202
|
+
groups: ReadonlySet<string>
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Reads a validation-group file.
|
|
207
|
+
*
|
|
208
|
+
* @throws When the file declares another attribute or records no quota.
|
|
209
|
+
*/
|
|
210
|
+
export async function readValidationGroups(path: string): Promise<ValidationGroups> {
|
|
211
|
+
const file = await readLocalJSONFile<ValidationGroupsFile>(path)
|
|
212
|
+
|
|
213
|
+
if (file.attribute !== VALIDATION_GROUPS_ATTRIBUTE || !Array.isArray(file.groups)) {
|
|
214
|
+
throw new Error(`${path} is not a validation-group file`)
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (!file.quota || typeof file.evaluationGroups?.sha256 !== "string") {
|
|
218
|
+
throw new Error(`${path} records no quota or no frozen list`)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return {
|
|
222
|
+
path,
|
|
223
|
+
sha256: await sha256File(path),
|
|
224
|
+
quota: file.quota,
|
|
225
|
+
evaluationGroupsSHA256: file.evaluationGroups.sha256,
|
|
226
|
+
groups: new Set(file.groups),
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The two lists the evaluation-group policy applies.
|
|
232
|
+
*
|
|
233
|
+
* Frozen groups go to `test` and validation groups go to `val`.
|
|
234
|
+
*/
|
|
235
|
+
export interface EvaluationGroupPolicy {
|
|
236
|
+
frozen: EvaluationGroups
|
|
237
|
+
validation: ValidationGroups
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Pairs the two lists, refusing a validation list drawn against another frozen list
|
|
242
|
+
* or one that holds a frozen group, since such a group's rows could take only one split.
|
|
243
|
+
*/
|
|
244
|
+
export function evaluationGroupPolicy(frozen: EvaluationGroups, validation: ValidationGroups): EvaluationGroupPolicy {
|
|
245
|
+
if (validation.evaluationGroupsSHA256 !== frozen.sha256) {
|
|
246
|
+
throw new Error(
|
|
247
|
+
`${validation.path} was drawn against frozen list ${validation.evaluationGroupsSHA256}; ` +
|
|
248
|
+
`${frozen.path} has sha256 ${frozen.sha256}`
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
for (const group of validation.groups) {
|
|
253
|
+
if (frozen.groups.has(group)) throw new Error(`${validation.path} lists frozen group ${group}`)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return { frozen, validation }
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Reads both lists and pairs them with {@linkcode evaluationGroupPolicy}.
|
|
261
|
+
*/
|
|
262
|
+
export async function readEvaluationGroupPolicy(paths: {
|
|
263
|
+
evaluationGroups: string
|
|
264
|
+
validationGroups: string
|
|
265
|
+
}): Promise<EvaluationGroupPolicy> {
|
|
266
|
+
return evaluationGroupPolicy(
|
|
267
|
+
await readEvaluationGroups(paths.evaluationGroups),
|
|
268
|
+
await readValidationGroups(paths.validationGroups)
|
|
269
|
+
)
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* What a split policy hash and a corpus manifest record about the policy applied.
|
|
274
|
+
*/
|
|
275
|
+
export interface EvaluationGroupPolicyIdentity {
|
|
276
|
+
evaluationGroups: EvaluationGroupsIdentity
|
|
277
|
+
validationGroups: { sha256: string; quota: ValidationQuota; groups: number }
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The identity of a policy: both lists' sha256, the frozen sets, the quota and the group counts.
|
|
282
|
+
*/
|
|
283
|
+
export function evaluationGroupPolicyIdentity(policy: EvaluationGroupPolicy): EvaluationGroupPolicyIdentity {
|
|
284
|
+
return {
|
|
285
|
+
evaluationGroups: evaluationGroupsIdentity(policy.frozen),
|
|
286
|
+
validationGroups: {
|
|
287
|
+
sha256: policy.validation.sha256,
|
|
288
|
+
quota: policy.validation.quota,
|
|
289
|
+
groups: policy.validation.groups.size,
|
|
290
|
+
},
|
|
291
|
+
}
|
|
292
|
+
}
|
package/lib/utils/wof-json.ts
CHANGED
|
@@ -17,11 +17,7 @@
|
|
|
17
17
|
import { readLocalJSONFile, readLocalTextFile } from "@mailwoman/core/fs/readers"
|
|
18
18
|
import { tryParsingJSON } from "@mailwoman/core/json"
|
|
19
19
|
import { resolveModulePath } from "@mailwoman/core/module/resolvers"
|
|
20
|
-
import { compareByScalarValue } from "@mailwoman/core/strings/compare"
|
|
21
20
|
import { agreedHierarchyAncestors } from "@mailwoman/gazetteer/whosonfirst/hierarchy"
|
|
22
|
-
import type { PathBuilderLike } from "path-ts"
|
|
23
|
-
import { AsyncSequence } from "spliterator"
|
|
24
|
-
import { Globerator } from "spliterator/node/fs"
|
|
25
21
|
|
|
26
22
|
/**
|
|
27
23
|
* A WOF GeoJSON feature, as published by the per-record bundles.
|
|
@@ -74,6 +70,52 @@ export interface WOFRecord {
|
|
|
74
70
|
* Empty when the record lists no hierarchy, in which case the parent chain answers.
|
|
75
71
|
*/
|
|
76
72
|
ancestors: readonly number[]
|
|
73
|
+
/**
|
|
74
|
+
* The countries that lead the record's own ISO 3166 and HASC codes ({@linkcode SUBDIVISION_OF_SOURCES}),
|
|
75
|
+
* where one differs from `country`: `GP` for France's region Guadeloupe (`iso:id` `GP`).
|
|
76
|
+
*/
|
|
77
|
+
codeCountries: readonly string[]
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The WOF concordances whose leading two letters are the code of the country a region is a
|
|
82
|
+
* subdivision of: the ISO code and the HASC code (`GF` for French Guiana, `BQ.BO` for Bonaire).
|
|
83
|
+
*/
|
|
84
|
+
export const SUBDIVISION_OF_SOURCES = ["iso:id", "iso:code", "hasc:id"] as const
|
|
85
|
+
|
|
86
|
+
const CODE_COUNTRY = /^([A-Z]{2})(?:[-.]|$)/u
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The country code that leads an ISO 3166 or HASC code, `GF` for `GF` and `BQ` for `BQ.BO`
|
|
90
|
+
* or `BQ-BO`, or `null` for a code that leads with none.
|
|
91
|
+
*/
|
|
92
|
+
export function codeCountry(code: string): string | null {
|
|
93
|
+
return CODE_COUNTRY.exec(code.toUpperCase())?.[1] ?? null
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const NO_CODE_COUNTRIES: readonly string[] = Object.freeze([])
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* The {@linkcode WOFRecord.codeCountries} of a record's properties.
|
|
100
|
+
*/
|
|
101
|
+
function codeCountriesOf(props: Record<string, unknown>, country: string): readonly string[] {
|
|
102
|
+
const concordances = props["wof:concordances"]
|
|
103
|
+
|
|
104
|
+
if (!concordances || typeof concordances !== "object") return NO_CODE_COUNTRIES
|
|
105
|
+
const found = new Set<string>()
|
|
106
|
+
|
|
107
|
+
for (const source of SUBDIVISION_OF_SOURCES) {
|
|
108
|
+
const code = (concordances as Record<string, unknown>)[source]
|
|
109
|
+
const named = typeof code === "string" ? codeCountry(code) : null
|
|
110
|
+
|
|
111
|
+
if (named && named !== country) {
|
|
112
|
+
found.add(named)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// An admin run holds millions of records.
|
|
117
|
+
// Most hold no other country's code, so those records share one empty list.
|
|
118
|
+
return found.size ? [...found] : NO_CODE_COUNTRIES
|
|
77
119
|
}
|
|
78
120
|
|
|
79
121
|
/**
|
|
@@ -259,6 +301,7 @@ export function recordFromFeature(feature: WOFFeature, refutedParents: ReadonlyS
|
|
|
259
301
|
country,
|
|
260
302
|
nameVariants: extractNameVariants(props),
|
|
261
303
|
ancestors: placed ? agreedHierarchyAncestors(id, props["wof:hierarchy"]) : [],
|
|
304
|
+
codeCountries: codeCountriesOf(props, country),
|
|
262
305
|
}
|
|
263
306
|
}
|
|
264
307
|
|
|
@@ -293,61 +336,10 @@ export function isAtOrigin(props: Record<string, unknown>): boolean {
|
|
|
293
336
|
return props["geom:latitude"] === 0 && props["geom:longitude"] === 0
|
|
294
337
|
}
|
|
295
338
|
|
|
296
|
-
/**
|
|
297
|
-
* Stream every canonical GeoJSON file under `repoDir` and yield parsed `WOFRecord`s;
|
|
298
|
-
* `repoDir` may be a single cloned `whosonfirst-data-*` repo or a parent holding several
|
|
299
|
-
* (the corpus pipeline clones all four into a shared `wof/repos/` root).
|
|
300
|
-
*
|
|
301
|
-
* `-alt-` siblings are skipped as alternate-geometry exports.
|
|
302
|
-
* They do not represent new records.
|
|
303
|
-
*
|
|
304
|
-
* Per-file errors (unreadable files, malformed JSON, or missing properties) are swallowed
|
|
305
|
-
* so one bad file doesn't poison a multi-gigabyte walk.
|
|
306
|
-
*
|
|
307
|
-
* The libuv threadpool has four workers by default; `UV_THREADPOOL_SIZE` can change that count.
|
|
308
|
-
* `parallelMap` reads files concurrently up to the threadpool capacity.
|
|
309
|
-
*
|
|
310
|
-
* Records are yielded in the code-point order of their absolute paths.
|
|
311
|
-
* Code-point order is the byte order of the paths' UTF-8 spellings.
|
|
312
|
-
*
|
|
313
|
-
* The adapters deduplicate surface strings first-come.
|
|
314
|
-
* The yield order therefore decides which record claims a shared name.
|
|
315
|
-
*
|
|
316
|
-
* The directory listing's own order comes from `opendir` and varies with the filesystem.
|
|
317
|
-
* ext4's hashed directory index lists `2.geojson` before `1.geojson`.
|
|
318
|
-
* The listing is sorted before the ordered parallel read.
|
|
319
|
-
*
|
|
320
|
-
* Two hosts that hold the same checkout then yield the same sequence.
|
|
321
|
-
*/
|
|
322
|
-
export async function* walkFeatures(
|
|
323
|
-
repoDir: PathBuilderLike,
|
|
324
|
-
opts: { signal?: AbortSignal } = {}
|
|
325
|
-
): AsyncIterable<WOFRecord> {
|
|
326
|
-
const listed: string[] = await Globerator.from("**/*.geojson", {
|
|
327
|
-
cwd: repoDir,
|
|
328
|
-
absolute: true,
|
|
329
|
-
exclude: ["**/*-alt-*.geojson"],
|
|
330
|
-
// Bundle repositories can expose their data through a link.
|
|
331
|
-
followSymlinks: true,
|
|
332
|
-
signal: opts.signal,
|
|
333
|
-
}).toArray()
|
|
334
|
-
|
|
335
|
-
const records = AsyncSequence.from<string>(listed.toSorted(compareByScalarValue)).parallelMap(readFeatureRecord, {
|
|
336
|
-
ordered: true,
|
|
337
|
-
signal: opts.signal,
|
|
338
|
-
})
|
|
339
|
-
|
|
340
|
-
for await (const rec of records) {
|
|
341
|
-
if (rec) {
|
|
342
|
-
yield rec
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
|
|
347
339
|
/**
|
|
348
340
|
* The record one GeoJSON file holds, or `null` when the file is unreadable, malformed or skipped.
|
|
349
341
|
*
|
|
350
|
-
*
|
|
342
|
+
* The single-record explorer reads its record and ancestors through this.
|
|
351
343
|
*/
|
|
352
344
|
export async function readFeatureRecord(filePath: string): Promise<WOFRecord | null> {
|
|
353
345
|
let text: string
|
|
@@ -380,25 +372,6 @@ export const ANCESTOR_NAME_TAGS = ["locality", "subregion", "region", "country"]
|
|
|
380
372
|
*/
|
|
381
373
|
export type AncestorNames = Partial<Record<(typeof ANCESTOR_NAME_TAGS)[number], string>>
|
|
382
374
|
|
|
383
|
-
/**
|
|
384
|
-
* The ancestor names that each record needs, keyed by `wof:id`.
|
|
385
|
-
*
|
|
386
|
-
* The predecessor index held one array of record references per record, so a run over the 13,274,691
|
|
387
|
-
* admin records of `v0.7.0-de-holdout` allocated 13.3 million arrays alongside the record index.
|
|
388
|
-
* This holds at most four strings per record instead.
|
|
389
|
-
*
|
|
390
|
-
* Each string is the same object the ancestor already holds, so the index costs
|
|
391
|
-
* one small object per record without copying a name.
|
|
392
|
-
*
|
|
393
|
-
* The adapter's second pass reads only this.
|
|
394
|
-
* `wof-postalcode` keeps admin records in its record index solely so postcode ancestry resolves.
|
|
395
|
-
* It can release them once this index is built.
|
|
396
|
-
*
|
|
397
|
-
* Nearest wins: the walk goes upward from the record's parent and the first ancestor
|
|
398
|
-
* carrying a tag sets it, matching the `ancestry.find` the builders used.
|
|
399
|
-
*/
|
|
400
|
-
export type AncestorNameIndex = Map<number, AncestorNames>
|
|
401
|
-
|
|
402
375
|
/**
|
|
403
376
|
* The nearest ancestor record per tag in {@linkcode ANCESTOR_NAME_TAGS}.
|
|
404
377
|
*
|
|
@@ -408,94 +381,83 @@ export type AncestorNameIndex = Map<number, AncestorNames>
|
|
|
408
381
|
export type AncestorRecords = Partial<Record<(typeof ANCESTOR_NAME_TAGS)[number], WOFRecord>>
|
|
409
382
|
|
|
410
383
|
/**
|
|
411
|
-
*
|
|
384
|
+
* Each ancestor record's `wof:name`, per tag.
|
|
412
385
|
*
|
|
413
|
-
* `wof-postalcode`
|
|
386
|
+
* `wof-postalcode` renders a postcode's hierarchy from these names and reads no other ancestor field.
|
|
414
387
|
*/
|
|
415
|
-
export function
|
|
416
|
-
|
|
417
|
-
tagOf: (placetype: string) => string | null | undefined
|
|
418
|
-
): AncestorNameIndex {
|
|
419
|
-
const index: AncestorNameIndex = new Map()
|
|
420
|
-
|
|
421
|
-
for (const [id, records] of buildAncestorRecordIndex(byID, tagOf)) {
|
|
422
|
-
const names: AncestorNames = {}
|
|
388
|
+
export function ancestorNamesOf(records: AncestorRecords): AncestorNames {
|
|
389
|
+
const names: AncestorNames = {}
|
|
423
390
|
|
|
424
|
-
|
|
425
|
-
|
|
391
|
+
for (const tag of ANCESTOR_NAME_TAGS) {
|
|
392
|
+
const name = records[tag]?.name
|
|
426
393
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
394
|
+
if (name) {
|
|
395
|
+
names[tag] = name
|
|
430
396
|
}
|
|
431
|
-
|
|
432
|
-
index.set(id, names)
|
|
433
397
|
}
|
|
434
398
|
|
|
435
|
-
return
|
|
399
|
+
return names
|
|
436
400
|
}
|
|
437
401
|
|
|
438
402
|
/**
|
|
439
|
-
*
|
|
403
|
+
* The nearest ancestor record per tag in {@linkcode ANCESTOR_NAME_TAGS} for one record.
|
|
440
404
|
*
|
|
405
|
+
* `lookup` returns a record the reader kept, or `undefined`.
|
|
441
406
|
* `tagOf` maps a WOF placetype to a component tag, or returns a value outside
|
|
442
407
|
* {@linkcode ANCESTOR_NAME_TAGS} for a placetype no builder looks up.
|
|
408
|
+
*
|
|
443
409
|
* It is a parameter because `placetypeToTag` lives with the adapters and this module doesn't import them.
|
|
444
410
|
*
|
|
445
|
-
* The
|
|
446
|
-
*
|
|
447
|
-
*
|
|
411
|
+
* The `wof:hierarchy` levels are read first, then the parent chain.
|
|
412
|
+
* The chain stops at the first id `lookup` cannot return, and at any re-visit.
|
|
413
|
+
* Only a corrupt fixture holds a cycle.
|
|
448
414
|
*
|
|
449
415
|
* A record whose ancestors are absent resolves the tags it can reach rather than failing.
|
|
416
|
+
*
|
|
417
|
+
* An ancestor in another country claims no tag, unless its own ISO or HASC code leads with
|
|
418
|
+
* the record's country, as France's region Guadeloupe (`GP`) does for a record in `GP`.
|
|
419
|
+
* A row takes its country from the record, so any other such ancestor would write another country's
|
|
420
|
+
* region under it: WOF files Monaco's quarters under Alpes-Maritimes and Macau's under Guangdong.
|
|
450
421
|
*/
|
|
451
|
-
export function
|
|
452
|
-
|
|
422
|
+
export function ancestorRecordsOf(
|
|
423
|
+
rec: WOFRecord,
|
|
424
|
+
lookup: (id: number) => WOFRecord | undefined,
|
|
453
425
|
tagOf: (placetype: string) => string | null | undefined
|
|
454
|
-
):
|
|
455
|
-
const
|
|
426
|
+
): AncestorRecords {
|
|
427
|
+
const names: AncestorRecords = {}
|
|
456
428
|
|
|
457
|
-
|
|
458
|
-
|
|
429
|
+
const claim = (ancestor: WOFRecord): void => {
|
|
430
|
+
if (ancestor.country !== rec.country && !ancestor.codeCountries.includes(rec.country)) return
|
|
459
431
|
|
|
460
|
-
|
|
461
|
-
for (const ancestorID of rec.ancestors) {
|
|
462
|
-
const ancestor = byID.get(ancestorID)
|
|
432
|
+
const tag = tagOf(ancestor.placetype)
|
|
463
433
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
for (const wanted of ANCESTOR_NAME_TAGS) {
|
|
469
|
-
if (tag === wanted && !names[wanted]) {
|
|
470
|
-
names[wanted] = ancestor
|
|
471
|
-
}
|
|
434
|
+
for (const wanted of ANCESTOR_NAME_TAGS) {
|
|
435
|
+
if (tag === wanted && !names[wanted]) {
|
|
436
|
+
names[wanted] = ancestor
|
|
472
437
|
}
|
|
473
438
|
}
|
|
439
|
+
}
|
|
474
440
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
while (cur !== null && cur > 0) {
|
|
479
|
-
const parent = byID.get(cur)
|
|
480
|
-
|
|
481
|
-
if (!parent) break
|
|
482
|
-
|
|
483
|
-
if (guard.has(parent.id)) break
|
|
441
|
+
// `wof:hierarchy` names every ancestor level directly, including for a record whose parent is -4.
|
|
442
|
+
for (const ancestorID of rec.ancestors) {
|
|
443
|
+
const ancestor = lookup(ancestorID)
|
|
484
444
|
|
|
485
|
-
|
|
445
|
+
if (ancestor) {
|
|
446
|
+
claim(ancestor)
|
|
447
|
+
}
|
|
448
|
+
}
|
|
486
449
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
names[wanted] = parent
|
|
490
|
-
}
|
|
491
|
-
}
|
|
450
|
+
const guard = new Set<number>([rec.id])
|
|
451
|
+
let cur: number | null = rec.parent_id
|
|
492
452
|
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
}
|
|
453
|
+
while (cur !== null && cur > 0) {
|
|
454
|
+
const parent = lookup(cur)
|
|
496
455
|
|
|
497
|
-
|
|
456
|
+
if (!parent || guard.has(parent.id)) break
|
|
457
|
+
claim(parent)
|
|
458
|
+
guard.add(parent.id)
|
|
459
|
+
cur = parent.parent_id
|
|
498
460
|
}
|
|
499
461
|
|
|
500
|
-
return
|
|
462
|
+
return names
|
|
501
463
|
}
|
|
@@ -160,8 +160,10 @@ export declare function naturalPersonForm(name: string, shortName: string, lexic
|
|
|
160
160
|
*
|
|
161
161
|
* `order` is `null` for a country with no unambiguous side, and such a line
|
|
162
162
|
* is kept only where it holds no digit.
|
|
163
|
+
* In a `country` that writes a repetition index, `20 BIS RUE LOUIS PHILIPPE` yields the house number
|
|
164
|
+
* `20 BIS` and the street `RUE LOUIS PHILIPPE`, as {@linkcode joinRepetitionIndex} reads it.
|
|
163
165
|
*/
|
|
164
|
-
export declare function splitCORDISStreetLine(line: string, order: StreetOrder | null): SplitStreetLine | {
|
|
166
|
+
export declare function splitCORDISStreetLine(line: string, order: StreetOrder | null, country?: string): SplitStreetLine | {
|
|
165
167
|
refused: CORDISRefusal;
|
|
166
168
|
} | null;
|
|
167
169
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../lib/adapters/cordis/adapter.ts"],"names":[],"mappings":"AAkIA,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAM3D,OAAO,EAA4C,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../lib/adapters/cordis/adapter.ts"],"names":[],"mappings":"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"}
|
|
@@ -132,6 +132,7 @@ import { Globerator } from "spliterator/node/fs";
|
|
|
132
132
|
import { loadLibpostalDictionary } from "#adapters/libpostal-dictionary";
|
|
133
133
|
import { stableSourceID } from "#adapters/source-id";
|
|
134
134
|
import { splitStreetLine, splitTrailingStreetLine } from "#adapters/street/line";
|
|
135
|
+
import { joinRepetitionIndex } from "#adapters/street/repetition";
|
|
135
136
|
import { createUnitSplitter } from "#adapters/street/unit";
|
|
136
137
|
import { SourceRegister } from "#registers";
|
|
137
138
|
import { streetIndexOpener } from "#street-index/reader";
|
|
@@ -387,8 +388,10 @@ const LEADING_NUMBER_COMMA = /^(\d+[\p{L}]?),\s*/u;
|
|
|
387
388
|
*
|
|
388
389
|
* `order` is `null` for a country with no unambiguous side, and such a line
|
|
389
390
|
* is kept only where it holds no digit.
|
|
391
|
+
* In a `country` that writes a repetition index, `20 BIS RUE LOUIS PHILIPPE` yields the house number
|
|
392
|
+
* `20 BIS` and the street `RUE LOUIS PHILIPPE`, as {@linkcode joinRepetitionIndex} reads it.
|
|
390
393
|
*/
|
|
391
|
-
export function splitCORDISStreetLine(line, order) {
|
|
394
|
+
export function splitCORDISStreetLine(line, order, country) {
|
|
392
395
|
const trimmed = line
|
|
393
396
|
.replaceAll(/\s+/gu, " ")
|
|
394
397
|
.replace(/[\s,.;]+$/u, "")
|
|
@@ -401,6 +404,9 @@ export function splitCORDISStreetLine(line, order) {
|
|
|
401
404
|
let split = { street: trimmed };
|
|
402
405
|
if (order === StreetOrder.NumberFirst) {
|
|
403
406
|
split = splitStreetLine(trimmed.replace(LEADING_NUMBER_COMMA, "$1 "));
|
|
407
|
+
if (split && country) {
|
|
408
|
+
split = joinRepetitionIndex(split, country);
|
|
409
|
+
}
|
|
404
410
|
}
|
|
405
411
|
else if (order === StreetOrder.NumberLast) {
|
|
406
412
|
split = splitTrailingStreetLine(trimmed);
|
|
@@ -451,7 +457,7 @@ export function readCORDISRecord(record, lexicon, units) {
|
|
|
451
457
|
// A unit at the end of the line (`BD SAINT-JACQUES BATIMENT B`) comes off first,
|
|
452
458
|
// so its identifier is never read as the house number.
|
|
453
459
|
const lineUnit = units.split(streetLine, { country, locality, postcode: fieldValue(record.postCode) });
|
|
454
|
-
const split = splitCORDISStreetLine(lineUnit?.street ?? streetLine, streetOrderForCountry(country));
|
|
460
|
+
const split = splitCORDISStreetLine(lineUnit?.street ?? streetLine, streetOrderForCountry(country), country);
|
|
455
461
|
if (split && "refused" in split)
|
|
456
462
|
return { refused: split.refused, country };
|
|
457
463
|
if (split?.house_number) {
|