@mailwoman/corpus 10.1.0 → 10.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/licenses/cdla-permissive-2.0.md +1 -1
- package/lib/adapters/cordis/adapter.ts +13 -7
- package/lib/adapters/dedup-key.ts +1 -1
- package/lib/adapters/geonames/adapter.ts +1 -1
- package/lib/adapters/gleif/adapter.ts +17 -16
- package/lib/adapters/libpostal-dictionary.ts +0 -2
- package/lib/adapters/openaddresses/adapter.ts +4 -3
- package/lib/adapters/osm/adapter.ts +22 -21
- package/lib/adapters/po-box/adapter.ts +10 -5
- package/lib/adapters/registry.ts +4 -4
- package/lib/adapters/source-id.ts +2 -2
- package/lib/adapters/street-line.ts +7 -6
- package/lib/adapters/wof/admin/json/adapter.ts +2 -2
- package/lib/adapters/wof/json-rows.ts +2 -1
- package/lib/adapters/wof/postalcode-json/adapter.ts +6 -2
- package/lib/adapters.ts +5 -5
- package/lib/au/adapters/gnaf/adapter.ts +1 -1
- package/lib/be/adapters/brussels/adapter.ts +22 -22
- package/lib/be/adapters/vlaanderen/adapter.ts +54 -57
- package/lib/be/adapters/wallonie/adapter.ts +17 -17
- package/lib/be/tools/fetch/brussels.ts +13 -10
- package/lib/be/tools/fetch/wallonie.ts +8 -7
- package/lib/build/adapters.ts +2 -1
- package/lib/build/align.ts +5 -4
- package/lib/build/checkpoint.ts +5 -3
- package/lib/build/eligibility.ts +3 -3
- package/lib/build/types.ts +8 -6
- package/lib/cz/adapters/cuzk/adapter.ts +41 -38
- package/lib/cz/tools/fetch/cuzk.ts +42 -31
- package/lib/de/recipes/locale.ts +1 -1
- package/lib/dk/adapters/inspire/adapter.ts +38 -38
- package/lib/dk/tools/fetch/inspire.ts +16 -14
- package/lib/ee/adapters/ads/adapter.ts +26 -32
- package/lib/ee/tools/fetch/ads.ts +10 -8
- package/lib/es/adapters/bizkaia/adapter.ts +47 -47
- package/lib/es/adapters/catastro/adapter.ts +36 -34
- package/lib/es/adapters/gipuzkoa/adapter.ts +38 -45
- package/lib/es/adapters/navarra/adapter.ts +28 -27
- package/lib/es/cadastre.ts +31 -31
- package/lib/es/tools/fetch/bizkaia.ts +40 -36
- package/lib/es/tools/fetch/catastro.ts +51 -40
- package/lib/es/tools/fetch/gipuzkoa.ts +13 -11
- package/lib/es/tools/fetch/navarra.ts +33 -25
- package/lib/fi/adapters/ryhti/adapter.ts +22 -26
- package/lib/fi/tools/fetch/ryhti.ts +31 -31
- package/lib/fr/adapters/annuaire-education/adapter.ts +13 -11
- package/lib/fr/adapters/ban/adapter.ts +6 -6
- package/lib/fr/adapters/finess/adapter.ts +16 -15
- package/lib/fr/adapters/finess/voie-type.ts +4 -3
- package/lib/fr/insee-country.ts +2 -2
- package/lib/fr/recipes/lieudit.ts +8 -6
- package/lib/fr/tools/fetch/annuaire-education.ts +11 -8
- package/lib/fr/tools/fetch/ban.ts +3 -2
- package/lib/fr/tools/fetch/finess.ts +14 -13
- package/lib/inspire/address.ts +86 -78
- package/lib/inspire/errors.ts +9 -8
- package/lib/inspire/stream.ts +29 -26
- package/lib/international/recipes/locale.ts +13 -9
- package/lib/it/adapters/anac/adapter.ts +51 -46
- package/lib/it/tools/fetch/anac.ts +22 -25
- package/lib/jp/adapters/wof-admin/adapter.ts +2 -6
- package/lib/jp/tools/fetch/houjin.ts +3 -3
- package/lib/kr/adapters/localdata/permit-rows.ts +1 -1
- package/lib/kr/tools/fetch/juso.ts +1 -1
- package/lib/kr/tools/fetch/localdata.ts +2 -2
- package/lib/lu/adapters/bd-adresses/adapter.ts +10 -10
- package/lib/lu/tools/fetch/bd-adresses.ts +15 -13
- package/lib/lv/adapters/varis/adapter.ts +24 -23
- package/lib/lv/tools/fetch/varis.ts +3 -2
- package/lib/nl/adapters/kadaster/adapter.ts +29 -29
- package/lib/nl/tools/fetch/kadaster.ts +16 -12
- package/lib/no/adapters/matrikkelen/adapter.ts +6 -5
- package/lib/no/tools/fetch/matrikkelen.ts +59 -47
- package/lib/parquet/duckdb.ts +7 -4
- package/lib/parquet/readers.ts +3 -3
- package/lib/parquet/schema.ts +1 -1
- package/lib/parquet/writers.ts +3 -2
- package/lib/pl/adapters/emuia/adapter.ts +12 -12
- package/lib/pl/tools/fetch/emuia.ts +10 -9
- package/lib/recipes/bare/postcode.ts +1 -1
- package/lib/recipes/boundary-stress.ts +1 -1
- package/lib/recipes/house-venue.ts +7 -3
- package/lib/recipes/intersection.ts +2 -2
- package/lib/recipes/po/box/cedex/recipe.ts +3 -3
- package/lib/recipes/po/box/cedex/sources.ts +13 -1
- package/lib/recipes/scaffold.ts +31 -21
- package/lib/recipes/sources.ts +16 -3
- package/lib/recipes/street/bare.ts +2 -2
- package/lib/recipes/street.ts +3 -1
- package/lib/recipes/sub/venue/context.ts +2 -0
- package/lib/recipes/sub/venue/render.ts +1 -1
- package/lib/recipes/sub/venue/sources.ts +24 -29
- package/lib/recipes/sub/venue.ts +12 -18
- package/lib/recipes/trailing-region.ts +6 -2
- package/lib/recipes/unit.ts +3 -3
- package/lib/recipes/venue.ts +347 -0
- package/lib/recipes.ts +4 -2
- package/lib/registers.ts +8 -6
- package/lib/ro/adapters/retea-scolara/adapter.ts +5 -5
- package/lib/ro/tools/fetch/retea-scolara.ts +1 -1
- package/lib/runner.ts +4 -3
- package/lib/sg/recipes/register.ts +1 -1
- package/lib/sg/tools/fetch/acra.ts +3 -3
- package/lib/sk/adapters/inspire/adapter.ts +25 -27
- package/lib/sk/tools/fetch/inspire.ts +15 -14
- package/lib/source-register/effective-manifest.ts +3 -3
- package/lib/source-register/register.ts +3 -3
- package/lib/source-register/training-manifest.ts +1 -1
- package/lib/source-register/types.ts +12 -13
- package/lib/subvenue/promotions.ts +1 -1
- package/lib/subvenue/table.ts +4 -4
- package/lib/surfaces/locale.ts +2 -0
- package/lib/synthesizers/anchor-absorption.ts +2 -1
- package/lib/synthesizers/boundary-stress.ts +20 -26
- package/lib/synthesizers/house-venue.ts +26 -30
- package/lib/synthesizers/no-street.ts +2 -1
- package/lib/synthesizers/po-box.ts +6 -3
- package/lib/synthesizers/tail.ts +55 -0
- package/lib/synthesizers/utils.ts +19 -2
- package/lib/test-kit.ts +2 -2
- package/lib/tools/audit.ts +7 -5
- package/lib/tools/corpus-stats.ts +1 -1
- package/lib/tools/fetch/atom.ts +10 -10
- package/lib/tools/fetch/cordis.ts +11 -9
- package/lib/tools/fetch/download/manifest.ts +2 -1
- package/lib/tools/fetch/download/network.ts +4 -4
- package/lib/tools/fetch/download/retry.ts +4 -4
- package/lib/tools/fetch/geonames/dump.ts +5 -3
- package/lib/tools/fetch/geonames/postal.ts +2 -2
- package/lib/tools/fetch/gleif.ts +6 -4
- package/lib/tools/fetch/header.ts +8 -6
- package/lib/tools/fetch/inspire-addresses.ts +41 -36
- package/lib/tools/fetch/openaddresses.ts +1 -1
- package/lib/tools/fetch/vlaanderen-ad.ts +17 -17
- package/lib/tools/fetch/wfs-harvest.ts +39 -28
- package/lib/tools/fetch.ts +0 -42
- package/lib/tools/golden/expand.ts +8 -8
- package/lib/tools/golden/promote.ts +12 -8
- package/lib/tools/golden/relabel-street/directory.ts +7 -6
- package/lib/tools/golden/relabel-street/row.ts +7 -6
- package/lib/tools/ingest-csv.ts +3 -3
- package/lib/tools/jsonl-to-parquet.ts +1 -1
- package/lib/tools/lint/recipe-output/vocab.ts +10 -5
- package/lib/tools/lint/recipe-output.ts +26 -8
- package/lib/tools/overlay/kryptonite.ts +4 -3
- package/lib/tools/overlay/manifest.ts +4 -2
- package/lib/tools/overlay/merge-source.ts +2 -1
- package/lib/tools/overlay/split-slice.ts +2 -2
- package/lib/tools/overlay/translit.ts +6 -4
- package/lib/tools/overture-subvenue.ts +1 -1
- package/lib/tools/postcode-triples.ts +5 -4
- package/lib/tools/source-register/build.ts +17 -14
- package/lib/tools/sub/venue/lexicon.ts +4 -8
- package/lib/tw/tools/fetch/gcis.ts +4 -4
- package/lib/types.ts +4 -3
- package/lib/us/adapters/state/hi-schools/workbook.ts +1 -1
- package/lib/us/adapters/usgov/nad/adapter.ts +11 -11
- package/lib/us/adapters/usgov/samhsa-treatment-locator/adapter.ts +4 -4
- package/lib/us/fips-state.ts +2 -2
- package/lib/{synthesizers → us/synthesizers}/intersection.ts +12 -13
- package/lib/{synthesizers → us/synthesizers}/street.ts +16 -15
- package/lib/us/tools/fetch/imls-pls.ts +1 -1
- package/lib/us/tools/fetch/nad.ts +7 -7
- package/lib/us/tools/fetch/nppes.ts +5 -5
- package/lib/us/tools/fetch/state/hi-schools.ts +3 -2
- package/lib/us/tools/fetch/tiger-full.ts +1 -1
- package/lib/utils/align.ts +13 -10
- package/lib/utils/golden.ts +2 -2
- package/lib/utils/license.ts +3 -3
- package/lib/utils/split.ts +19 -15
- package/lib/utils/tokenize.ts +7 -26
- package/lib/utils/wof-json.ts +4 -4
- package/out/adapters/cordis/adapter.d.ts +5 -3
- package/out/adapters/cordis/adapter.d.ts.map +1 -1
- package/out/adapters/cordis/adapter.js +13 -7
- package/out/adapters/cordis/adapter.js.map +1 -1
- package/out/adapters/dedup-key.d.ts +1 -1
- package/out/adapters/dedup-key.js +1 -1
- package/out/adapters/geonames/adapter.js +1 -1
- package/out/adapters/geonames/adapter.js.map +1 -1
- package/out/adapters/gleif/adapter.d.ts +9 -9
- package/out/adapters/gleif/adapter.d.ts.map +1 -1
- package/out/adapters/gleif/adapter.js +15 -14
- package/out/adapters/gleif/adapter.js.map +1 -1
- package/out/adapters/libpostal-dictionary.d.ts +0 -2
- package/out/adapters/libpostal-dictionary.d.ts.map +1 -1
- package/out/adapters/libpostal-dictionary.js +0 -2
- package/out/adapters/libpostal-dictionary.js.map +1 -1
- package/out/adapters/openaddresses/adapter.d.ts +3 -2
- package/out/adapters/openaddresses/adapter.d.ts.map +1 -1
- package/out/adapters/openaddresses/adapter.js +1 -1
- package/out/adapters/openaddresses/adapter.js.map +1 -1
- package/out/adapters/osm/adapter.d.ts +17 -16
- package/out/adapters/osm/adapter.d.ts.map +1 -1
- package/out/adapters/osm/adapter.js +10 -9
- package/out/adapters/osm/adapter.js.map +1 -1
- package/out/adapters/po-box/adapter.d.ts +6 -3
- package/out/adapters/po-box/adapter.d.ts.map +1 -1
- package/out/adapters/po-box/adapter.js +4 -2
- package/out/adapters/po-box/adapter.js.map +1 -1
- package/out/adapters/registry.d.ts +3 -3
- package/out/adapters/registry.d.ts.map +1 -1
- package/out/adapters/registry.js +1 -1
- package/out/adapters/registry.js.map +1 -1
- package/out/adapters/source-id.d.ts +2 -2
- package/out/adapters/source-id.js +2 -2
- package/out/adapters/street-line.d.ts +7 -6
- package/out/adapters/street-line.d.ts.map +1 -1
- package/out/adapters/street-line.js +7 -6
- package/out/adapters/street-line.js.map +1 -1
- package/out/adapters/wof/admin/json/adapter.js +1 -1
- package/out/adapters/wof/admin/json/adapter.js.map +1 -1
- package/out/adapters/wof/json-rows.d.ts +2 -1
- package/out/adapters/wof/json-rows.d.ts.map +1 -1
- package/out/adapters/wof/json-rows.js.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.d.ts.map +1 -1
- package/out/adapters/wof/postalcode-json/adapter.js +5 -1
- package/out/adapters/wof/postalcode-json/adapter.js.map +1 -1
- package/out/adapters.d.ts +5 -5
- package/out/adapters.js +5 -5
- package/out/au/adapters/gnaf/adapter.js +1 -1
- package/out/au/adapters/gnaf/adapter.js.map +1 -1
- package/out/be/adapters/brussels/adapter.d.ts +9 -9
- package/out/be/adapters/brussels/adapter.d.ts.map +1 -1
- package/out/be/adapters/brussels/adapter.js +21 -21
- package/out/be/adapters/brussels/adapter.js.map +1 -1
- package/out/be/adapters/vlaanderen/adapter.d.ts +34 -37
- package/out/be/adapters/vlaanderen/adapter.d.ts.map +1 -1
- package/out/be/adapters/vlaanderen/adapter.js +40 -38
- package/out/be/adapters/vlaanderen/adapter.js.map +1 -1
- package/out/be/adapters/wallonie/adapter.d.ts +2 -2
- package/out/be/adapters/wallonie/adapter.js +17 -17
- package/out/be/adapters/wallonie/adapter.js.map +1 -1
- package/out/be/tools/fetch/brussels.d.ts +11 -8
- package/out/be/tools/fetch/brussels.d.ts.map +1 -1
- package/out/be/tools/fetch/brussels.js +10 -8
- package/out/be/tools/fetch/brussels.js.map +1 -1
- package/out/be/tools/fetch/wallonie.d.ts +6 -5
- package/out/be/tools/fetch/wallonie.d.ts.map +1 -1
- package/out/be/tools/fetch/wallonie.js +4 -4
- package/out/be/tools/fetch/wallonie.js.map +1 -1
- package/out/build/adapters.d.ts.map +1 -1
- package/out/build/adapters.js +2 -1
- package/out/build/adapters.js.map +1 -1
- package/out/build/align.d.ts +3 -2
- package/out/build/align.d.ts.map +1 -1
- package/out/build/align.js +2 -2
- package/out/build/align.js.map +1 -1
- package/out/build/checkpoint.d.ts +1 -1
- package/out/build/checkpoint.d.ts.map +1 -1
- package/out/build/checkpoint.js +4 -2
- package/out/build/checkpoint.js.map +1 -1
- package/out/build/eligibility.d.ts +2 -2
- package/out/build/eligibility.js +3 -3
- package/out/build/eligibility.js.map +1 -1
- package/out/build/types.d.ts +8 -6
- package/out/build/types.d.ts.map +1 -1
- package/out/cz/adapters/cuzk/adapter.d.ts +14 -14
- package/out/cz/adapters/cuzk/adapter.d.ts.map +1 -1
- package/out/cz/adapters/cuzk/adapter.js +38 -35
- package/out/cz/adapters/cuzk/adapter.js.map +1 -1
- package/out/cz/tools/fetch/cuzk.d.ts +31 -22
- package/out/cz/tools/fetch/cuzk.d.ts.map +1 -1
- package/out/cz/tools/fetch/cuzk.js +21 -19
- package/out/cz/tools/fetch/cuzk.js.map +1 -1
- package/out/de/recipes/locale.js +1 -1
- package/out/de/recipes/locale.js.map +1 -1
- package/out/dk/adapters/inspire/adapter.d.ts +32 -33
- package/out/dk/adapters/inspire/adapter.d.ts.map +1 -1
- package/out/dk/adapters/inspire/adapter.js +38 -38
- package/out/dk/adapters/inspire/adapter.js.map +1 -1
- package/out/dk/tools/fetch/inspire.d.ts +6 -5
- package/out/dk/tools/fetch/inspire.d.ts.map +1 -1
- package/out/dk/tools/fetch/inspire.js +15 -13
- package/out/dk/tools/fetch/inspire.js.map +1 -1
- package/out/ee/adapters/ads/adapter.d.ts +19 -26
- package/out/ee/adapters/ads/adapter.d.ts.map +1 -1
- package/out/ee/adapters/ads/adapter.js +22 -28
- package/out/ee/adapters/ads/adapter.js.map +1 -1
- package/out/ee/tools/fetch/ads.d.ts +3 -3
- package/out/ee/tools/fetch/ads.d.ts.map +1 -1
- package/out/ee/tools/fetch/ads.js +10 -8
- package/out/ee/tools/fetch/ads.js.map +1 -1
- package/out/es/adapters/bizkaia/adapter.d.ts +28 -28
- package/out/es/adapters/bizkaia/adapter.d.ts.map +1 -1
- package/out/es/adapters/bizkaia/adapter.js +43 -43
- package/out/es/adapters/bizkaia/adapter.js.map +1 -1
- package/out/es/adapters/catastro/adapter.d.ts +22 -23
- package/out/es/adapters/catastro/adapter.d.ts.map +1 -1
- package/out/es/adapters/catastro/adapter.js +35 -33
- package/out/es/adapters/catastro/adapter.js.map +1 -1
- package/out/es/adapters/gipuzkoa/adapter.d.ts +31 -38
- package/out/es/adapters/gipuzkoa/adapter.d.ts.map +1 -1
- package/out/es/adapters/gipuzkoa/adapter.js +40 -47
- package/out/es/adapters/gipuzkoa/adapter.js.map +1 -1
- package/out/es/adapters/navarra/adapter.d.ts +20 -19
- package/out/es/adapters/navarra/adapter.d.ts.map +1 -1
- package/out/es/adapters/navarra/adapter.js +23 -22
- package/out/es/adapters/navarra/adapter.js.map +1 -1
- package/out/es/cadastre.d.ts +21 -20
- package/out/es/cadastre.d.ts.map +1 -1
- package/out/es/cadastre.js +19 -21
- package/out/es/cadastre.js.map +1 -1
- package/out/es/tools/fetch/bizkaia.d.ts +28 -25
- package/out/es/tools/fetch/bizkaia.d.ts.map +1 -1
- package/out/es/tools/fetch/bizkaia.js +25 -24
- package/out/es/tools/fetch/bizkaia.js.map +1 -1
- package/out/es/tools/fetch/catastro.d.ts +28 -20
- package/out/es/tools/fetch/catastro.d.ts.map +1 -1
- package/out/es/tools/fetch/catastro.js +36 -31
- package/out/es/tools/fetch/catastro.js.map +1 -1
- package/out/es/tools/fetch/gipuzkoa.d.ts +11 -9
- package/out/es/tools/fetch/gipuzkoa.d.ts.map +1 -1
- package/out/es/tools/fetch/gipuzkoa.js +9 -8
- package/out/es/tools/fetch/gipuzkoa.js.map +1 -1
- package/out/es/tools/fetch/navarra.d.ts +20 -15
- package/out/es/tools/fetch/navarra.d.ts.map +1 -1
- package/out/es/tools/fetch/navarra.js +21 -16
- package/out/es/tools/fetch/navarra.js.map +1 -1
- package/out/fi/adapters/ryhti/adapter.d.ts +16 -20
- package/out/fi/adapters/ryhti/adapter.d.ts.map +1 -1
- package/out/fi/adapters/ryhti/adapter.js +21 -25
- package/out/fi/adapters/ryhti/adapter.js.map +1 -1
- package/out/fi/tools/fetch/ryhti.d.ts +24 -24
- package/out/fi/tools/fetch/ryhti.d.ts.map +1 -1
- package/out/fi/tools/fetch/ryhti.js +21 -24
- package/out/fi/tools/fetch/ryhti.js.map +1 -1
- package/out/fr/adapters/annuaire-education/adapter.d.ts +8 -8
- package/out/fr/adapters/annuaire-education/adapter.d.ts.map +1 -1
- package/out/fr/adapters/annuaire-education/adapter.js +13 -11
- package/out/fr/adapters/annuaire-education/adapter.js.map +1 -1
- package/out/fr/adapters/ban/adapter.d.ts +4 -4
- package/out/fr/adapters/ban/adapter.js +6 -6
- package/out/fr/adapters/ban/adapter.js.map +1 -1
- package/out/fr/adapters/finess/adapter.d.ts +12 -11
- package/out/fr/adapters/finess/adapter.d.ts.map +1 -1
- package/out/fr/adapters/finess/adapter.js +16 -15
- package/out/fr/adapters/finess/adapter.js.map +1 -1
- package/out/fr/adapters/finess/voie-type.d.ts +2 -2
- package/out/fr/adapters/finess/voie-type.d.ts.map +1 -1
- package/out/fr/adapters/finess/voie-type.js +4 -3
- package/out/fr/adapters/finess/voie-type.js.map +1 -1
- package/out/fr/insee-country.d.ts +2 -2
- package/out/fr/insee-country.js +2 -2
- package/out/fr/recipes/lieudit.d.ts.map +1 -1
- package/out/fr/recipes/lieudit.js +5 -4
- package/out/fr/recipes/lieudit.js.map +1 -1
- package/out/fr/tools/fetch/annuaire-education.d.ts +7 -4
- package/out/fr/tools/fetch/annuaire-education.d.ts.map +1 -1
- package/out/fr/tools/fetch/annuaire-education.js +9 -7
- package/out/fr/tools/fetch/annuaire-education.js.map +1 -1
- package/out/fr/tools/fetch/ban.d.ts +1 -1
- package/out/fr/tools/fetch/ban.d.ts.map +1 -1
- package/out/fr/tools/fetch/ban.js +3 -2
- package/out/fr/tools/fetch/ban.js.map +1 -1
- package/out/fr/tools/fetch/finess.d.ts +5 -5
- package/out/fr/tools/fetch/finess.d.ts.map +1 -1
- package/out/fr/tools/fetch/finess.js +13 -12
- package/out/fr/tools/fetch/finess.js.map +1 -1
- package/out/inspire/address.d.ts +62 -52
- package/out/inspire/address.d.ts.map +1 -1
- package/out/inspire/address.js +71 -60
- package/out/inspire/address.js.map +1 -1
- package/out/inspire/errors.d.ts +9 -8
- package/out/inspire/errors.d.ts.map +1 -1
- package/out/inspire/errors.js +7 -6
- package/out/inspire/errors.js.map +1 -1
- package/out/inspire/stream.d.ts +25 -22
- package/out/inspire/stream.d.ts.map +1 -1
- package/out/inspire/stream.js +10 -12
- package/out/inspire/stream.js.map +1 -1
- package/out/international/recipes/locale.d.ts +2 -2
- package/out/international/recipes/locale.d.ts.map +1 -1
- package/out/international/recipes/locale.js +11 -7
- package/out/international/recipes/locale.js.map +1 -1
- package/out/it/adapters/anac/adapter.d.ts +45 -43
- package/out/it/adapters/anac/adapter.d.ts.map +1 -1
- package/out/it/adapters/anac/adapter.js +48 -43
- package/out/it/adapters/anac/adapter.js.map +1 -1
- package/out/it/tools/fetch/anac.d.ts +16 -19
- package/out/it/tools/fetch/anac.d.ts.map +1 -1
- package/out/it/tools/fetch/anac.js +20 -23
- package/out/it/tools/fetch/anac.js.map +1 -1
- package/out/jp/adapters/wof-admin/adapter.d.ts.map +1 -1
- package/out/jp/adapters/wof-admin/adapter.js.map +1 -1
- package/out/jp/tools/fetch/houjin.js +2 -2
- package/out/jp/tools/fetch/houjin.js.map +1 -1
- package/out/kr/adapters/localdata/permit-rows.js +1 -1
- package/out/kr/adapters/localdata/permit-rows.js.map +1 -1
- package/out/kr/tools/fetch/juso.d.ts +1 -1
- package/out/kr/tools/fetch/localdata.d.ts +1 -1
- package/out/kr/tools/fetch/localdata.js +1 -1
- package/out/kr/tools/fetch/localdata.js.map +1 -1
- package/out/lu/adapters/bd-adresses/adapter.d.ts +9 -9
- package/out/lu/adapters/bd-adresses/adapter.js +10 -10
- package/out/lu/tools/fetch/bd-adresses.d.ts +11 -9
- package/out/lu/tools/fetch/bd-adresses.d.ts.map +1 -1
- package/out/lu/tools/fetch/bd-adresses.js +11 -11
- package/out/lu/tools/fetch/bd-adresses.js.map +1 -1
- package/out/lv/adapters/varis/adapter.d.ts +24 -23
- package/out/lv/adapters/varis/adapter.d.ts.map +1 -1
- package/out/lv/adapters/varis/adapter.js +24 -23
- package/out/lv/adapters/varis/adapter.js.map +1 -1
- package/out/lv/tools/fetch/varis.d.ts +2 -1
- package/out/lv/tools/fetch/varis.d.ts.map +1 -1
- package/out/lv/tools/fetch/varis.js +1 -1
- package/out/lv/tools/fetch/varis.js.map +1 -1
- package/out/nl/adapters/kadaster/adapter.d.ts +12 -12
- package/out/nl/adapters/kadaster/adapter.d.ts.map +1 -1
- package/out/nl/adapters/kadaster/adapter.js +22 -23
- package/out/nl/adapters/kadaster/adapter.js.map +1 -1
- package/out/nl/tools/fetch/kadaster.d.ts +14 -10
- package/out/nl/tools/fetch/kadaster.d.ts.map +1 -1
- package/out/nl/tools/fetch/kadaster.js +12 -9
- package/out/nl/tools/fetch/kadaster.js.map +1 -1
- package/out/no/adapters/matrikkelen/adapter.d.ts +1 -1
- package/out/no/adapters/matrikkelen/adapter.d.ts.map +1 -1
- package/out/no/adapters/matrikkelen/adapter.js +3 -3
- package/out/no/adapters/matrikkelen/adapter.js.map +1 -1
- package/out/no/tools/fetch/matrikkelen.d.ts +50 -38
- package/out/no/tools/fetch/matrikkelen.d.ts.map +1 -1
- package/out/no/tools/fetch/matrikkelen.js +44 -36
- package/out/no/tools/fetch/matrikkelen.js.map +1 -1
- package/out/parquet/duckdb.d.ts +7 -4
- package/out/parquet/duckdb.d.ts.map +1 -1
- package/out/parquet/duckdb.js +2 -1
- package/out/parquet/duckdb.js.map +1 -1
- package/out/parquet/readers.js +3 -3
- package/out/parquet/readers.js.map +1 -1
- package/out/parquet/schema.js +1 -1
- package/out/parquet/schema.js.map +1 -1
- package/out/parquet/writers.d.ts +1 -1
- package/out/parquet/writers.d.ts.map +1 -1
- package/out/parquet/writers.js +2 -1
- package/out/parquet/writers.js.map +1 -1
- package/out/pl/adapters/emuia/adapter.d.ts +8 -8
- package/out/pl/adapters/emuia/adapter.js +12 -12
- package/out/pl/adapters/emuia/adapter.js.map +1 -1
- package/out/pl/tools/fetch/emuia.d.ts +5 -4
- package/out/pl/tools/fetch/emuia.d.ts.map +1 -1
- package/out/pl/tools/fetch/emuia.js +10 -9
- package/out/pl/tools/fetch/emuia.js.map +1 -1
- package/out/recipes/bare/postcode.js +1 -1
- package/out/recipes/bare/postcode.js.map +1 -1
- package/out/recipes/boundary-stress.js +1 -1
- package/out/recipes/boundary-stress.js.map +1 -1
- package/out/recipes/house-venue.d.ts.map +1 -1
- package/out/recipes/house-venue.js +6 -3
- package/out/recipes/house-venue.js.map +1 -1
- package/out/recipes/intersection.js +2 -2
- package/out/recipes/intersection.js.map +1 -1
- package/out/recipes/po/box/cedex/recipe.js +2 -1
- package/out/recipes/po/box/cedex/recipe.js.map +1 -1
- package/out/recipes/po/box/cedex/sources.d.ts +8 -2
- package/out/recipes/po/box/cedex/sources.d.ts.map +1 -1
- package/out/recipes/po/box/cedex/sources.js +1 -1
- package/out/recipes/po/box/cedex/sources.js.map +1 -1
- package/out/recipes/scaffold.d.ts +28 -19
- package/out/recipes/scaffold.d.ts.map +1 -1
- package/out/recipes/scaffold.js +3 -2
- package/out/recipes/scaffold.js.map +1 -1
- package/out/recipes/sources.d.ts +1 -1
- package/out/recipes/sources.d.ts.map +1 -1
- package/out/recipes/sources.js +15 -2
- package/out/recipes/sources.js.map +1 -1
- package/out/recipes/street/bare.js +2 -2
- package/out/recipes/street/bare.js.map +1 -1
- package/out/recipes/street.d.ts.map +1 -1
- package/out/recipes/street.js +3 -1
- package/out/recipes/street.js.map +1 -1
- package/out/recipes/sub/venue/context.d.ts.map +1 -1
- package/out/recipes/sub/venue/context.js +2 -0
- package/out/recipes/sub/venue/context.js.map +1 -1
- package/out/recipes/sub/venue/render.js +1 -1
- package/out/recipes/sub/venue/render.js.map +1 -1
- package/out/recipes/sub/venue/sources.d.ts +6 -3
- package/out/recipes/sub/venue/sources.d.ts.map +1 -1
- package/out/recipes/sub/venue/sources.js +16 -20
- package/out/recipes/sub/venue/sources.js.map +1 -1
- package/out/recipes/sub/venue.d.ts +2 -5
- package/out/recipes/sub/venue.d.ts.map +1 -1
- package/out/recipes/sub/venue.js +10 -14
- package/out/recipes/sub/venue.js.map +1 -1
- package/out/recipes/trailing-region.d.ts.map +1 -1
- package/out/recipes/trailing-region.js +6 -1
- package/out/recipes/trailing-region.js.map +1 -1
- package/out/recipes/unit.js +2 -2
- package/out/recipes/unit.js.map +1 -1
- package/out/recipes/venue.d.ts +119 -0
- package/out/recipes/venue.d.ts.map +1 -0
- package/out/recipes/venue.js +245 -0
- package/out/recipes/venue.js.map +1 -0
- package/out/recipes.d.ts +1 -1
- package/out/recipes.d.ts.map +1 -1
- package/out/recipes.js +3 -1
- package/out/recipes.js.map +1 -1
- package/out/registers.d.ts +8 -6
- package/out/registers.d.ts.map +1 -1
- package/out/registers.js +8 -6
- package/out/registers.js.map +1 -1
- package/out/ro/adapters/retea-scolara/adapter.d.ts +5 -5
- package/out/ro/adapters/retea-scolara/adapter.js +5 -5
- package/out/ro/tools/fetch/retea-scolara.js +1 -1
- package/out/ro/tools/fetch/retea-scolara.js.map +1 -1
- package/out/runner.d.ts +3 -2
- package/out/runner.d.ts.map +1 -1
- package/out/runner.js +1 -1
- package/out/runner.js.map +1 -1
- package/out/sg/recipes/register.js +1 -1
- package/out/sg/recipes/register.js.map +1 -1
- package/out/sg/tools/fetch/acra.js +2 -2
- package/out/sg/tools/fetch/acra.js.map +1 -1
- package/out/sk/adapters/inspire/adapter.d.ts +5 -5
- package/out/sk/adapters/inspire/adapter.d.ts.map +1 -1
- package/out/sk/adapters/inspire/adapter.js +18 -18
- package/out/sk/adapters/inspire/adapter.js.map +1 -1
- package/out/sk/tools/fetch/inspire.d.ts +11 -10
- package/out/sk/tools/fetch/inspire.d.ts.map +1 -1
- package/out/sk/tools/fetch/inspire.js +15 -14
- package/out/sk/tools/fetch/inspire.js.map +1 -1
- package/out/source-register/effective-manifest.js +3 -3
- package/out/source-register/effective-manifest.js.map +1 -1
- package/out/source-register/register.d.ts +2 -2
- package/out/source-register/register.d.ts.map +1 -1
- package/out/source-register/register.js +2 -2
- package/out/source-register/register.js.map +1 -1
- package/out/source-register/training-manifest.d.ts +1 -1
- package/out/source-register/types.d.ts +12 -13
- package/out/source-register/types.d.ts.map +1 -1
- package/out/source-register/types.js +2 -2
- package/out/source-register/types.js.map +1 -1
- package/out/subvenue/promotions.d.ts +1 -1
- package/out/subvenue/promotions.js +1 -1
- package/out/subvenue/table.d.ts +4 -4
- package/out/subvenue/table.js +3 -3
- package/out/surfaces/locale.d.ts.map +1 -1
- package/out/surfaces/locale.js +2 -0
- package/out/surfaces/locale.js.map +1 -1
- package/out/synthesizers/anchor-absorption.d.ts +2 -1
- package/out/synthesizers/anchor-absorption.d.ts.map +1 -1
- package/out/synthesizers/anchor-absorption.js.map +1 -1
- package/out/synthesizers/boundary-stress.d.ts +1 -1
- package/out/synthesizers/boundary-stress.d.ts.map +1 -1
- package/out/synthesizers/boundary-stress.js +20 -23
- package/out/synthesizers/boundary-stress.js.map +1 -1
- package/out/synthesizers/house-venue.d.ts +3 -2
- package/out/synthesizers/house-venue.d.ts.map +1 -1
- package/out/synthesizers/house-venue.js +24 -26
- package/out/synthesizers/house-venue.js.map +1 -1
- package/out/synthesizers/no-street.d.ts.map +1 -1
- package/out/synthesizers/no-street.js.map +1 -1
- package/out/synthesizers/po-box.d.ts +4 -2
- package/out/synthesizers/po-box.d.ts.map +1 -1
- package/out/synthesizers/po-box.js.map +1 -1
- package/out/synthesizers/tail.d.ts +36 -0
- package/out/synthesizers/tail.d.ts.map +1 -0
- package/out/synthesizers/tail.js +32 -0
- package/out/synthesizers/tail.js.map +1 -0
- package/out/synthesizers/utils.d.ts +2 -1
- package/out/synthesizers/utils.d.ts.map +1 -1
- package/out/synthesizers/utils.js +17 -1
- package/out/synthesizers/utils.js.map +1 -1
- package/out/test-kit.js +2 -2
- package/out/test-kit.js.map +1 -1
- package/out/tools/audit.d.ts +2 -1
- package/out/tools/audit.d.ts.map +1 -1
- package/out/tools/audit.js +4 -3
- package/out/tools/audit.js.map +1 -1
- package/out/tools/corpus-stats.js +1 -1
- package/out/tools/corpus-stats.js.map +1 -1
- package/out/tools/fetch/atom.d.ts +8 -8
- package/out/tools/fetch/atom.d.ts.map +1 -1
- package/out/tools/fetch/atom.js +7 -8
- package/out/tools/fetch/atom.js.map +1 -1
- package/out/tools/fetch/cordis.d.ts +4 -3
- package/out/tools/fetch/cordis.d.ts.map +1 -1
- package/out/tools/fetch/cordis.js +9 -7
- package/out/tools/fetch/cordis.js.map +1 -1
- package/out/tools/fetch/download/manifest.d.ts.map +1 -1
- package/out/tools/fetch/download/manifest.js +2 -1
- package/out/tools/fetch/download/manifest.js.map +1 -1
- package/out/tools/fetch/download/network.d.ts +4 -4
- package/out/tools/fetch/download/retry.js +4 -4
- package/out/tools/fetch/download/retry.js.map +1 -1
- package/out/tools/fetch/geonames/dump.d.ts +3 -2
- package/out/tools/fetch/geonames/dump.d.ts.map +1 -1
- package/out/tools/fetch/geonames/dump.js +2 -1
- package/out/tools/fetch/geonames/dump.js.map +1 -1
- package/out/tools/fetch/geonames/postal.d.ts +2 -2
- package/out/tools/fetch/gleif.d.ts +3 -2
- package/out/tools/fetch/gleif.d.ts.map +1 -1
- package/out/tools/fetch/gleif.js +6 -4
- package/out/tools/fetch/gleif.js.map +1 -1
- package/out/tools/fetch/header.d.ts +7 -5
- package/out/tools/fetch/header.d.ts.map +1 -1
- package/out/tools/fetch/header.js +8 -6
- package/out/tools/fetch/header.js.map +1 -1
- package/out/tools/fetch/inspire-addresses.d.ts +32 -27
- package/out/tools/fetch/inspire-addresses.d.ts.map +1 -1
- package/out/tools/fetch/inspire-addresses.js +25 -24
- package/out/tools/fetch/inspire-addresses.js.map +1 -1
- package/out/tools/fetch/openaddresses.js +1 -1
- package/out/tools/fetch/openaddresses.js.map +1 -1
- package/out/tools/fetch/vlaanderen-ad.d.ts +5 -5
- package/out/tools/fetch/vlaanderen-ad.d.ts.map +1 -1
- package/out/tools/fetch/vlaanderen-ad.js +16 -16
- package/out/tools/fetch/vlaanderen-ad.js.map +1 -1
- package/out/tools/fetch/wfs-harvest.d.ts +26 -16
- package/out/tools/fetch/wfs-harvest.d.ts.map +1 -1
- package/out/tools/fetch/wfs-harvest.js +21 -18
- package/out/tools/fetch/wfs-harvest.js.map +1 -1
- package/out/tools/fetch.d.ts +0 -41
- package/out/tools/fetch.d.ts.map +1 -1
- package/out/tools/fetch.js +0 -41
- package/out/tools/fetch.js.map +1 -1
- package/out/tools/golden/expand.d.ts +7 -7
- package/out/tools/golden/expand.js +1 -1
- package/out/tools/golden/expand.js.map +1 -1
- package/out/tools/golden/promote.d.ts +2 -2
- package/out/tools/golden/promote.d.ts.map +1 -1
- package/out/tools/golden/promote.js +9 -6
- package/out/tools/golden/promote.js.map +1 -1
- package/out/tools/golden/relabel-street/directory.d.ts +4 -4
- package/out/tools/golden/relabel-street/directory.d.ts.map +1 -1
- package/out/tools/golden/relabel-street/directory.js +3 -2
- package/out/tools/golden/relabel-street/directory.js.map +1 -1
- package/out/tools/golden/relabel-street/row.d.ts +4 -3
- package/out/tools/golden/relabel-street/row.d.ts.map +1 -1
- package/out/tools/golden/relabel-street/row.js +3 -3
- package/out/tools/golden/relabel-street/row.js.map +1 -1
- package/out/tools/ingest-csv.js +3 -3
- package/out/tools/ingest-csv.js.map +1 -1
- package/out/tools/jsonl-to-parquet.d.ts +1 -1
- package/out/tools/lint/recipe-output/vocab.d.ts +10 -5
- package/out/tools/lint/recipe-output/vocab.d.ts.map +1 -1
- package/out/tools/lint/recipe-output/vocab.js.map +1 -1
- package/out/tools/lint/recipe-output.d.ts +8 -8
- package/out/tools/lint/recipe-output.d.ts.map +1 -1
- package/out/tools/lint/recipe-output.js +17 -0
- package/out/tools/lint/recipe-output.js.map +1 -1
- package/out/tools/overlay/kryptonite.d.ts +2 -2
- package/out/tools/overlay/kryptonite.d.ts.map +1 -1
- package/out/tools/overlay/kryptonite.js +2 -1
- package/out/tools/overlay/kryptonite.js.map +1 -1
- package/out/tools/overlay/manifest.d.ts +2 -1
- package/out/tools/overlay/manifest.d.ts.map +1 -1
- package/out/tools/overlay/manifest.js +2 -1
- package/out/tools/overlay/manifest.js.map +1 -1
- package/out/tools/overlay/merge-source.d.ts +2 -1
- package/out/tools/overlay/merge-source.d.ts.map +1 -1
- package/out/tools/overlay/merge-source.js.map +1 -1
- package/out/tools/overlay/split-slice.d.ts +1 -1
- package/out/tools/overlay/split-slice.js +1 -1
- package/out/tools/overlay/split-slice.js.map +1 -1
- package/out/tools/overlay/translit.d.ts +4 -3
- package/out/tools/overlay/translit.d.ts.map +1 -1
- package/out/tools/overlay/translit.js +2 -1
- package/out/tools/overlay/translit.js.map +1 -1
- package/out/tools/overture-subvenue.d.ts +1 -1
- package/out/tools/overture-subvenue.d.ts.map +1 -1
- package/out/tools/postcode-triples.d.ts +1 -1
- package/out/tools/postcode-triples.d.ts.map +1 -1
- package/out/tools/postcode-triples.js +4 -3
- package/out/tools/postcode-triples.js.map +1 -1
- package/out/tools/source-register/build.d.ts +10 -8
- package/out/tools/source-register/build.d.ts.map +1 -1
- package/out/tools/source-register/build.js +10 -8
- package/out/tools/source-register/build.js.map +1 -1
- package/out/tools/sub/venue/lexicon.d.ts +2 -6
- package/out/tools/sub/venue/lexicon.d.ts.map +1 -1
- package/out/tools/sub/venue/lexicon.js +2 -6
- package/out/tools/sub/venue/lexicon.js.map +1 -1
- package/out/tw/tools/fetch/gcis.js +3 -3
- package/out/tw/tools/fetch/gcis.js.map +1 -1
- package/out/types.d.ts +4 -3
- package/out/types.d.ts.map +1 -1
- package/out/types.js.map +1 -1
- package/out/us/adapters/state/hi-schools/workbook.d.ts +1 -1
- package/out/us/adapters/state/hi-schools/workbook.d.ts.map +1 -1
- package/out/us/adapters/state/hi-schools/workbook.js.map +1 -1
- package/out/us/adapters/usgov/nad/adapter.js +6 -6
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -1
- package/out/us/adapters/usgov/samhsa-treatment-locator/adapter.js +2 -2
- package/out/us/adapters/usgov/samhsa-treatment-locator/adapter.js.map +1 -1
- package/out/us/fips-state.d.ts +2 -2
- package/out/us/fips-state.d.ts.map +1 -1
- package/out/us/fips-state.js.map +1 -1
- package/out/us/synthesizers/intersection.d.ts.map +1 -0
- package/out/{synthesizers → us/synthesizers}/intersection.js +13 -9
- package/out/us/synthesizers/intersection.js.map +1 -0
- package/out/{synthesizers → us/synthesizers}/street.d.ts +3 -2
- package/out/us/synthesizers/street.d.ts.map +1 -0
- package/out/{synthesizers → us/synthesizers}/street.js +12 -12
- package/out/us/synthesizers/street.js.map +1 -0
- package/out/us/tools/fetch/imls-pls.js +1 -1
- package/out/us/tools/fetch/imls-pls.js.map +1 -1
- package/out/us/tools/fetch/nad.d.ts +6 -6
- package/out/us/tools/fetch/nad.js +1 -1
- package/out/us/tools/fetch/nad.js.map +1 -1
- package/out/us/tools/fetch/nppes.js +3 -3
- package/out/us/tools/fetch/nppes.js.map +1 -1
- package/out/us/tools/fetch/state/hi-schools.d.ts +2 -1
- package/out/us/tools/fetch/state/hi-schools.d.ts.map +1 -1
- package/out/us/tools/fetch/state/hi-schools.js +1 -1
- package/out/us/tools/fetch/state/hi-schools.js.map +1 -1
- package/out/us/tools/fetch/tiger-full.js +1 -1
- package/out/us/tools/fetch/tiger-full.js.map +1 -1
- package/out/utils/align.d.ts +5 -3
- package/out/utils/align.d.ts.map +1 -1
- package/out/utils/align.js +5 -5
- package/out/utils/align.js.map +1 -1
- package/out/utils/golden.js +2 -2
- package/out/utils/golden.js.map +1 -1
- package/out/utils/license.d.ts +3 -3
- package/out/utils/license.d.ts.map +1 -1
- package/out/utils/license.js.map +1 -1
- package/out/utils/split.d.ts +1 -1
- package/out/utils/split.d.ts.map +1 -1
- package/out/utils/split.js +18 -14
- package/out/utils/split.js.map +1 -1
- package/out/utils/tokenize.d.ts +3 -20
- package/out/utils/tokenize.d.ts.map +1 -1
- package/out/utils/tokenize.js.map +1 -1
- package/out/utils/wof-json.js +3 -3
- package/out/utils/wof-json.js.map +1 -1
- package/package.json +18 -27
- package/lib/tools.ts +0 -31
- package/out/synthesizers/intersection.d.ts.map +0 -1
- package/out/synthesizers/intersection.js.map +0 -1
- package/out/synthesizers/street.d.ts.map +0 -1
- package/out/synthesizers/street.js.map +0 -1
- package/out/tools.d.ts +0 -31
- package/out/tools.d.ts.map +0 -1
- package/out/tools.js +0 -31
- package/out/tools.js.map +0 -1
- /package/out/{synthesizers → us/synthesizers}/intersection.d.ts +0 -0
package/lib/inspire/address.ts
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
* without regard to case, and accept either form of a coded value.
|
|
28
28
|
*
|
|
29
29
|
* So this module exposes the primitives and leaves composition to each adapter. A configuration
|
|
30
|
-
* object describing those
|
|
31
|
-
*
|
|
30
|
+
* object describing those axes would state claims about files no one has read. These small
|
|
31
|
+
* functions state none.
|
|
32
32
|
*
|
|
33
33
|
* The reference form is the exception, because its shapes are enumerable and measured:
|
|
34
34
|
* {@linkcode componentJoinKey} reads all four.
|
|
@@ -44,39 +44,40 @@ import type { MarkupElement } from "@mailwoman/core/html/elements"
|
|
|
44
44
|
*
|
|
45
45
|
* The Dirección General del Catastro and the Gobierno de Navarra bind the same
|
|
46
46
|
* two namespaces to `AD:` and `GN:`.
|
|
47
|
-
*
|
|
48
|
-
* nor a postcode in either Spanish file.
|
|
47
|
+
* An exact comparison finds neither a locator, a street nor a postcode in either Spanish file.
|
|
49
48
|
*
|
|
50
|
-
* That reads as an address
|
|
49
|
+
* That reads as an address with none of those rather than as an unfamiliar prefix.
|
|
51
50
|
*
|
|
52
|
-
* The prefix is still compared, because it
|
|
51
|
+
* The prefix is still compared, because it identifies the namespace and the namespace holds the meaning.
|
|
53
52
|
* The Service public de Wallonie writes three `gml:name` elements inside each
|
|
54
53
|
* `ad:ThoroughfareName`, ahead of the `ad:name` that holds the street.
|
|
55
54
|
*
|
|
56
|
-
* A reader that dropped the prefix and matched on `name`
|
|
57
|
-
*
|
|
55
|
+
* A reader that dropped the prefix and matched only on `name` read the first of those three,
|
|
56
|
+
* so it found no street on any of Wallonia's 58,591 thoroughfare features.
|
|
58
57
|
*/
|
|
59
58
|
export function inspireNameIs(name: string, wanted: string): boolean {
|
|
60
59
|
return name.toLowerCase() === wanted.toLowerCase()
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
/**
|
|
64
|
-
* The first child of `element`
|
|
63
|
+
* The first child of `element` whose name matches `name`, ignoring case.
|
|
65
64
|
*
|
|
66
|
-
* `name`
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
65
|
+
* Write `name` with the prefix the INSPIRE guideline uses.
|
|
66
|
+
* Eight of the nine publishers use it.
|
|
67
|
+
*
|
|
68
|
+
* The case-insensitive sibling of `childElement` from `@mailwoman/core/html/elements`.
|
|
69
|
+
* That
|
|
70
|
+
* function compares the name exactly, as a general markup reader must.
|
|
70
71
|
*/
|
|
71
|
-
export function inspireChild(element: MarkupElement, name: string): MarkupElement |
|
|
72
|
-
return element.children.find((child) => inspireNameIs(child.name, name))
|
|
72
|
+
export function inspireChild(element: MarkupElement, name: string): MarkupElement | null {
|
|
73
|
+
return element.children.find((child) => inspireNameIs(child.name, name)) ?? null
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
/**
|
|
76
|
-
* Every child of `element`
|
|
77
|
+
* Every child of `element` whose name matches `name`, in document order, ignoring case.
|
|
77
78
|
*
|
|
78
79
|
* The case-insensitive sibling of `childElements` from `@mailwoman/core/html/elements`,
|
|
79
|
-
* for the same reason {@linkcode inspireChild}
|
|
80
|
+
* for the same reason {@linkcode inspireChild} exists.
|
|
80
81
|
*/
|
|
81
82
|
export function inspireChildren(element: MarkupElement, name: string): readonly MarkupElement[] {
|
|
82
83
|
return element.children.filter((child) => inspireNameIs(child.name, name))
|
|
@@ -89,11 +90,11 @@ export function inspireChildren(element: MarkupElement, name: string): readonly
|
|
|
89
90
|
* An INSPIRE value sits five or six elements down, so the path form reads better than
|
|
90
91
|
* a chain of {@linkcode inspireChild} calls and reports the same absence.
|
|
91
92
|
*/
|
|
92
|
-
export function inspireElementAt(element: MarkupElement, ...path: readonly string[]): MarkupElement |
|
|
93
|
-
let current: MarkupElement |
|
|
93
|
+
export function inspireElementAt(element: MarkupElement, ...path: readonly string[]): MarkupElement | null {
|
|
94
|
+
let current: MarkupElement | null = element
|
|
94
95
|
|
|
95
96
|
for (const step of path) {
|
|
96
|
-
if (!current) return
|
|
97
|
+
if (!current) return null
|
|
97
98
|
|
|
98
99
|
current = inspireChild(current, step)
|
|
99
100
|
}
|
|
@@ -102,20 +103,21 @@ export function inspireElementAt(element: MarkupElement, ...path: readonly strin
|
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
/**
|
|
105
|
-
* The final segment of an INSPIRE codelist URI
|
|
106
|
+
* The final segment of an INSPIRE codelist URI.
|
|
107
|
+
* That segment is the value's name.
|
|
106
108
|
*
|
|
107
109
|
* `http://inspire.ec.europa.eu/codelist/LocatorDesignatorTypeValue/buildingIdentifier`
|
|
108
110
|
* reads `buildingIdentifier`.
|
|
109
111
|
* A `#` fragment is dropped first, because Flanders appends one to a `vocab.belgif.be`
|
|
110
112
|
* reference and Czechia folds it into `base:localId`.
|
|
111
113
|
*/
|
|
112
|
-
export function codelistValue(uri: string | undefined): string |
|
|
113
|
-
if (!uri) return
|
|
114
|
+
export function codelistValue(uri: string | null | undefined): string | null {
|
|
115
|
+
if (!uri) return null
|
|
114
116
|
|
|
115
117
|
const withoutFragment = uri.split("#")[0]!
|
|
116
118
|
const segment = withoutFragment.split("/").pop()
|
|
117
119
|
|
|
118
|
-
return segment ||
|
|
120
|
+
return segment || null
|
|
119
121
|
}
|
|
120
122
|
|
|
121
123
|
/**
|
|
@@ -123,25 +125,27 @@ export function codelistValue(uri: string | undefined): string | undefined {
|
|
|
123
125
|
*
|
|
124
126
|
* INSPIRE writes `xsi:nil="true"` and usually a `nilReason`.
|
|
125
127
|
* Brussels writes the nil marker and no reason on all 232,003 of its void `ad:validFrom`
|
|
126
|
-
* elements, and Czechia writes four `gn:pronunciation` elements nil with no reason
|
|
127
|
-
*
|
|
128
|
+
* elements, and Czechia writes four `gn:pronunciation` elements nil with no reason.
|
|
129
|
+
*
|
|
130
|
+
* A reader that keys only on `nilReason` mistakes a void value for a populated one.
|
|
128
131
|
*
|
|
129
132
|
* An absent element answers false, so a caller distinguishes a void value from a missing one.
|
|
130
133
|
*/
|
|
131
|
-
export function isVoid(element: MarkupElement |
|
|
134
|
+
export function isVoid(element: MarkupElement | null): boolean {
|
|
132
135
|
return element?.attributes["xsi:nil"] === "true"
|
|
133
136
|
}
|
|
134
137
|
|
|
135
138
|
/**
|
|
136
139
|
* The reason a publisher gave for a void element, as a codelist value such as `Unpopulated`.
|
|
137
140
|
*
|
|
138
|
-
* Returns
|
|
139
|
-
* schema permits and
|
|
140
|
-
*
|
|
141
|
-
*
|
|
141
|
+
* Returns null when the element is void and states no reason.
|
|
142
|
+
* The schema permits that form, and Brussels uses it throughout.
|
|
143
|
+
*
|
|
144
|
+
* A caller that needs to separate a void with a reason from a void with none
|
|
145
|
+
* reads this together with {@linkcode isVoid}.
|
|
142
146
|
*/
|
|
143
|
-
export function voidReason(element: MarkupElement |
|
|
144
|
-
if (!isVoid(element)) return
|
|
147
|
+
export function voidReason(element: MarkupElement | null): string | null {
|
|
148
|
+
if (!isVoid(element)) return null
|
|
145
149
|
|
|
146
150
|
return codelistValue(element?.attributes.nilReason)
|
|
147
151
|
}
|
|
@@ -149,17 +153,19 @@ export function voidReason(element: MarkupElement | undefined): string | undefin
|
|
|
149
153
|
/**
|
|
150
154
|
* Every locator designator on an address, keyed by its INSPIRE type name.
|
|
151
155
|
*
|
|
152
|
-
* One `ad:AddressLocator`
|
|
153
|
-
*
|
|
156
|
+
* One `ad:AddressLocator` holds a designator per part of the number, each in its own
|
|
157
|
+
* `ad:LocatorDesignator` beside an `ad:type` that states what it is.
|
|
154
158
|
* Czechia writes two, `č.ev.` typed `buildingIdentifierPrefix` and `502` typed `buildingIdentifier`.
|
|
155
159
|
*
|
|
156
160
|
* The Netherlands writes four, including an empty `LocatorDesignatorTypeValue/addressNumberExtension`
|
|
157
161
|
* and the postcode as `LocatorDesignatorTypeValue/postalDeliveryIdentifier`.
|
|
158
162
|
*
|
|
159
163
|
* A type may repeat, so each key holds a list in document order.
|
|
160
|
-
* A designator the publisher wrote empty contributes an empty string
|
|
161
|
-
*
|
|
162
|
-
*
|
|
164
|
+
* A designator the publisher wrote empty contributes an empty string.
|
|
165
|
+
*
|
|
166
|
+
* That string is a value the publisher stated rather than one it omitted.
|
|
167
|
+
* The Netherlands writes `<ad:designator/>` 198,118 times over 108,708 features to
|
|
168
|
+
* mean "no extension", and that condition differs from void.
|
|
163
169
|
*
|
|
164
170
|
* A designator whose `ad:type` is absent or void is skipped, because its value cannot be placed.
|
|
165
171
|
*/
|
|
@@ -216,7 +222,7 @@ export function designatorsByType(address: MarkupElement): ReadonlyMap<string, r
|
|
|
216
222
|
* value has to be reported rather than turned into an absence.
|
|
217
223
|
*
|
|
218
224
|
* A caller reads this when the difference changes what it does.
|
|
219
|
-
* An adapter that refuses a row
|
|
225
|
+
* An adapter that refuses a row with no house number should report a void `buildingIdentifier` as
|
|
220
226
|
* a value it could not read, and an absent one as an address the publisher states has no number.
|
|
221
227
|
*/
|
|
222
228
|
export function voidDesignatorTypes(address: MarkupElement): ReadonlySet<string> {
|
|
@@ -235,20 +241,18 @@ export function voidDesignatorTypes(address: MarkupElement): ReadonlySet<string>
|
|
|
235
241
|
if (!value || !isVoid(value)) continue
|
|
236
242
|
|
|
237
243
|
const type = inspireChild(locatorDesignator, "ad:type")
|
|
238
|
-
const name = type && !isVoid(type) ? (codelistValue(type.attributes["xlink:href"]) ?? type.text) :
|
|
244
|
+
const name = type && !isVoid(type) ? (codelistValue(type.attributes["xlink:href"]) ?? type.text) : null
|
|
239
245
|
|
|
240
|
-
// A void value whose own type is void or absent cannot be placed,
|
|
241
|
-
//
|
|
246
|
+
// A void value whose own type is void or absent cannot be placed,
|
|
247
|
+
// so it is reported under the empty name.
|
|
248
|
+
// That keeps the address's unreadable parts countable.
|
|
242
249
|
voided.add(name || "")
|
|
243
250
|
}
|
|
244
251
|
|
|
245
252
|
return voided
|
|
246
253
|
}
|
|
247
254
|
|
|
248
|
-
export function designator(
|
|
249
|
-
byType: ReadonlyMap<string, readonly string[]>,
|
|
250
|
-
...types: readonly string[]
|
|
251
|
-
): string | undefined {
|
|
255
|
+
export function designator(byType: ReadonlyMap<string, readonly string[]>, ...types: readonly string[]): string | null {
|
|
252
256
|
for (const type of types) {
|
|
253
257
|
for (const value of byType.get(type) ?? []) {
|
|
254
258
|
const trimmed = value.trim()
|
|
@@ -257,7 +261,7 @@ export function designator(
|
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
|
|
260
|
-
return
|
|
264
|
+
return null
|
|
261
265
|
}
|
|
262
266
|
|
|
263
267
|
/**
|
|
@@ -266,8 +270,10 @@ export function designator(
|
|
|
266
270
|
* The href is returned verbatim, and {@linkcode componentJoinKey} turns it into a join key.
|
|
267
271
|
* A component whose href is absent or empty is skipped.
|
|
268
272
|
*
|
|
269
|
-
* Brussels writes `<ad:component xlink:href=""/>` on 9 addresses
|
|
270
|
-
*
|
|
273
|
+
* Brussels writes `<ad:component xlink:href=""/>` on 9 addresses.
|
|
274
|
+
* Those 9 hold no postal zone.
|
|
275
|
+
*
|
|
276
|
+
* A caller must report that rather than read a resolved component.
|
|
271
277
|
*/
|
|
272
278
|
export function componentHrefs(address: MarkupElement): readonly string[] {
|
|
273
279
|
return componentLinks(address).map((link) => link.href)
|
|
@@ -283,9 +289,9 @@ export interface ComponentLink {
|
|
|
283
289
|
readonly href: string
|
|
284
290
|
|
|
285
291
|
/**
|
|
286
|
-
* The `xlink:title`, or
|
|
292
|
+
* The `xlink:title`, or null where the reference has no title.
|
|
287
293
|
*/
|
|
288
|
-
readonly title
|
|
294
|
+
readonly title: string | null
|
|
289
295
|
}
|
|
290
296
|
|
|
291
297
|
/**
|
|
@@ -299,7 +305,7 @@ export interface ComponentLink {
|
|
|
299
305
|
* and an administrative-unit reference addresses a CartoCiudad stored query.
|
|
300
306
|
*
|
|
301
307
|
* The title is the only statement of the street name, the postcode and the place names
|
|
302
|
-
*
|
|
308
|
+
* in its own file, so its adapter reads titles and resolves no reference.
|
|
303
309
|
*
|
|
304
310
|
* A component whose href is absent or empty is skipped, as in {@linkcode componentHrefs}.
|
|
305
311
|
*/
|
|
@@ -313,17 +319,17 @@ export function componentLinks(address: MarkupElement): readonly ComponentLink[]
|
|
|
313
319
|
|
|
314
320
|
const title = component.attributes["xlink:title"]?.trim()
|
|
315
321
|
|
|
316
|
-
links.push(
|
|
322
|
+
links.push({ href, title: title || null })
|
|
317
323
|
}
|
|
318
324
|
|
|
319
325
|
return links
|
|
320
326
|
}
|
|
321
327
|
|
|
322
328
|
/**
|
|
323
|
-
* The query parameters a WFS stored-query reference
|
|
329
|
+
* The query parameters that hold a WFS stored-query reference's feature id.
|
|
324
330
|
*
|
|
325
|
-
* Each publisher picked a spelling, and the match below ignores case,
|
|
326
|
-
* and Slovakia's `id` both resolve
|
|
331
|
+
* Each publisher picked a spelling, and the match below ignores case,
|
|
332
|
+
* so Czechia's `Id` and Slovakia's `id` both resolve.
|
|
327
333
|
* A reader that knew only `id` returned Czechia's whole URL as the key, and no `gml:id`
|
|
328
334
|
* equals a URL, so all 5,460 of one municipality's references read as unjoinable.
|
|
329
335
|
*/
|
|
@@ -342,30 +348,32 @@ const REFERENCE_ID_PARAMETERS = new Set(["id", "featureid", "resourceid"])
|
|
|
342
348
|
* | Slovakia | `…ad/ows?…&id=AdminUnitName.15345` | `AdminUnitName.15345` |
|
|
343
349
|
* | Flanders | `https://data.vlaanderen.be/id/straatnaam/6301` | the URI itself |
|
|
344
350
|
*
|
|
345
|
-
* A URI with no id parameter is its own key
|
|
346
|
-
*
|
|
351
|
+
* A URI with no id parameter is its own key.
|
|
352
|
+
* Flanders publishes that form on both sides of the join.
|
|
353
|
+
*
|
|
354
|
+
* Its fragment is dropped, because a reference may hold one where the identifier does not:
|
|
347
355
|
* `http://vocab.belgif.be/auth/refnis1995/1000#id` addresses the same term as that URI without it.
|
|
348
356
|
*
|
|
349
357
|
* Whether a key joins is not a property of its spelling, so this reads a key
|
|
350
358
|
* and the caller decides joinability against the features the publisher actually served.
|
|
351
|
-
*
|
|
352
|
-
*
|
|
359
|
+
* A check based on the URL's shape once reported 15 of Flanders' 20 references as belonging
|
|
360
|
+
* to another register, when every one of them addressed a feature of the same service.
|
|
353
361
|
*
|
|
354
|
-
* @returns The key, or
|
|
362
|
+
* @returns The key, or null when the href is neither a fragment nor a URL.
|
|
355
363
|
*/
|
|
356
|
-
export function componentJoinKey(href: string): string |
|
|
364
|
+
export function componentJoinKey(href: string): string | null {
|
|
357
365
|
const trimmed = href.trim()
|
|
358
366
|
|
|
359
|
-
if (!trimmed) return
|
|
367
|
+
if (!trimmed) return null
|
|
360
368
|
|
|
361
|
-
if (trimmed.startsWith("#")) return trimmed.slice(1) ||
|
|
369
|
+
if (trimmed.startsWith("#")) return trimmed.slice(1) || null
|
|
362
370
|
|
|
363
371
|
let url: URL
|
|
364
372
|
|
|
365
373
|
try {
|
|
366
374
|
url = new URL(trimmed)
|
|
367
375
|
} catch {
|
|
368
|
-
return
|
|
376
|
+
return null
|
|
369
377
|
}
|
|
370
378
|
|
|
371
379
|
for (const [parameter, value] of url.searchParams) {
|
|
@@ -382,7 +390,7 @@ export function componentJoinKey(href: string): string | undefined {
|
|
|
382
390
|
}
|
|
383
391
|
|
|
384
392
|
/**
|
|
385
|
-
* The spelling a `gn:GeographicalName`
|
|
393
|
+
* The spelling a `gn:GeographicalName` holds, reached from a feature that has one.
|
|
386
394
|
*
|
|
387
395
|
* Every name-bearing INSPIRE feature nests the text at
|
|
388
396
|
* `…/gn:GeographicalName/gn:spelling/gn:SpellingOfName/gn:text`, under a per-feature
|
|
@@ -390,9 +398,9 @@ export function componentJoinKey(href: string): string | undefined {
|
|
|
390
398
|
* while an `ad:AdminUnitName` and an `ad:AddressAreaName` add only `ad:name`.
|
|
391
399
|
* The caller gives the prefix.
|
|
392
400
|
*
|
|
393
|
-
* @returns The text, or
|
|
401
|
+
* @returns The text, or null when any step is absent or the name is void.
|
|
394
402
|
*/
|
|
395
|
-
export function geographicalNameText(feature: MarkupElement, ...prefix: readonly string[]): string |
|
|
403
|
+
export function geographicalNameText(feature: MarkupElement, ...prefix: readonly string[]): string | null {
|
|
396
404
|
const name = inspireElementAt(
|
|
397
405
|
feature,
|
|
398
406
|
...prefix,
|
|
@@ -402,24 +410,24 @@ export function geographicalNameText(feature: MarkupElement, ...prefix: readonly
|
|
|
402
410
|
"gn:text"
|
|
403
411
|
)
|
|
404
412
|
|
|
405
|
-
if (!name || isVoid(name)) return
|
|
413
|
+
if (!name || isVoid(name)) return null
|
|
406
414
|
|
|
407
415
|
const text = name.text.trim()
|
|
408
416
|
|
|
409
|
-
return text ||
|
|
417
|
+
return text || null
|
|
410
418
|
}
|
|
411
419
|
|
|
412
420
|
/**
|
|
413
421
|
* The street name an `ad:ThoroughfareName` feature states.
|
|
414
422
|
*/
|
|
415
|
-
export function thoroughfareName(feature: MarkupElement): string |
|
|
423
|
+
export function thoroughfareName(feature: MarkupElement): string | null {
|
|
416
424
|
return geographicalNameText(feature, "ad:name", "ad:ThoroughfareNameValue", "ad:name")
|
|
417
425
|
}
|
|
418
426
|
|
|
419
427
|
/**
|
|
420
428
|
* The place name an `ad:AdminUnitName` or `ad:AddressAreaName` feature states.
|
|
421
429
|
*/
|
|
422
|
-
export function placeName(feature: MarkupElement): string |
|
|
430
|
+
export function placeName(feature: MarkupElement): string | null {
|
|
423
431
|
return geographicalNameText(feature, "ad:name")
|
|
424
432
|
}
|
|
425
433
|
|
|
@@ -430,14 +438,14 @@ export function placeName(feature: MarkupElement): string | undefined {
|
|
|
430
438
|
* Left-padding belongs to the caller that knows the jurisdiction's width,
|
|
431
439
|
* because this reader returns what the publisher wrote.
|
|
432
440
|
*/
|
|
433
|
-
export function postalDescriptorCode(feature: MarkupElement): string |
|
|
441
|
+
export function postalDescriptorCode(feature: MarkupElement): string | null {
|
|
434
442
|
const code = inspireChild(feature, "ad:postCode")
|
|
435
443
|
|
|
436
|
-
if (!code || isVoid(code)) return
|
|
444
|
+
if (!code || isVoid(code)) return null
|
|
437
445
|
|
|
438
446
|
const text = code.text.trim()
|
|
439
447
|
|
|
440
|
-
return text ||
|
|
448
|
+
return text || null
|
|
441
449
|
}
|
|
442
450
|
|
|
443
451
|
/**
|
|
@@ -448,10 +456,10 @@ export function postalDescriptorCode(feature: MarkupElement): string | undefined
|
|
|
448
456
|
* publishes exactly one `ad:AdminUnitName` feature, the country.
|
|
449
457
|
* A caller picks the finest level it wants by this value rather than by the order the references appear.
|
|
450
458
|
*/
|
|
451
|
-
export function adminUnitLevel(feature: MarkupElement): string |
|
|
459
|
+
export function adminUnitLevel(feature: MarkupElement): string | null {
|
|
452
460
|
const level = inspireChild(feature, "ad:level")
|
|
453
461
|
|
|
454
|
-
if (!level || isVoid(level)) return
|
|
462
|
+
if (!level || isVoid(level)) return null
|
|
455
463
|
|
|
456
|
-
return codelistValue(level.attributes["xlink:href"]) ?? (level.text.trim() ||
|
|
464
|
+
return codelistValue(level.attributes["xlink:href"]) ?? (level.text.trim() || null)
|
|
457
465
|
}
|
package/lib/inspire/errors.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* An `ad:Address` states its street, its postcode and its place names by reference, and states the
|
|
9
9
|
* parts of its number as typed designators. Both forms can hold a value the reader asked for and
|
|
10
10
|
* could not read: a reference whose target the service never served, and a designator the publisher
|
|
11
|
-
* marked `xsi:nil`.
|
|
12
|
-
*
|
|
11
|
+
* marked `xsi:nil`. An empty component for either would publish an address the publisher did not
|
|
12
|
+
* state, so each raises and names what it could not read.
|
|
13
13
|
*
|
|
14
14
|
* The errors live beside {@linkcode "#inspire/address"} because every publisher of this theme writes
|
|
15
15
|
* both forms, so an adapter for the next one reports the same two conditions in the same words.
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* unresolved reference and an absent one are the same observation.
|
|
28
28
|
*/
|
|
29
29
|
export class UnresolvedComponentReferenceError extends Error {
|
|
30
|
-
constructor(adapterID: string, addressID: string |
|
|
30
|
+
constructor(adapterID: string, addressID: string | null, href: string) {
|
|
31
31
|
super(
|
|
32
32
|
`${adapterID} adapter: address ${addressID ?? "(no gml:id)"} carries ad:component xlink:href="${href}", which resolves to no feature`
|
|
33
33
|
)
|
|
@@ -44,7 +44,7 @@ export class UnresolvedComponentReferenceError extends Error {
|
|
|
44
44
|
* `voidDesignatorTypes` separates them, and this error reports the first case.
|
|
45
45
|
*/
|
|
46
46
|
export class VoidDesignatorError extends Error {
|
|
47
|
-
constructor(adapterID: string, addressID: string |
|
|
47
|
+
constructor(adapterID: string, addressID: string | null, type: string) {
|
|
48
48
|
super(`${adapterID} adapter: address ${addressID ?? "(no gml:id)"} marks its ${type} designator void`)
|
|
49
49
|
|
|
50
50
|
this.name = "VoidDesignatorError"
|
|
@@ -55,11 +55,12 @@ export class VoidDesignatorError extends Error {
|
|
|
55
55
|
* Raised when a publication's archive cannot answer what the adapter asked it for.
|
|
56
56
|
*
|
|
57
57
|
* An archive holding no component feature is not a smaller publication.
|
|
58
|
-
* Every address references a fixed set of components, so an empty index turns
|
|
59
|
-
*
|
|
60
|
-
* absence the repository's partial-read rule refuses.
|
|
58
|
+
* Every address references a fixed set of components, so an empty index turns each
|
|
59
|
+
* row into a row with no street rather than into fewer rows.
|
|
61
60
|
*
|
|
62
|
-
*
|
|
61
|
+
* That is the absence the repository's partial-read rule refuses.
|
|
62
|
+
*
|
|
63
|
+
* The adapter id records which publisher failed, so one class serves every
|
|
63
64
|
* publisher that ships its theme as one archive.
|
|
64
65
|
*/
|
|
65
66
|
export class InspireArchiveError extends Error {
|
package/lib/inspire/stream.ts
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*
|
|
9
9
|
* A publisher shipping the Addresses theme as one document writes an `ad:Address` beside the
|
|
10
10
|
* `ad:ThoroughfareName`, `ad:PostalDescriptor` and place-name features it references, and the order
|
|
11
|
-
* is the publisher's own. Czechia interleaves them per municipality, and the Netherlands writes
|
|
12
|
-
*
|
|
11
|
+
* is the publisher's own. Czechia interleaves them per municipality, and the Netherlands writes its
|
|
12
|
+
* reference features before its first address.
|
|
13
13
|
*
|
|
14
|
-
* Either way a reader has to index as it goes, because a
|
|
14
|
+
* Either way a reader has to index as it goes, because a 32 GB document cannot be read twice from
|
|
15
15
|
* one stream and the references are local. An address naming a feature the pass has not reached yet
|
|
16
16
|
* is held rather than refused, since until the document ends an unresolved reference and an absent
|
|
17
17
|
* one are the same observation. That distinction is what the repository's partial-read rule turns on.
|
|
@@ -22,10 +22,8 @@
|
|
|
22
22
|
*
|
|
23
23
|
* A publisher that writes every reference *after* its addresses needs the opposite of holding, and
|
|
24
24
|
* {@linkcode streamIndexedInspireRows} serves it. The Dirección General del Catastro and the
|
|
25
|
-
* Diputación Foral de Gipuzkoa both do
|
|
26
|
-
* the
|
|
27
|
-
* 313,162,472. Holding would mean holding every address. That is 68,744 subtrees for Gipuzkoa and
|
|
28
|
-
* the whole of Madrid for Catastro, so those two read the member twice and index first.
|
|
25
|
+
* Diputación Foral de Gipuzkoa both do, so holding would leave every address pending. Those two
|
|
26
|
+
* read the member twice and index first.
|
|
29
27
|
*/
|
|
30
28
|
|
|
31
29
|
import type { MarkupElement } from "@mailwoman/core/html/elements"
|
|
@@ -37,12 +35,13 @@ import type { CanonicalRow } from "#types"
|
|
|
37
35
|
* What a {@linkcode ComposeInspireRow} callback answers for one address.
|
|
38
36
|
*
|
|
39
37
|
* A row is emitted.
|
|
40
|
-
* `
|
|
38
|
+
* `null` refuses the address.
|
|
39
|
+
* The caller counts each refusal.
|
|
41
40
|
*
|
|
42
|
-
* `deferred` states that the address
|
|
41
|
+
* `deferred` states that the address holds a reference the pass has not indexed yet,
|
|
43
42
|
* so the driver holds it and asks again once the document has ended.
|
|
44
43
|
*/
|
|
45
|
-
export type InspireRowResult = CanonicalRow |
|
|
44
|
+
export type InspireRowResult = CanonicalRow | null | "deferred"
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* Builds one row from an address and the references indexed so far.
|
|
@@ -70,30 +69,33 @@ export interface StreamInspireRowsOptions<Indexed> {
|
|
|
70
69
|
chunks: AsyncIterable<string | Uint8Array>
|
|
71
70
|
|
|
72
71
|
/**
|
|
73
|
-
* The element each address is written as
|
|
72
|
+
* The element each address is written as.
|
|
73
|
+
* Every INSPIRE publisher spells it `ad:Address`.
|
|
74
74
|
*/
|
|
75
75
|
addressElement?: string
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* The elements an address references
|
|
78
|
+
* The elements an address references.
|
|
79
|
+
* The reader indexes them as they arrive.
|
|
79
80
|
*/
|
|
80
81
|
componentElements: readonly string[]
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
84
|
* What to index a referenced feature under.
|
|
84
85
|
*
|
|
85
|
-
* The default is its `gml:id`, which is what a local `#` fragment
|
|
86
|
-
* and a stored-query `Id` parameter both name.
|
|
87
86
|
* A feature carrying no key is skipped, because an address cannot reference it.
|
|
87
|
+
*
|
|
88
|
+
* @defaultValue its `gml:id`, which is what a local `#` fragment
|
|
89
|
+
* and a stored-query `Id` parameter both name.
|
|
88
90
|
*/
|
|
89
|
-
key?: (feature: MarkupElement) => string |
|
|
91
|
+
key?: (feature: MarkupElement) => string | null
|
|
90
92
|
|
|
91
93
|
/**
|
|
92
94
|
* What to keep per referenced feature.
|
|
93
95
|
*
|
|
94
96
|
* Czechia keeps the subtree, because it reads several values off one feature.
|
|
95
|
-
* The Netherlands keeps the one string it needs
|
|
96
|
-
* rather than 300,318 subtrees.
|
|
97
|
+
* The Netherlands keeps the one string it needs.
|
|
98
|
+
* That holds 300,318 strings rather than 300,318 subtrees.
|
|
97
99
|
*/
|
|
98
100
|
index: (feature: MarkupElement) => Indexed
|
|
99
101
|
|
|
@@ -116,15 +118,15 @@ export interface StreamInspireRowsOptions<Indexed> {
|
|
|
116
118
|
/**
|
|
117
119
|
* The default key a referenced feature is indexed under.
|
|
118
120
|
*/
|
|
119
|
-
function gmlID(feature: MarkupElement): string |
|
|
120
|
-
return feature.attributes["gml:id"]
|
|
121
|
+
function gmlID(feature: MarkupElement): string | null {
|
|
122
|
+
return feature.attributes["gml:id"] ?? null
|
|
121
123
|
}
|
|
122
124
|
|
|
123
125
|
/**
|
|
124
126
|
* The rows one document holds, in the order the publisher wrote its addresses.
|
|
125
127
|
*
|
|
126
128
|
* A held address is answered after the document ends, so those rows arrive last.
|
|
127
|
-
* That reorders a publisher's output and changes no row, because each row
|
|
129
|
+
* That reorders a publisher's output and changes no row, because each row holds its own `source_id`.
|
|
128
130
|
*/
|
|
129
131
|
export async function* streamInspireRows<Indexed>(
|
|
130
132
|
options: StreamInspireRowsOptions<Indexed>
|
|
@@ -181,8 +183,8 @@ export async function* streamInspireRows<Indexed>(
|
|
|
181
183
|
|
|
182
184
|
const row = options.compose(element, referenced, true)
|
|
183
185
|
|
|
184
|
-
// `deferred` after the document ended is a caller that ignored `final
|
|
185
|
-
//
|
|
186
|
+
// `deferred` after the document ended is a caller that ignored `final`.
|
|
187
|
+
// The row is refused, because holding it again would never terminate.
|
|
186
188
|
if (!row || row === "deferred") continue
|
|
187
189
|
|
|
188
190
|
yield row
|
|
@@ -204,8 +206,9 @@ export interface StreamIndexedInspireRowsOptions<Indexed> extends Omit<
|
|
|
204
206
|
* Called once per pass, so it must deliver the same bytes each time.
|
|
205
207
|
*
|
|
206
208
|
* A factory rather than an iterable, because a byte stream is consumed by the first pass.
|
|
207
|
-
* `inspireGMLChunks` inflates the archive member again
|
|
208
|
-
*
|
|
209
|
+
* `inspireGMLChunks` inflates the archive member again.
|
|
210
|
+
*
|
|
211
|
+
* That is what makes the second pass cheap relative to holding every address.
|
|
209
212
|
*/
|
|
210
213
|
chunks: () => AsyncIterable<string | Uint8Array>
|
|
211
214
|
|
|
@@ -216,7 +219,7 @@ export interface StreamIndexedInspireRowsOptions<Indexed> extends Omit<
|
|
|
216
219
|
* so a reference resolving to no feature is a value the reader asked for and could not read.
|
|
217
220
|
* The caller raises on one rather than writing the address without it.
|
|
218
221
|
*/
|
|
219
|
-
compose: (address: MarkupElement, referenced: ReadonlyMap<string, Indexed>) => CanonicalRow |
|
|
222
|
+
compose: (address: MarkupElement, referenced: ReadonlyMap<string, Indexed>) => CanonicalRow | null
|
|
220
223
|
}
|
|
221
224
|
|
|
222
225
|
/**
|
|
@@ -224,7 +227,7 @@ export interface StreamIndexedInspireRowsOptions<Indexed> extends Omit<
|
|
|
224
227
|
*
|
|
225
228
|
* The first pass reads only the component elements and the second only the addresses,
|
|
226
229
|
* so the resident set is the index rather than the addresses.
|
|
227
|
-
* The rows arrive in the publisher's own order
|
|
230
|
+
* The rows arrive in the publisher's own order. {@linkcode streamInspireRows}
|
|
228
231
|
* cannot promise because it answers a held address last.
|
|
229
232
|
*/
|
|
230
233
|
export async function* streamIndexedInspireRows<Indexed>(
|
|
@@ -230,7 +230,7 @@ export async function readTuples(part: LocalePart, rng: () => number): Promise<L
|
|
|
230
230
|
for await (const cells of CSVSpliterator.fromAsync<string[]>(input, {
|
|
231
231
|
header: false,
|
|
232
232
|
})) {
|
|
233
|
-
if (header
|
|
233
|
+
if (!header) {
|
|
234
234
|
header = cells.map((h) => h.toLowerCase())
|
|
235
235
|
// oxlint-disable-next-line no-loop-func -- the binding is per-iteration (for-of/for-await) and the batch is awaited before the next
|
|
236
236
|
const ix = (name: string): number => header!.indexOf(name)
|
|
@@ -259,7 +259,7 @@ export async function readTuples(part: LocalePart, rng: () => number): Promise<L
|
|
|
259
259
|
continue
|
|
260
260
|
}
|
|
261
261
|
|
|
262
|
-
if (cols
|
|
262
|
+
if (!cols) continue
|
|
263
263
|
|
|
264
264
|
// Raw CNIG splits the road type from the street name, so the two are joined here.
|
|
265
265
|
const street =
|
|
@@ -272,7 +272,7 @@ export async function readTuples(part: LocalePart, rng: () => number): Promise<L
|
|
|
272
272
|
if (!street) continue
|
|
273
273
|
|
|
274
274
|
let locality: string | null
|
|
275
|
-
let dependent_locality: string |
|
|
275
|
+
let dependent_locality: string | null = null
|
|
276
276
|
|
|
277
277
|
if (part.districtAsLocality) {
|
|
278
278
|
const rawDistrict = get(cells, cols.district)
|
|
@@ -289,7 +289,7 @@ export async function readTuples(part: LocalePart, rng: () => number): Promise<L
|
|
|
289
289
|
dependent_locality =
|
|
290
290
|
cleanedCity && cleanedCity.localeCompare(locality, undefined, { sensitivity: "base" }) !== 0
|
|
291
291
|
? cleanedCity
|
|
292
|
-
:
|
|
292
|
+
: null
|
|
293
293
|
} else {
|
|
294
294
|
locality = cleanCityNoise(rawCity)
|
|
295
295
|
}
|
|
@@ -368,15 +368,15 @@ export function applyCountryAppend(
|
|
|
368
368
|
* Applies the per-run `districtAsLocality` override to a part.
|
|
369
369
|
* An unset override returns the part unchanged.
|
|
370
370
|
*/
|
|
371
|
-
export function applyDistrictAsLocalityOverride(part: LocalePart, override: boolean |
|
|
372
|
-
return override ===
|
|
371
|
+
export function applyDistrictAsLocalityOverride(part: LocalePart, override: boolean | null): LocalePart {
|
|
372
|
+
return override === null ? part : { ...part, districtAsLocality: override }
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
/**
|
|
376
376
|
* Returns the country's `pedaniaParts` when the override is true and that property exists.
|
|
377
377
|
* Returns the default parts in all other cases.
|
|
378
378
|
*/
|
|
379
|
-
export function resolveLocaleParts(countrySource: LocaleCountrySource, override: boolean |
|
|
379
|
+
export function resolveLocaleParts(countrySource: LocaleCountrySource, override: boolean | null): LocalePart[] {
|
|
380
380
|
return override === true && countrySource.pedaniaParts ? countrySource.pedaniaParts : countrySource.parts
|
|
381
381
|
}
|
|
382
382
|
|
|
@@ -432,7 +432,7 @@ export const localeRecipe: CorpusRecipe = {
|
|
|
432
432
|
const count = opts.count ?? 4000
|
|
433
433
|
// When unset, each part keeps its own setting.
|
|
434
434
|
// True also selects the ES pedanía parts.
|
|
435
|
-
const districtAsLocalityOverride = opts.districtAsLocality
|
|
435
|
+
const districtAsLocalityOverride = opts.districtAsLocality ?? null
|
|
436
436
|
const parts = resolveLocaleParts(countrySource, districtAsLocalityOverride)
|
|
437
437
|
|
|
438
438
|
const pool: LocaleBaseTuple[] = []
|
|
@@ -462,10 +462,14 @@ export const localeRecipe: CorpusRecipe = {
|
|
|
462
462
|
const base = pool[Math.floor(random() * N)]!
|
|
463
463
|
const order = random() < intlFraction ? "international" : "native"
|
|
464
464
|
|
|
465
|
-
// These draws happen only for ES and NL, so other countries' seeded output
|
|
465
|
+
// These draws happen only for ES and NL, so other countries' seeded output
|
|
466
|
+
// is unaffected. country-branch: the ES house-number join and the NL glued
|
|
467
|
+
// postcode are measured surface shares for those two sources.
|
|
468
|
+
// A per-country surface table in the codex address layouts would replace both branches.
|
|
466
469
|
const nativeHouseJoin =
|
|
467
470
|
country === "ES" ? (random() < ES_SPACE_JOIN_FRACTION ? ("space" as const) : ("template" as const)) : undefined
|
|
468
471
|
|
|
472
|
+
// country-branch: see the ES branch above.
|
|
469
473
|
const postcodeShape =
|
|
470
474
|
country === "NL"
|
|
471
475
|
? random() < NL_GLUED_POSTCODE_FRACTION
|