@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
|
@@ -309,6 +309,10 @@ const STATE_ABBR_TO_NAME: Record<string, string> = Object.fromEntries(
|
|
|
309
309
|
* Expand state abbreviation to full name.
|
|
310
310
|
*/
|
|
311
311
|
export const stateExpand: Augmentation = (row) => {
|
|
312
|
+
// country-branch: the state, directional, street-suffix, unit and ZIP+4
|
|
313
|
+
// augmentations below read US vocabulary tables.
|
|
314
|
+
// Per-country abbreviation tables in the codex would let
|
|
315
|
+
// `defaultAugmentationsForCountry` serve every country.
|
|
312
316
|
if (row.country !== "US") return null
|
|
313
317
|
const region = row.components.region
|
|
314
318
|
|
|
@@ -330,6 +334,7 @@ export const stateExpand: Augmentation = (row) => {
|
|
|
330
334
|
* Abbreviate full state name to alpha-2.
|
|
331
335
|
*/
|
|
332
336
|
export const stateAbbreviate: Augmentation = (row) => {
|
|
337
|
+
// country-branch: see `stateExpand`.
|
|
333
338
|
if (row.country !== "US") return null
|
|
334
339
|
const region = row.components.region
|
|
335
340
|
|
|
@@ -365,6 +370,7 @@ const DIRECTIONAL_ABBR_TO_FULL: Record<string, string> = Object.fromEntries(
|
|
|
365
370
|
* Expand directional abbreviations.
|
|
366
371
|
*/
|
|
367
372
|
export const directionalExpand: Augmentation = (row) => {
|
|
373
|
+
// country-branch: see `stateExpand`.
|
|
368
374
|
if (row.country !== "US") return null
|
|
369
375
|
const tagsToCheck: ComponentTag[] = ["street", "street_suffix", "street_prefix"]
|
|
370
376
|
let changed = false
|
|
@@ -393,6 +399,7 @@ export const directionalExpand: Augmentation = (row) => {
|
|
|
393
399
|
* Abbreviate directional words.
|
|
394
400
|
*/
|
|
395
401
|
export const directionalAbbreviate: Augmentation = (row) => {
|
|
402
|
+
// country-branch: see `stateExpand`.
|
|
396
403
|
if (row.country !== "US") return null
|
|
397
404
|
const tagsToCheck: ComponentTag[] = ["street", "street_suffix", "street_prefix"]
|
|
398
405
|
let changed = false
|
|
@@ -425,6 +432,7 @@ export const directionalAbbreviate: Augmentation = (row) => {
|
|
|
425
432
|
* Abbreviate trailing US street suffix.
|
|
426
433
|
*/
|
|
427
434
|
export const streetSuffixAbbreviate: Augmentation = (row) => {
|
|
435
|
+
// country-branch: see `stateExpand`.
|
|
428
436
|
if (row.country !== "US") return null
|
|
429
437
|
const street = row.components.street
|
|
430
438
|
|
|
@@ -454,6 +462,7 @@ export const streetSuffixAbbreviate: Augmentation = (row) => {
|
|
|
454
462
|
* Expand trailing US street suffix.
|
|
455
463
|
*/
|
|
456
464
|
export const streetSuffixExpand: Augmentation = (row) => {
|
|
465
|
+
// country-branch: see `stateExpand`.
|
|
457
466
|
if (row.country !== "US") return null
|
|
458
467
|
const street = row.components.street
|
|
459
468
|
|
|
@@ -482,6 +491,7 @@ export const streetSuffixExpand: Augmentation = (row) => {
|
|
|
482
491
|
* Abbreviate leading US unit designator.
|
|
483
492
|
*/
|
|
484
493
|
export const unitDesignatorAbbreviate: Augmentation = (row) => {
|
|
494
|
+
// country-branch: see `stateExpand`.
|
|
485
495
|
if (row.country !== "US") return null
|
|
486
496
|
const unit = row.components.unit
|
|
487
497
|
|
|
@@ -511,6 +521,7 @@ export const unitDesignatorAbbreviate: Augmentation = (row) => {
|
|
|
511
521
|
* Expand leading US unit designator.
|
|
512
522
|
*/
|
|
513
523
|
export const unitDesignatorExpand: Augmentation = (row) => {
|
|
524
|
+
// country-branch: see `stateExpand`.
|
|
514
525
|
if (row.country !== "US") return null
|
|
515
526
|
const unit = row.components.unit
|
|
516
527
|
|
|
@@ -539,6 +550,7 @@ export const unitDesignatorExpand: Augmentation = (row) => {
|
|
|
539
550
|
* Drop dash from ZIP+4.
|
|
540
551
|
*/
|
|
541
552
|
export const zipPlus4DashDrop: Augmentation = (row) => {
|
|
553
|
+
// country-branch: see `stateExpand`.
|
|
542
554
|
if (row.country !== "US") return null
|
|
543
555
|
const postcode = row.components.postcode
|
|
544
556
|
|
|
@@ -557,6 +569,8 @@ export const zipPlus4DashDrop: Augmentation = (row) => {
|
|
|
557
569
|
* Drop French street particle.
|
|
558
570
|
*/
|
|
559
571
|
export const particleStrip: Augmentation = (row) => {
|
|
572
|
+
// country-branch: the particle list is French.
|
|
573
|
+
// A per-language particle table in the codex would replace this.
|
|
560
574
|
if (row.country !== "FR") return null
|
|
561
575
|
const particle = row.components.street_prefix_particle
|
|
562
576
|
|
|
@@ -604,6 +618,7 @@ export function defaultAugmentationsForCountry(country: string): readonly Augmen
|
|
|
604
618
|
const universal = [caseUpper, caseLower, dropCommas, doubleSpace]
|
|
605
619
|
|
|
606
620
|
switch (country) {
|
|
621
|
+
// country-branch: the US and FR augmentation lists exist because the two tier-1 locales have vocabulary tables. See `stateExpand`.
|
|
607
622
|
case "US":
|
|
608
623
|
return [
|
|
609
624
|
...universal,
|
|
@@ -617,6 +632,7 @@ export function defaultAugmentationsForCountry(country: string): readonly Augmen
|
|
|
617
632
|
unitDesignatorExpand,
|
|
618
633
|
zipPlus4DashDrop,
|
|
619
634
|
]
|
|
635
|
+
// country-branch: see the US case above.
|
|
620
636
|
case "FR":
|
|
621
637
|
return [...universal, accentStrip, particleStrip]
|
|
622
638
|
default:
|
|
@@ -731,7 +747,8 @@ export interface ComposeAdversarialOptions {
|
|
|
731
747
|
|
|
732
748
|
/**
|
|
733
749
|
* Separator between venue and address raw.
|
|
734
|
-
*
|
|
750
|
+
*
|
|
751
|
+
* @defaultValue `", "`
|
|
735
752
|
*/
|
|
736
753
|
separator?: string
|
|
737
754
|
|
|
@@ -799,7 +816,7 @@ export function composeAdversarialRow(
|
|
|
799
816
|
// Shift address spans by venue + separator and prepend one venue span.
|
|
800
817
|
const { span_starts: addrStarts, span_ends: addrEnds, span_tags: addrTags } = addressAligned.row
|
|
801
818
|
|
|
802
|
-
if (addrStarts
|
|
819
|
+
if (!addrStarts || !addrEnds || !addrTags) {
|
|
803
820
|
throw new Error(
|
|
804
821
|
`composeAdversarialRow: alignRow returned a labeled row without the span triple ` +
|
|
805
822
|
`(source=${address.source}, source_id=${address.source_id}) — alignment interface violation`
|
package/lib/test-kit.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface ScratchDir {
|
|
|
36
36
|
* or a platform holding a handle open must not turn a passing assertion into a failing suite.
|
|
37
37
|
*/
|
|
38
38
|
export function useScratchDir(slug: string): ScratchDir {
|
|
39
|
-
let owned: TemporaryDirectory |
|
|
39
|
+
let owned: TemporaryDirectory | null = null
|
|
40
40
|
|
|
41
41
|
beforeEach(async () => {
|
|
42
42
|
owned = await temporaryDirectory(`mailwoman-${slug}-`)
|
|
@@ -49,7 +49,7 @@ export function useScratchDir(slug: string): ScratchDir {
|
|
|
49
49
|
await owned?.[Symbol.asyncDispose]()
|
|
50
50
|
} catch {}
|
|
51
51
|
|
|
52
|
-
owned =
|
|
52
|
+
owned = null
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
return {
|
package/lib/tools/audit.ts
CHANGED
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* Emits warnings to stderr and the audit table to stdout. never throws on an empty corpus.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { readLocalJSONFile, readLocalTextFile } from "@mailwoman/core/fs/readers"
|
|
19
|
+
import { pathExists } from "@mailwoman/core/fs/readers/stat"
|
|
19
20
|
import { basename, type PathBuilderLike, resolvePathBuilder } from "path-ts"
|
|
20
21
|
import { Globerator } from "spliterator/node/fs"
|
|
21
22
|
|
|
@@ -43,11 +44,12 @@ export interface AuditOpts {
|
|
|
43
44
|
/**
|
|
44
45
|
* Sample at most N parquet files per split when counting sources.
|
|
45
46
|
*
|
|
46
|
-
* Default 100 for speed.
|
|
47
47
|
* Bump to read the full set on a slow run.
|
|
48
48
|
*
|
|
49
49
|
* The first row of each file determines its source — corpus-v0.2.0+ files are 100%
|
|
50
50
|
* source-segregated, so a one-row read is authoritative.
|
|
51
|
+
*
|
|
52
|
+
* @defaultValue `100` for speed
|
|
51
53
|
*/
|
|
52
54
|
sampleFileCount?: number
|
|
53
55
|
}
|
|
@@ -134,7 +136,7 @@ function inferSourceFromFilename(filename: string): string {
|
|
|
134
136
|
// Return "<unknown>" so the caller flags this case.
|
|
135
137
|
const m = basename(filename).match(/part-([\w-]+)-\d+\.parquet$/)
|
|
136
138
|
|
|
137
|
-
if (m && m[1]
|
|
139
|
+
if (m && m[1]) return m[1]
|
|
138
140
|
|
|
139
141
|
return "<unknown>"
|
|
140
142
|
}
|
|
@@ -303,7 +305,7 @@ function formatPct(v: number | "—"): string {
|
|
|
303
305
|
|
|
304
306
|
function printReport(
|
|
305
307
|
corpusDir: PathBuilderLike,
|
|
306
|
-
configPath: PathBuilderLike |
|
|
308
|
+
configPath: PathBuilderLike | null,
|
|
307
309
|
stats: FileCountStats,
|
|
308
310
|
rows: AuditRow[]
|
|
309
311
|
): void {
|
|
@@ -395,5 +397,5 @@ export async function audit(opts: AuditOpts): Promise<void> {
|
|
|
395
397
|
|
|
396
398
|
const trainStats = stats.bySplit["train"] ?? {}
|
|
397
399
|
const rows = buildAuditRows(trainStats, config?.sourceWeights ?? {})
|
|
398
|
-
printReport(opts.corpusDir, opts.configPath, stats, rows)
|
|
400
|
+
printReport(opts.corpusDir, opts.configPath ?? null, stats, rows)
|
|
399
401
|
}
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
import { ByteFormatter } from "@mailwoman/core/fs/formatters"
|
|
40
|
-
import { statPath } from "@mailwoman/core/fs/readers"
|
|
40
|
+
import { statPath } from "@mailwoman/core/fs/readers/stat"
|
|
41
41
|
import { writeLocalJSONFile } from "@mailwoman/core/fs/writers"
|
|
42
42
|
import { stringifyJSON } from "@mailwoman/core/json"
|
|
43
43
|
import { PathBuilder } from "path-ts"
|
package/lib/tools/fetch/atom.ts
CHANGED
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
* that feed's entries point at files, and both are `<entry>` with `<link>` children.
|
|
11
11
|
*
|
|
12
12
|
* Parsed with `@mailwoman/core/html/elements` rather than matched with a pattern, because a feed
|
|
13
|
-
* needs the two things a pattern handles badly. An entry's open tag
|
|
13
|
+
* needs the two things a pattern handles badly. An entry's open tag holds attributes
|
|
14
14
|
* (`xml:lang`), and an href escapes the ampersand between its query parameters, so a reader has to
|
|
15
15
|
* keep attributes and decode entities. XML mode is required: a feed's links self-close, and HTML
|
|
16
16
|
* mode leaves them open.
|
|
17
17
|
*
|
|
18
|
-
* Feed-level links are told from entry-level links by the parser rather than by position.
|
|
18
|
+
* Feed-level links are told from entry-level links by the parser rather than by position. One request
|
|
19
19
|
* for `link` and `entry` together yields a `link` only where it is not already inside an `entry`,
|
|
20
20
|
* because capture runs to the outermost requested element's close.
|
|
21
21
|
*/
|
|
@@ -86,7 +86,8 @@ export interface AtomEntry {
|
|
|
86
86
|
*/
|
|
87
87
|
export interface AtomFeed {
|
|
88
88
|
/**
|
|
89
|
-
* The feed's own links
|
|
89
|
+
* The feed's own links.
|
|
90
|
+
* These sit outside every entry.
|
|
90
91
|
*/
|
|
91
92
|
links: readonly AtomLink[]
|
|
92
93
|
entries: readonly AtomEntry[]
|
|
@@ -100,7 +101,7 @@ function atomLinkOf(element: MarkupElement): AtomLink {
|
|
|
100
101
|
rel: (element.attributes.rel ?? "").toLowerCase(),
|
|
101
102
|
type: element.attributes.type ?? null,
|
|
102
103
|
title: element.attributes.title ?? null,
|
|
103
|
-
length: length
|
|
104
|
+
length: length && /^\d+$/u.test(length) ? Number(length) : null,
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
|
@@ -118,8 +119,7 @@ function atomEntryOf(element: MarkupElement): AtomEntry {
|
|
|
118
119
|
/**
|
|
119
120
|
* Read a feed's links and entries out of its markup.
|
|
120
121
|
*
|
|
121
|
-
*
|
|
122
|
-
* ČÚZK's lists one entry per municipality in 8,373,817 bytes, measured 2026-10-02.
|
|
122
|
+
* The reader streams because a service document may be large: ČÚZK's lists one entry per municipality.
|
|
123
123
|
*
|
|
124
124
|
* @param chunks The feed's bytes or text, in order.
|
|
125
125
|
* A Node `Readable` satisfies this.
|
|
@@ -154,11 +154,11 @@ export async function* feedChunks(text: string): AsyncIterable<string> {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
/**
|
|
157
|
-
* The first link carrying `rel`, or `
|
|
157
|
+
* The first link carrying `rel`, or `null` where the collection holds none.
|
|
158
158
|
*
|
|
159
|
-
* A feed's entry commonly
|
|
159
|
+
* A feed's entry commonly holds several: ČÚZK writes a `describedby` link to its ISO 19139
|
|
160
160
|
* record beside the `alternate` link that is the data, and either would download as a dataset.
|
|
161
161
|
*/
|
|
162
|
-
export function linkWithRel(links: readonly AtomLink[], rel: string): AtomLink |
|
|
163
|
-
return links.find((link) => link.rel === rel.toLowerCase())
|
|
162
|
+
export function linkWithRel(links: readonly AtomLink[], rel: string): AtomLink | null {
|
|
163
|
+
return links.find((link) => link.rel === rel.toLowerCase()) ?? null
|
|
164
164
|
}
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
import { APIClient } from "@mailwoman/core/api"
|
|
31
31
|
import { ByteFormatter } from "@mailwoman/core/fs/formatters"
|
|
32
|
-
import { tryStat } from "@mailwoman/core/fs/readers"
|
|
32
|
+
import { tryStat } from "@mailwoman/core/fs/readers/stat"
|
|
33
33
|
import { makeDirectories, removePathIfPresent } from "@mailwoman/core/fs/writers"
|
|
34
34
|
import { listZipEntries } from "@mailwoman/core/fs/zip"
|
|
35
35
|
import { sha256File } from "@mailwoman/core/hash"
|
|
@@ -57,7 +57,8 @@ export function cordisArchiveURL(programme: string): string {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* The file name one programme's archive is kept under
|
|
60
|
+
* The file name one programme's archive is kept under.
|
|
61
|
+
* It is the URL's own last segment.
|
|
61
62
|
*/
|
|
62
63
|
export function cordisArchiveFilename(programme: string): string {
|
|
63
64
|
return `cordis-${programme}projects-csv.zip`
|
|
@@ -69,7 +70,8 @@ export function cordisArchiveFilename(programme: string): string {
|
|
|
69
70
|
export const CORDIS_LEGAL_NOTICE_URL = "https://cordis.europa.eu/about/legal"
|
|
70
71
|
|
|
71
72
|
/**
|
|
72
|
-
* The directory the archives are written under
|
|
73
|
+
* The directory the archives are written under.
|
|
74
|
+
* It is the adapter's `inputPath`.
|
|
73
75
|
*/
|
|
74
76
|
const SLUG = CORDIS_ADAPTER_ID
|
|
75
77
|
|
|
@@ -110,7 +112,7 @@ export async function readCORDISArchiveHead(
|
|
|
110
112
|
|
|
111
113
|
return {
|
|
112
114
|
lastModified: headers?.["last-modified"] ?? null,
|
|
113
|
-
contentLength: length
|
|
115
|
+
contentLength: length && /^\d+$/u.test(length) ? Number(length) : null,
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
@@ -120,16 +122,16 @@ export async function readCORDISArchiveHead(
|
|
|
120
122
|
* The `HEAD` decides first, then the file's own length, then, when asked, its digest.
|
|
121
123
|
*/
|
|
122
124
|
export async function isCORDISArchiveCurrent(
|
|
123
|
-
recorded: CORDISArchiveManifest |
|
|
125
|
+
recorded: CORDISArchiveManifest | null,
|
|
124
126
|
head: CORDISArchiveHead,
|
|
125
127
|
path: PathBuilderLike,
|
|
126
128
|
verifyDigest: boolean
|
|
127
129
|
): Promise<boolean> {
|
|
128
130
|
if (!recorded) return false
|
|
129
131
|
|
|
130
|
-
if (head.lastModified
|
|
132
|
+
if (!head.lastModified && head.contentLength === null) return false
|
|
131
133
|
|
|
132
|
-
if (head.lastModified
|
|
134
|
+
if (head.lastModified && head.lastModified !== recorded.last_modified) return false
|
|
133
135
|
|
|
134
136
|
if (head.contentLength !== null && head.contentLength !== recorded.bytes) return false
|
|
135
137
|
|
|
@@ -150,7 +152,7 @@ export interface DownloadCORDISOptions {
|
|
|
150
152
|
outputDir: PathBuilderLike
|
|
151
153
|
/**
|
|
152
154
|
* Which programmes to fetch.
|
|
153
|
-
*
|
|
155
|
+
* @defaultValue {@linkcode CORDIS_PROGRAMMES}
|
|
154
156
|
*/
|
|
155
157
|
programmes?: readonly string[]
|
|
156
158
|
/**
|
|
@@ -225,7 +227,7 @@ export async function downloadCORDIS(
|
|
|
225
227
|
|
|
226
228
|
const current =
|
|
227
229
|
!options.force &&
|
|
228
|
-
(await isCORDISArchiveCurrent(recorded.get(filename), head, archivePath, options.verifyDigest ?? false))
|
|
230
|
+
(await isCORDISArchiveCurrent(recorded.get(filename) ?? null, head, archivePath, options.verifyDigest ?? false))
|
|
229
231
|
|
|
230
232
|
if (current) {
|
|
231
233
|
report?.(` ✓ ${programme} already current — no download.`)
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* @file Reads and writes corpus-source manifests.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { readLocalTextFile } from "@mailwoman/core/fs/readers"
|
|
9
|
+
import { pathExists } from "@mailwoman/core/fs/readers/stat"
|
|
9
10
|
import { openWriteStream, pipeline, Readable } from "@mailwoman/core/fs/streams"
|
|
10
11
|
import { movePath, writeLocalJSONFile } from "@mailwoman/core/fs/writers"
|
|
11
12
|
import { tryParsingJSON } from "@mailwoman/core/json"
|
|
@@ -46,7 +46,7 @@ export interface BaseFetchOptions {
|
|
|
46
46
|
/**
|
|
47
47
|
* Pause between transfer retries, in milliseconds.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
49
|
+
* @defaultValue {@linkcode DEFAULT_RETRY_DELAY_MS}
|
|
50
50
|
*
|
|
51
51
|
* A test that exercises the failure path pays this delay once per retry in real time.
|
|
52
52
|
* Measured at 20.1 s for the two failing-transfer cases in `geonames-postal.test.ts`,
|
|
@@ -115,19 +115,19 @@ export interface DownloadOptions {
|
|
|
115
115
|
/**
|
|
116
116
|
* Per-attempt timeout.
|
|
117
117
|
*
|
|
118
|
-
*
|
|
118
|
+
* @defaultValue `10` minutes — these are multi-GB government dumps
|
|
119
119
|
*/
|
|
120
120
|
timeoutMs?: number
|
|
121
121
|
/**
|
|
122
122
|
* Extra attempts after the first, taken only on transient statuses or network errors.
|
|
123
123
|
*
|
|
124
|
-
*
|
|
124
|
+
* @defaultValue `0`
|
|
125
125
|
*/
|
|
126
126
|
retries?: number
|
|
127
127
|
/**
|
|
128
128
|
* Delay between attempts.
|
|
129
129
|
*
|
|
130
|
-
*
|
|
130
|
+
* @defaultValue `5s`
|
|
131
131
|
*/
|
|
132
132
|
retryDelayMs?: number
|
|
133
133
|
headers?: Record<string, string>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @file Retries and resumes interrupted corpus downloads.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import { tryStat } from "@mailwoman/core/fs/readers"
|
|
8
|
+
import { tryStat } from "@mailwoman/core/fs/readers/stat"
|
|
9
9
|
import { openWriteStream, pipeline, Readable } from "@mailwoman/core/fs/streams"
|
|
10
10
|
import { movePath } from "@mailwoman/core/fs/writers"
|
|
11
11
|
import { sleep } from "@mailwoman/core/utils/sleep"
|
|
@@ -80,10 +80,10 @@ export async function resumableDownload(options: {
|
|
|
80
80
|
const { url, dest, headers = {}, maxConnections = 400, retryDelayMs = DEFAULT_RETRY_DELAY_MS, report } = options
|
|
81
81
|
const tmp = dest + ".tmp"
|
|
82
82
|
let have = await bytesOnDisk(tmp)
|
|
83
|
-
let total: number |
|
|
83
|
+
let total: number | null = null
|
|
84
84
|
|
|
85
85
|
for (let connection = 0; connection < maxConnections; connection++) {
|
|
86
|
-
if (total !==
|
|
86
|
+
if (total !== null && have >= total) break
|
|
87
87
|
|
|
88
88
|
let res: Response
|
|
89
89
|
|
|
@@ -137,7 +137,7 @@ export async function resumableDownload(options: {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
if (total ===
|
|
140
|
+
if (total === null || have < total) {
|
|
141
141
|
throw new Error(`resumable download stalled at ${have} of ${total ?? "?"} bytes — ${url}`)
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* the basename, so a postal export receives `wrong_format_present` and does not count as coverage.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import {
|
|
21
|
+
import { readFileHead, readLocalBuffer, readLocalTextFile } from "@mailwoman/core/fs/readers"
|
|
22
|
+
import { pathExists } from "@mailwoman/core/fs/readers/stat"
|
|
22
23
|
import { makeDirectories, removePathIfPresent } from "@mailwoman/core/fs/writers"
|
|
23
24
|
import { extractZipEntry } from "@mailwoman/core/fs/zip"
|
|
24
25
|
import { sha256File } from "@mailwoman/core/hash"
|
|
@@ -50,14 +51,15 @@ export interface FetchGeonamesDumpOptions extends BaseFetchOptions {
|
|
|
50
51
|
/**
|
|
51
52
|
* Dump directory to read from.
|
|
52
53
|
*
|
|
53
|
-
* Defaults to GeoNames' own.
|
|
54
54
|
* Exists so the 404 and coverage behavior can be exercised against a local server.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue GeoNames' own.
|
|
55
57
|
*/
|
|
56
58
|
baseURL?: string
|
|
57
59
|
/**
|
|
58
60
|
* Refetch a dump whose `<CC>.txt` already exists.
|
|
59
61
|
*
|
|
60
|
-
*
|
|
62
|
+
* @defaultValue `false` — the tool fills gaps
|
|
61
63
|
*/
|
|
62
64
|
force?: boolean
|
|
63
65
|
}
|
|
@@ -42,13 +42,13 @@ export interface FetchGeonamesPostalOptions extends BaseFetchOptions {
|
|
|
42
42
|
/**
|
|
43
43
|
* ISO alpha-2 codes in any casing.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
45
|
+
* @defaultValue {@linkcode GEONAMES_POSTAL_DEFAULT_COUNTRIES}
|
|
46
46
|
*/
|
|
47
47
|
countries?: readonly string[]
|
|
48
48
|
/**
|
|
49
49
|
* Export directory to read from.
|
|
50
50
|
*
|
|
51
|
-
*
|
|
51
|
+
* @defaultValue GeoNames' own, so the 404-is-coverage behavior can be exercised against a local server.
|
|
52
52
|
*/
|
|
53
53
|
baseURL?: string
|
|
54
54
|
}
|
package/lib/tools/fetch/gleif.ts
CHANGED
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
* streams the member out of the archive rather than reading an extracted copy.
|
|
29
29
|
*
|
|
30
30
|
* The receipt written beside the archive records the URL, the publish date, the byte count and the
|
|
31
|
-
* sha256 of the archive
|
|
31
|
+
* sha256 of the archive. Together they identify the bytes a corpus row was read from.
|
|
32
32
|
*/
|
|
33
33
|
|
|
34
34
|
import { APIClient } from "@mailwoman/core/api"
|
|
35
35
|
import { ByteFormatter } from "@mailwoman/core/fs/formatters"
|
|
36
|
-
import { tryStat } from "@mailwoman/core/fs/readers"
|
|
36
|
+
import { tryStat } from "@mailwoman/core/fs/readers/stat"
|
|
37
37
|
import { makeDirectories, removePathIfPresent } from "@mailwoman/core/fs/writers"
|
|
38
38
|
import { listZipEntries } from "@mailwoman/core/fs/zip"
|
|
39
39
|
import { sha256File } from "@mailwoman/core/hash"
|
|
@@ -56,7 +56,8 @@ import { readManifest, resumableDownload, writeManifest } from "#tools/fetch/dow
|
|
|
56
56
|
export const GLEIF_LATEST_PUBLISH_URL = "https://goldencopy.gleif.org/api/v2/golden-copies/publishes/latest"
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* The directory the archive and its receipt are written under
|
|
59
|
+
* The directory the archive and its receipt are written under.
|
|
60
|
+
* It is the adapter's `inputPath`.
|
|
60
61
|
*/
|
|
61
62
|
const SLUG = "gleif"
|
|
62
63
|
|
|
@@ -155,7 +156,8 @@ export async function readGLEIFLatestPublish(client: Pick<APIClient, "fetch">):
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
/**
|
|
158
|
-
* The archive's file name
|
|
159
|
+
* The archive's file name.
|
|
160
|
+
* It is the last path segment of the URL the API returns.
|
|
159
161
|
*/
|
|
160
162
|
export function gleifArchiveFilename(url: string): string {
|
|
161
163
|
const name = new URL(url).pathname.split("/").at(-1) ?? ""
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* This module reads a delimited file's header line and refuses one that drops a column an adapter
|
|
7
7
|
* indexes.
|
|
8
8
|
*
|
|
9
9
|
* A fetch module checks the file it just wrote against the columns its adapter reads by name,
|
|
@@ -22,11 +22,12 @@ import { CSVSpliterator } from "spliterator"
|
|
|
22
22
|
* Read through `CSVSpliterator`, which is the reader the adapters use, rather than through
|
|
23
23
|
* a split of a fetch module's own: which columns a publisher quotes is a property of
|
|
24
24
|
* the edition, and a second reader would be a second answer to that question.
|
|
25
|
-
* `columnScan: "rows"` keeps the first row from decoding the whole file
|
|
26
|
-
*
|
|
25
|
+
* `columnScan: "rows"` keeps the first row from decoding the whole file.
|
|
26
|
+
*
|
|
27
|
+
* The default `"auto"` decodes the whole file even for one row.
|
|
27
28
|
*
|
|
28
29
|
* @param path The written file.
|
|
29
|
-
* @param columnDelimiter The publisher's delimiter
|
|
30
|
+
* @param columnDelimiter [","] The publisher's delimiter.
|
|
30
31
|
* @throws When the file holds no row at all, so an empty or truncated file reports itself
|
|
31
32
|
* rather than reading as a file with no columns.
|
|
32
33
|
*/
|
|
@@ -37,7 +38,7 @@ export async function readDelimitedHeader(path: PathBuilderLike, columnDelimiter
|
|
|
37
38
|
mode: "array",
|
|
38
39
|
columnScan: "rows",
|
|
39
40
|
take: 1,
|
|
40
|
-
...(columnDelimiter
|
|
41
|
+
...(columnDelimiter ? { columnDelimiter } : {}),
|
|
41
42
|
})
|
|
42
43
|
)
|
|
43
44
|
|
|
@@ -53,7 +54,8 @@ export async function readDelimitedHeader(path: PathBuilderLike, columnDelimiter
|
|
|
53
54
|
*
|
|
54
55
|
* @param columns The header {@linkcode readDelimitedHeader} returned.
|
|
55
56
|
* @param required The columns the adapter indexes by name.
|
|
56
|
-
* @param context What is being checked
|
|
57
|
+
* @param context What is being checked.
|
|
58
|
+
* This value opens the message.
|
|
57
59
|
* @throws Naming the columns that are absent, so a renamed column is a reported failure
|
|
58
60
|
* rather than an empty string on every row the adapter emits.
|
|
59
61
|
*/
|