@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,60 @@
|
|
|
1
|
+
import type { PathBuilderLike } from "path-ts";
|
|
2
|
+
import type { EvaluationRecordReading, EvaluationSource } from "#evaluation/source";
|
|
3
|
+
import { type AddressRole, type CanonicalRow, type CorpusAdapter } from "#types";
|
|
4
|
+
/**
|
|
5
|
+
* Why an address record the reader admitted yielded no corpus row.
|
|
6
|
+
*/
|
|
7
|
+
export declare const EvaluationAdapterRefusal: {
|
|
8
|
+
/**
|
|
9
|
+
* The country's layout doesn't print every component the record holds.
|
|
10
|
+
*/
|
|
11
|
+
readonly Unrenderable: "row:unrenderable";
|
|
12
|
+
/**
|
|
13
|
+
* Another record already produced this exact row.
|
|
14
|
+
*/
|
|
15
|
+
readonly Duplicate: "row:duplicate";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* What an adapter over an evaluation source's reader declares beyond the source itself.
|
|
19
|
+
*/
|
|
20
|
+
export interface EvaluationCorpusAdapterSpec {
|
|
21
|
+
/**
|
|
22
|
+
* The adapter id, written as a literal `*_ADAPTER_ID` constant in the adapter's module
|
|
23
|
+
* so the `wire-identifiers` check can read it.
|
|
24
|
+
* It must equal the evaluation source's id.
|
|
25
|
+
*/
|
|
26
|
+
id: string;
|
|
27
|
+
/**
|
|
28
|
+
* The evaluation source whose id, country and license the adapter stamps on every row.
|
|
29
|
+
*/
|
|
30
|
+
source: Pick<EvaluationSource, "id" | "country" | "license">;
|
|
31
|
+
/**
|
|
32
|
+
* The `SourceRegister` value naming the publication.
|
|
33
|
+
*/
|
|
34
|
+
register: string;
|
|
35
|
+
/**
|
|
36
|
+
* The adapter stamps this BCP 47 locale on every row.
|
|
37
|
+
*/
|
|
38
|
+
locale: string;
|
|
39
|
+
addressRole: AddressRole;
|
|
40
|
+
description: string;
|
|
41
|
+
/**
|
|
42
|
+
* The record reader the evaluation source also calls, over the adapter's input file.
|
|
43
|
+
*/
|
|
44
|
+
read(path: PathBuilderLike): AsyncIterable<EvaluationRecordReading>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* One reader's verdict as a corpus row, or the reason it yields none.
|
|
48
|
+
*/
|
|
49
|
+
export declare function evaluationRecordRow(spec: Pick<EvaluationCorpusAdapterSpec, "source" | "locale">, reading: EvaluationRecordReading): {
|
|
50
|
+
readonly admitted: CanonicalRow;
|
|
51
|
+
} | {
|
|
52
|
+
readonly refused: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* A corpus adapter, under the evaluation source's id, that emits each record its reader admits.
|
|
56
|
+
*
|
|
57
|
+
* @throws When `spec.id` differs from the evaluation source's id.
|
|
58
|
+
*/
|
|
59
|
+
export declare function createEvaluationCorpusAdapter(spec: EvaluationCorpusAdapterSpec): CorpusAdapter;
|
|
60
|
+
//# sourceMappingURL=corpus-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpus-adapter.d.ts","sourceRoot":"","sources":["../../lib/evaluation/corpus-adapter.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAI9C,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAA+B,MAAM,QAAQ,CAAA;AAE7G;;GAEG;AACH,eAAO,MAAM,wBAAwB;IACpC;;OAEG;aACH,YAAY,EAAE,kBAAkB;IAChC;;OAEG;aACH,SAAS,EAAE,eAAe;CACjB,CAAA;AAEV;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC3C;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,CAAA;IAC5D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,WAAW,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,eAAe,GAAG,aAAa,CAAC,uBAAuB,CAAC,CAAA;CACnE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,IAAI,CAAC,2BAA2B,EAAE,QAAQ,GAAG,QAAQ,CAAC,EAC5D,OAAO,EAAE,uBAAuB,GAC9B;IAAE,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAmBpE;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,2BAA2B,GAAG,aAAa,CAkD9F"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
/**
|
|
4
|
+
* A corpus adapter over an evaluation source's record reader.
|
|
5
|
+
*
|
|
6
|
+
* The adapter and the evaluation source read the publisher's file through one function,
|
|
7
|
+
* so a fix to the reader reaches both.
|
|
8
|
+
* A record holds only the address components the reader chose, never the publisher's
|
|
9
|
+
* name for the site or the organization, so a row cannot join an address to a
|
|
10
|
+
* person a small charity's name could identify.
|
|
11
|
+
*
|
|
12
|
+
* The row is rendered by the country's codex layout, and its id is content-addressed
|
|
13
|
+
* over the rendered components.
|
|
14
|
+
* Two records at one address are one row, and the second is counted
|
|
15
|
+
* under {@linkcode EvaluationAdapterRefusal.Duplicate}.
|
|
16
|
+
*/
|
|
17
|
+
import { formatAddressRow } from "@mailwoman/codex/address/format";
|
|
18
|
+
import { UnsupportedCountryError } from "#adapters/errors";
|
|
19
|
+
import { stableSourceID } from "#adapters/source-id";
|
|
20
|
+
import { countDropped, SurfaceOrigin } from "#types";
|
|
21
|
+
/**
|
|
22
|
+
* Why an address record the reader admitted yielded no corpus row.
|
|
23
|
+
*/
|
|
24
|
+
export const EvaluationAdapterRefusal = {
|
|
25
|
+
/**
|
|
26
|
+
* The country's layout doesn't print every component the record holds.
|
|
27
|
+
*/
|
|
28
|
+
Unrenderable: "row:unrenderable",
|
|
29
|
+
/**
|
|
30
|
+
* Another record already produced this exact row.
|
|
31
|
+
*/
|
|
32
|
+
Duplicate: "row:duplicate",
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* One reader's verdict as a corpus row, or the reason it yields none.
|
|
36
|
+
*/
|
|
37
|
+
export function evaluationRecordRow(spec, reading) {
|
|
38
|
+
if ("refused" in reading)
|
|
39
|
+
return reading;
|
|
40
|
+
const { country } = spec.source;
|
|
41
|
+
const rendered = formatAddressRow(reading.components, country, { singleLine: true });
|
|
42
|
+
if (!rendered || rendered.unplaced.length)
|
|
43
|
+
return { refused: EvaluationAdapterRefusal.Unrenderable };
|
|
44
|
+
return {
|
|
45
|
+
admitted: {
|
|
46
|
+
raw: rendered.raw,
|
|
47
|
+
components: rendered.components,
|
|
48
|
+
country,
|
|
49
|
+
locale: spec.locale,
|
|
50
|
+
source: spec.source.id,
|
|
51
|
+
source_id: stableSourceID(spec.source.id, rendered.components),
|
|
52
|
+
license: spec.source.license,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A corpus adapter, under the evaluation source's id, that emits each record its reader admits.
|
|
58
|
+
*
|
|
59
|
+
* @throws When `spec.id` differs from the evaluation source's id.
|
|
60
|
+
*/
|
|
61
|
+
export function createEvaluationCorpusAdapter(spec) {
|
|
62
|
+
const { id, country, license } = spec.source;
|
|
63
|
+
if (spec.id !== id) {
|
|
64
|
+
throw new Error(`adapter id ${spec.id} differs from its evaluation source's id ${id}`);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
id,
|
|
68
|
+
defaultLicense: license,
|
|
69
|
+
addressRole: spec.addressRole,
|
|
70
|
+
register: spec.register,
|
|
71
|
+
surface: SurfaceOrigin.Rendered,
|
|
72
|
+
description: spec.description,
|
|
73
|
+
async *rows(opts) {
|
|
74
|
+
if (opts.country && opts.country !== country) {
|
|
75
|
+
throw new UnsupportedCountryError(id, [country], opts.country);
|
|
76
|
+
}
|
|
77
|
+
const seen = new Set();
|
|
78
|
+
let emitted = 0;
|
|
79
|
+
for await (const reading of spec.read(opts.inputPath)) {
|
|
80
|
+
if (opts.signal?.aborted)
|
|
81
|
+
break;
|
|
82
|
+
if (typeof opts.limit === "number" && emitted >= opts.limit)
|
|
83
|
+
break;
|
|
84
|
+
const row = evaluationRecordRow(spec, reading);
|
|
85
|
+
if ("refused" in row) {
|
|
86
|
+
countDropped(opts, row.refused);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (seen.has(row.admitted.source_id)) {
|
|
90
|
+
countDropped(opts, EvaluationAdapterRefusal.Duplicate);
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
seen.add(row.admitted.source_id);
|
|
94
|
+
yield row.admitted;
|
|
95
|
+
emitted++;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=corpus-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpus-adapter.js","sourceRoot":"","sources":["../../lib/evaluation/corpus-adapter.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAGlE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,C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,CAAC,CAAA;oBAEtD,SAAQ;gBACT,CAAC;gBAED,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;gBAEhC,MAAM,GAAG,CAAC,QAAQ,CAAA;gBAElB,OAAO,EAAE,CAAA;YACV,CAAC;QACF,CAAC;KACD,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract an evaluation address source satisfies.
|
|
3
|
+
*
|
|
4
|
+
* An evaluation source is a publication whose rows give the release check's comparative objective
|
|
5
|
+
* rows a model didn't train on (`docs/engineering/HOLDOUT_AND_EVALUATION.mdx` section 6.4).
|
|
6
|
+
* A source stays unseen only while its register decision refuses `train`,
|
|
7
|
+
* which keeps it out of every build through `ingestEligibilityProblems`.
|
|
8
|
+
*
|
|
9
|
+
* The four sources `#evaluation/sources` lists now permit `train`, and each feeds a
|
|
10
|
+
* corpus adapter built by `#evaluation/corpus-adapter` over the same record reader,
|
|
11
|
+
* so a fix to the reader reaches both.
|
|
12
|
+
* The fresh set frozen from them on 2026-11-14 is no longer registered by any release
|
|
13
|
+
* specification (`docs/records/evals/2026-11-14-fresh-source-evaluation-set.md`).
|
|
14
|
+
*
|
|
15
|
+
* A source's identity, terms, fetch and reader live under its country's directory
|
|
16
|
+
* (`lib/<cc>/evaluation/`), and `#evaluation/sources` lists every one.
|
|
17
|
+
* The evaluation-set builder in `packages/mailwoman/tools/eval-harness/heldout/fresh/`
|
|
18
|
+
* reads only the fields below and never branches on a country.
|
|
19
|
+
*/
|
|
20
|
+
import type { ComponentTag } from "@mailwoman/codex/component";
|
|
21
|
+
import type { PathBuilder } from "path-ts";
|
|
22
|
+
import { type SourceManifest } from "#tools/fetch/download";
|
|
23
|
+
/**
|
|
24
|
+
* One address an evaluation-only source states.
|
|
25
|
+
*/
|
|
26
|
+
export interface EvaluationAddressRecord {
|
|
27
|
+
/**
|
|
28
|
+
* The publisher's own identifier for the record, unique within the source.
|
|
29
|
+
*/
|
|
30
|
+
id: string;
|
|
31
|
+
/**
|
|
32
|
+
* The region the record is stratified by: a state, a province, a region,
|
|
33
|
+
* or the publisher's coarsest geographic field.
|
|
34
|
+
*/
|
|
35
|
+
stratum: string;
|
|
36
|
+
/**
|
|
37
|
+
* The address as the components the parser labels.
|
|
38
|
+
*/
|
|
39
|
+
components: Partial<Record<ComponentTag, string>>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* One publisher record as an address record, or the reason it yields none.
|
|
43
|
+
*/
|
|
44
|
+
export type EvaluationRecordReading = EvaluationAddressRecord | {
|
|
45
|
+
readonly refused: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* What one read of a source yielded: its records and why the others yielded none.
|
|
49
|
+
*/
|
|
50
|
+
export interface EvaluationSourceRead {
|
|
51
|
+
/**
|
|
52
|
+
* The publisher's vintage for the read input, or its fetch date where the publisher states none.
|
|
53
|
+
*/
|
|
54
|
+
vintage: string;
|
|
55
|
+
records: AsyncIterable<EvaluationAddressRecord>;
|
|
56
|
+
/**
|
|
57
|
+
* Refusals counted by reason, filled while `records` is consumed.
|
|
58
|
+
*/
|
|
59
|
+
refused: Record<string, number>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* One country's evaluation-only address publication.
|
|
63
|
+
*/
|
|
64
|
+
export interface EvaluationSource {
|
|
65
|
+
/**
|
|
66
|
+
* The stable source id, stored on every row the source contributes
|
|
67
|
+
* and naming its directory under the sources root.
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
/**
|
|
71
|
+
* The ISO 3166-1 alpha-2 code stamped on every row.
|
|
72
|
+
*/
|
|
73
|
+
country: string;
|
|
74
|
+
publisher: string;
|
|
75
|
+
/**
|
|
76
|
+
* The credit the publisher's grant requires.
|
|
77
|
+
*/
|
|
78
|
+
attribution: string;
|
|
79
|
+
/**
|
|
80
|
+
* The grant as the publisher names it, such as `Creative Commons Attribution 3.0 Australia`.
|
|
81
|
+
*/
|
|
82
|
+
license: string;
|
|
83
|
+
/**
|
|
84
|
+
* The `sourceID` of the source's row in `data/address-source-register.json`.
|
|
85
|
+
*/
|
|
86
|
+
registerSource: string;
|
|
87
|
+
/**
|
|
88
|
+
* Downloads the input `read` takes into `directory` and records the fetch in its `MANIFEST.json`.
|
|
89
|
+
*/
|
|
90
|
+
fetch(directory: PathBuilder, report?: (line: string) => void): Promise<SourceManifest>;
|
|
91
|
+
/**
|
|
92
|
+
* Reads the fetched input under `directory`.
|
|
93
|
+
*
|
|
94
|
+
* @throws When the input or the record of its fetch is missing.
|
|
95
|
+
*/
|
|
96
|
+
read(directory: PathBuilder): Promise<EvaluationSourceRead>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Downloads `url` to `directory/filename` and writes the fetch record beside it.
|
|
100
|
+
*/
|
|
101
|
+
export declare function fetchEvaluationFile(directory: PathBuilder, url: string, filename: string, report?: (line: string) => void): Promise<SourceManifest>;
|
|
102
|
+
/**
|
|
103
|
+
* The fetch record `fetchEvaluationFile` wrote under `directory`.
|
|
104
|
+
*
|
|
105
|
+
* @throws When the directory holds none.
|
|
106
|
+
*/
|
|
107
|
+
export declare function readEvaluationFetch(directory: PathBuilder): Promise<SourceManifest>;
|
|
108
|
+
/**
|
|
109
|
+
* A source read over `readings`, counting each refusal under `refused` while `records` is consumed.
|
|
110
|
+
*/
|
|
111
|
+
export declare function evaluationSourceRead(vintage: string, readings: AsyncIterable<EvaluationRecordReading>): EvaluationSourceRead;
|
|
112
|
+
/**
|
|
113
|
+
* Why a street line yields no address.
|
|
114
|
+
*/
|
|
115
|
+
export declare const EvaluationStreetRefusal: {
|
|
116
|
+
/**
|
|
117
|
+
* The line holds no house number, or one the country's side cannot place.
|
|
118
|
+
*/
|
|
119
|
+
readonly NumberAbsent: "street:number-absent";
|
|
120
|
+
readonly Unread: "street:unread";
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* A street line split into its street and house number on the side `country`
|
|
124
|
+
* writes the number, or the reason it yields none.
|
|
125
|
+
*
|
|
126
|
+
* A line without a house number is refused, so every row of an evaluation set addresses a premise.
|
|
127
|
+
*/
|
|
128
|
+
export declare function evaluationStreetLine(line: string, country: string): {
|
|
129
|
+
street: string;
|
|
130
|
+
house_number: string;
|
|
131
|
+
} | {
|
|
132
|
+
refused: string;
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../lib/evaluation/source.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAI9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,EAAgC,KAAK,cAAc,EAAiB,MAAM,uBAAuB,CAAA;AAExG;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAA;CACjD;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,uBAAuB,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5F;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,aAAa,CAAC,uBAAuB,CAAC,CAAA;IAC/C;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IAC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Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
import { statPath } from "@mailwoman/core/fs/readers/stat";
|
|
4
|
+
import { makeDirectories } from "@mailwoman/core/fs/writers";
|
|
5
|
+
import { sha256File } from "@mailwoman/core/hash";
|
|
6
|
+
import { splitCORDISStreetLine, streetOrderForCountry } from "#adapters/cordis/adapter";
|
|
7
|
+
import { downloadToFile, readManifest, writeManifest } from "#tools/fetch/download";
|
|
8
|
+
/**
|
|
9
|
+
* Downloads `url` to `directory/filename` and writes the fetch record beside it.
|
|
10
|
+
*/
|
|
11
|
+
export async function fetchEvaluationFile(directory, url, filename, report) {
|
|
12
|
+
await makeDirectories(directory);
|
|
13
|
+
const dest = directory(filename);
|
|
14
|
+
report?.(` ${url}`);
|
|
15
|
+
await downloadToFile({ url, dest, retries: 2 });
|
|
16
|
+
const manifest = {
|
|
17
|
+
source_url: url,
|
|
18
|
+
downloaded_at: new Date().toISOString(),
|
|
19
|
+
filename,
|
|
20
|
+
sha256: await sha256File(dest),
|
|
21
|
+
bytes: (await statPath(dest)).size,
|
|
22
|
+
};
|
|
23
|
+
await writeManifest(directory("MANIFEST.json"), manifest);
|
|
24
|
+
report?.(` ${manifest.bytes.toLocaleString()} bytes, sha256 ${manifest.sha256}`);
|
|
25
|
+
return manifest;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The fetch record `fetchEvaluationFile` wrote under `directory`.
|
|
29
|
+
*
|
|
30
|
+
* @throws When the directory holds none.
|
|
31
|
+
*/
|
|
32
|
+
export async function readEvaluationFetch(directory) {
|
|
33
|
+
const manifest = await readManifest(directory("MANIFEST.json"));
|
|
34
|
+
if (!manifest)
|
|
35
|
+
throw new Error(`${directory("MANIFEST.json")} is missing; fetch the source first`);
|
|
36
|
+
return manifest;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A source read over `readings`, counting each refusal under `refused` while `records` is consumed.
|
|
40
|
+
*/
|
|
41
|
+
export function evaluationSourceRead(vintage, readings) {
|
|
42
|
+
const refused = {};
|
|
43
|
+
async function* records() {
|
|
44
|
+
for await (const reading of readings) {
|
|
45
|
+
if ("refused" in reading) {
|
|
46
|
+
refused[reading.refused] = (refused[reading.refused] ?? 0) + 1;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
yield reading;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return { vintage, records: records(), refused };
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Why a street line yields no address.
|
|
56
|
+
*/
|
|
57
|
+
export const EvaluationStreetRefusal = {
|
|
58
|
+
/**
|
|
59
|
+
* The line holds no house number, or one the country's side cannot place.
|
|
60
|
+
*/
|
|
61
|
+
NumberAbsent: "street:number-absent",
|
|
62
|
+
Unread: "street:unread",
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* A street line split into its street and house number on the side `country`
|
|
66
|
+
* writes the number, or the reason it yields none.
|
|
67
|
+
*
|
|
68
|
+
* A line without a house number is refused, so every row of an evaluation set addresses a premise.
|
|
69
|
+
*/
|
|
70
|
+
export function evaluationStreetLine(line, country) {
|
|
71
|
+
const split = splitCORDISStreetLine(line, streetOrderForCountry(country));
|
|
72
|
+
if (!split)
|
|
73
|
+
return { refused: EvaluationStreetRefusal.Unread };
|
|
74
|
+
if ("refused" in split)
|
|
75
|
+
return { refused: `street:${split.refused}` };
|
|
76
|
+
if (!split.house_number)
|
|
77
|
+
return { refused: EvaluationStreetRefusal.NumberAbsent };
|
|
78
|
+
return { street: split.street, house_number: split.house_number };
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../lib/evaluation/source.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAuBlE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,C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AA;IAEjF,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAA;AAClE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EvaluationSource } from "#evaluation/source";
|
|
2
|
+
/**
|
|
3
|
+
* The evaluation-only sources, one per country, that `heldout/fresh/build.ts` freezes rows from.
|
|
4
|
+
*/
|
|
5
|
+
export declare const EVALUATION_SOURCES: readonly EvaluationSource[];
|
|
6
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../lib/evaluation/sources.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAI1D;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAKzD,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
/**
|
|
4
|
+
* Every evaluation address source, in the order the evaluation-set builder reads them.
|
|
5
|
+
*
|
|
6
|
+
* Each of the four now permits `train` and feeds the corpus adapter of the same id, so the
|
|
7
|
+
* evaluation-set builder refuses to freeze a new set from them (`heldout/fresh/build.ts`).
|
|
8
|
+
*/
|
|
9
|
+
import { auACNCRegisterSource } from "#au/evaluation/acnc-register";
|
|
10
|
+
import { esSanidadCentrosAPSource } from "#es/evaluation/sanidad-centros-ap";
|
|
11
|
+
import { itMIURScuoleSource } from "#it/evaluation/miur-scuole";
|
|
12
|
+
import { nzCharitiesRegisterSource } from "#nz/evaluation/charities-register";
|
|
13
|
+
/**
|
|
14
|
+
* The evaluation-only sources, one per country, that `heldout/fresh/build.ts` freezes rows from.
|
|
15
|
+
*/
|
|
16
|
+
export const EVALUATION_SOURCES = [
|
|
17
|
+
esSanidadCentrosAPSource,
|
|
18
|
+
itMIURScuoleSource,
|
|
19
|
+
auACNCRegisterSource,
|
|
20
|
+
nzCharitiesRegisterSource,
|
|
21
|
+
];
|
|
22
|
+
//# sourceMappingURL=sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.js","sourceRoot":"","sources":["../../lib/evaluation/sources.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAA;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAE7E;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgC;IAC9D,wBAAwB;IACxB,kBAAkB;IAClB,oBAAoB;IACpB,yBAAyB;CACzB,CAAA"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { type CanonicalRow, type CorpusAdapter } from "#types";
|
|
2
|
+
/**
|
|
3
|
+
* Registry id for this adapter, and the source directory its fetcher writes.
|
|
4
|
+
*/
|
|
5
|
+
export declare const FR_LAPOSTE_POINCONT_ADAPTER_ID = "fr-laposte-poincont";
|
|
6
|
+
/**
|
|
7
|
+
* The license the publisher's dataset record states.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FR_LAPOSTE_POINCONT_LICENSE = "Licence Ouverte 2.0";
|
|
10
|
+
/**
|
|
11
|
+
* The credit Licence Ouverte 2.0 requires: the licensor's name, beside the date of the data's last update.
|
|
12
|
+
*/
|
|
13
|
+
export declare const FR_LAPOSTE_POINCONT_ATTRIBUTION = "La Poste - Branche R\u00E9seau, Liste des bureaux de poste, agences postales et relais poste (laposte-poincont2), via data.laposte.fr";
|
|
14
|
+
/**
|
|
15
|
+
* The file the fetcher writes and the adapter reads, one row per line.
|
|
16
|
+
*/
|
|
17
|
+
export declare const LAPOSTE_POINCONT_FILENAME = "laposte-poincont2.jsonl";
|
|
18
|
+
/**
|
|
19
|
+
* The dataset fields the fetcher keeps, in the publisher's spelling.
|
|
20
|
+
*/
|
|
21
|
+
export declare const LAPOSTE_POINCONT_FIELDS: readonly ["identifiant_a", "libelle_du_site", "caracteristique_du_site", "adresse", "complement_d_adresse", "lieu_dit", "code_postal", "localite", "code_insee", "pays", "latitude", "longitude", "precision_du_geocodage"];
|
|
22
|
+
/**
|
|
23
|
+
* One row as the fetcher writes it.
|
|
24
|
+
* A field the publisher left empty is `null`.
|
|
25
|
+
*/
|
|
26
|
+
export type LaPostePoincontRecord = Readonly<Partial<Record<(typeof LAPOSTE_POINCONT_FIELDS)[number], string | number | null>>>;
|
|
27
|
+
/**
|
|
28
|
+
* Why a row yielded no corpus row.
|
|
29
|
+
*/
|
|
30
|
+
export declare const LaPosteRefusal: {
|
|
31
|
+
/**
|
|
32
|
+
* The site is outside France (`pays` isn't `FRANCE`).
|
|
33
|
+
*/
|
|
34
|
+
readonly NotFrance: "row:not-france";
|
|
35
|
+
/**
|
|
36
|
+
* The row has no identifier.
|
|
37
|
+
*/
|
|
38
|
+
readonly IdentifierAbsent: "row:identifier-absent";
|
|
39
|
+
/**
|
|
40
|
+
* The label is empty once its type code is dropped.
|
|
41
|
+
*/
|
|
42
|
+
readonly NameAbsent: "row:name-absent";
|
|
43
|
+
/**
|
|
44
|
+
* `code_postal` isn't five digits.
|
|
45
|
+
*/
|
|
46
|
+
readonly PostcodeAbsent: "row:postcode-absent";
|
|
47
|
+
readonly LocalityAbsent: "row:locality-absent";
|
|
48
|
+
/**
|
|
49
|
+
* `adresse` is empty.
|
|
50
|
+
*/
|
|
51
|
+
readonly StreetLineAbsent: "row:street-line-absent";
|
|
52
|
+
/**
|
|
53
|
+
* `adresse` holds a digit the line reader cannot place, or a street-type word with no name.
|
|
54
|
+
*/
|
|
55
|
+
readonly StreetLineUnread: "row:street-line-unread";
|
|
56
|
+
/**
|
|
57
|
+
* The complement identifies the site's keeper by an honorific (`MME CHAMBARD`).
|
|
58
|
+
*/
|
|
59
|
+
readonly KeeperNamed: "row:keeper-named";
|
|
60
|
+
/**
|
|
61
|
+
* The jurisdiction's layout doesn't print every component the row holds.
|
|
62
|
+
*/
|
|
63
|
+
readonly Unrenderable: "row:unrenderable";
|
|
64
|
+
};
|
|
65
|
+
export type LaPosteRefusal = (typeof LaPosteRefusal)[keyof typeof LaPosteRefusal];
|
|
66
|
+
/**
|
|
67
|
+
* Why an admitted row left out a field the record holds.
|
|
68
|
+
*/
|
|
69
|
+
export declare const LaPosteTrim: {
|
|
70
|
+
/**
|
|
71
|
+
* `complement_d_adresse` was left out.
|
|
72
|
+
*/
|
|
73
|
+
readonly Complement: "component:complement:unread";
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The site's name: its label without the trailing type code, or `null` when the label held only the code.
|
|
77
|
+
*/
|
|
78
|
+
export declare function laPosteSiteName(record: Pick<LaPostePoincontRecord, "libelle_du_site">): string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Whether the row's complement identifies the site's keeper by an honorific.
|
|
81
|
+
*/
|
|
82
|
+
export declare function laPosteNamesKeeper(record: Pick<LaPostePoincontRecord, "complement_d_adresse">): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Whether the site is a post office rather than a parcel partner.
|
|
85
|
+
*/
|
|
86
|
+
export declare function isLaPostePostOffice(record: Pick<LaPostePoincontRecord, "caracteristique_du_site">): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* One row's address as labeled components with its jurisdiction, or the reason it has none.
|
|
89
|
+
*/
|
|
90
|
+
export declare function readLaPosteAddress(record: LaPostePoincontRecord): {
|
|
91
|
+
readonly country: string;
|
|
92
|
+
readonly components: CanonicalRow["components"];
|
|
93
|
+
} | {
|
|
94
|
+
readonly refused: LaPosteRefusal;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* Read one row into a corpus row, or report why it yielded none.
|
|
98
|
+
*/
|
|
99
|
+
export declare function readLaPosteRecord(record: LaPostePoincontRecord): {
|
|
100
|
+
readonly admitted: CanonicalRow;
|
|
101
|
+
readonly trimmed: boolean;
|
|
102
|
+
} | {
|
|
103
|
+
readonly refused: LaPosteRefusal;
|
|
104
|
+
};
|
|
105
|
+
export declare function createLaPostePoincontAdapter(): CorpusAdapter;
|
|
106
|
+
/**
|
|
107
|
+
* The configured adapter instance registered with the corpus builder.
|
|
108
|
+
*/
|
|
109
|
+
export declare const laPostePoincontAdapter: CorpusAdapter;
|
|
110
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../lib/fr/adapters/laposte-poincont/adapter.ts"],"names":[],"mappings":"AAgFA,OAAO,EAGN,KAAK,YAAY,EAEjB,KAAK,aAAa,EAElB,MAAM,QAAQ,CAAA;AAEf;;GAEG;AACH,eAAO,MAAM,8BAA8B,wBAAwB,CAAA;AAEnE;;GAEG;AACH,eAAO,MAAM,2BAA2B,wBAAwB,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,+BAA+B,0IACuF,CAAA;AAEnI;;GAEG;AACH,eAAO,MAAM,yBAAyB,4BAA4B,CAAA;AAElE;;GAEG;AACH,eAAO,MAAM,uBAAuB,YACnC,eAAe,EACf,iBAAiB,EACjB,yBAAyB,EACzB,SAAS,EACT,sBAAsB,EACtB,UAAU,EACV,aAAa,EACb,UAAU,EACV,YAAY,EACZ,MAAM,EACN,UAAU,EACV,WAAW,EACX,wBAAwB,CACf,CAAA;AAEV;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAC3C,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CA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