@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/recipes/scaffold.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* supplies the I/O.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { pathExists } from "@mailwoman/core/fs/readers"
|
|
12
|
+
import { pathExists } from "@mailwoman/core/fs/readers/stat"
|
|
13
13
|
import { readZipEntry } from "@mailwoman/core/fs/zip"
|
|
14
14
|
import { tryParsingJSON, stringifyJSON } from "@mailwoman/core/json"
|
|
15
15
|
import type { PathBuilderLike } from "path-ts"
|
|
@@ -59,9 +59,10 @@ export interface RecipeTuple {
|
|
|
59
59
|
postcode?: string
|
|
60
60
|
country?: string
|
|
61
61
|
/**
|
|
62
|
-
* Defaults to `leading` when absent.
|
|
63
62
|
*
|
|
64
63
|
* That matches every tuples file written before this field existed.
|
|
64
|
+
*
|
|
65
|
+
* @defaultValue `leading` when absent.
|
|
65
66
|
*/
|
|
66
67
|
postcodePlacement?: PostcodePlacement
|
|
67
68
|
/**
|
|
@@ -351,7 +352,8 @@ export function alignAndWrite(
|
|
|
351
352
|
): boolean {
|
|
352
353
|
const aligned = alignRow(canonical as Parameters<typeof alignRow>[0])
|
|
353
354
|
|
|
354
|
-
|
|
355
|
+
// A quarantined result also has a `row`, the quarantine record, so the kind decides.
|
|
356
|
+
if (aligned.kind !== "labeled") return false
|
|
355
357
|
|
|
356
358
|
write(
|
|
357
359
|
stringifyJSON({
|
|
@@ -395,26 +397,28 @@ export interface RecipeOptions {
|
|
|
395
397
|
intlFraction?: number
|
|
396
398
|
/**
|
|
397
399
|
* `german`: fraction of native-order rows rendered with no commas at all.
|
|
398
|
-
*
|
|
400
|
+
*
|
|
401
|
+
* @defaultValue `0.3`
|
|
399
402
|
*/
|
|
400
403
|
commaFreeFraction?: number
|
|
401
404
|
/**
|
|
402
405
|
* `german`: fraction of rows whose `dependent_locality` is a WOF Ortsteil of the tuple's locality.
|
|
403
406
|
*
|
|
404
|
-
* The default is 0.3.
|
|
405
407
|
* It is 0 when no admin database is readable.
|
|
408
|
+
*
|
|
409
|
+
* @defaultValue `0.3`
|
|
406
410
|
*/
|
|
407
411
|
ortsteilFraction?: number
|
|
408
412
|
/**
|
|
409
413
|
* `german`: the WOF admin database the Ortsteil pool is read from.
|
|
410
414
|
*
|
|
411
|
-
*
|
|
415
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/db/wof/admin-global-priority-importance.db`
|
|
412
416
|
*/
|
|
413
417
|
adminDB?: string
|
|
414
418
|
/**
|
|
415
419
|
* `locale`: fraction of rows that append an explicit country surface form + a `country` component.
|
|
416
420
|
*
|
|
417
|
-
*
|
|
421
|
+
* @defaultValue `0`
|
|
418
422
|
*/
|
|
419
423
|
countryFraction?: number
|
|
420
424
|
/**
|
|
@@ -430,7 +434,7 @@ export interface RecipeOptions {
|
|
|
430
434
|
/**
|
|
431
435
|
* `fr-lieudit`: BAN `adresses-<dept>.csv` directory.
|
|
432
436
|
*
|
|
433
|
-
*
|
|
437
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/corpus/sources/ban`
|
|
434
438
|
*/
|
|
435
439
|
banDir?: PathBuilderLike
|
|
436
440
|
multilocaleCount?: number
|
|
@@ -449,48 +453,54 @@ export interface RecipeOptions {
|
|
|
449
453
|
* `no-fragment` knob 3: emit N copies of each street+number row whose number has >=
|
|
450
454
|
* longNumberMinDigits digits (oversample the failing long-number class).
|
|
451
455
|
*
|
|
452
|
-
*
|
|
456
|
+
* @defaultValue `1` = no boost
|
|
453
457
|
*/
|
|
454
458
|
longNumberBoost?: number
|
|
455
459
|
/**
|
|
456
460
|
* `no-fragment` knob 3: minimum digit count for a number to count as "long" and be boosted.
|
|
457
461
|
*
|
|
458
|
-
*
|
|
462
|
+
* @defaultValue `3`
|
|
459
463
|
*/
|
|
460
464
|
longNumberMinDigits?: number
|
|
461
465
|
/**
|
|
462
466
|
* `sub-venue`: the sub-venue lexicon JSON.
|
|
463
467
|
*
|
|
464
|
-
*
|
|
468
|
+
* @defaultValue = the committed `corpus/data/sub-venue-lexicon.json`, resolved through the package manifest so it works
|
|
465
469
|
* from the source tree and from `out/`.
|
|
466
470
|
*/
|
|
467
471
|
lexicon?: string
|
|
468
472
|
/**
|
|
469
473
|
* `sub-venue`: directory of `sub-venue-extract` JSONLs, one per region.
|
|
470
474
|
*
|
|
471
|
-
*
|
|
475
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/sub-venue/extracts`
|
|
472
476
|
*/
|
|
473
477
|
extractsDir?: string
|
|
474
|
-
/**
|
|
475
|
-
* `sub-venue`: the `poi.db` spatial layer, read for the en-US and fr-FR venue + confound
|
|
476
|
-
* pools (the two of poi.db's four countries this recipe has legs for).
|
|
477
|
-
*
|
|
478
|
-
* Default `$MAILWOMAN_DATA_ROOT/db/poi/poi.db`.
|
|
479
|
-
*/
|
|
480
|
-
poiDB?: string
|
|
481
478
|
/**
|
|
482
479
|
* `sub-venue`: GB/US/FR address-context tuples jsonl.
|
|
483
480
|
*
|
|
484
|
-
*
|
|
481
|
+
* @defaultValue the house-venue v3 tuples (`$MAILWOMAN_DATA_ROOT/corpus/intermediate/house-venue-tuples-v3.jsonl`);
|
|
485
482
|
* DE and ES read OpenAddresses directly.
|
|
486
483
|
*/
|
|
487
484
|
subVenueTuples?: string
|
|
488
485
|
/**
|
|
489
486
|
* `sub-venue`: share of emitted rows that are confound negatives.
|
|
490
487
|
*
|
|
491
|
-
*
|
|
488
|
+
* @defaultValue `0.3`
|
|
492
489
|
*/
|
|
493
490
|
negativeFraction?: number
|
|
491
|
+
/**
|
|
492
|
+
* `venue` and `sub-venue`: the Overture place-names Parquet file with `name`,
|
|
493
|
+
* `category` and `country` columns.
|
|
494
|
+
*
|
|
495
|
+
* @defaultValue the release the venue-head table is built from, under `$MAILWOMAN_DATA_ROOT/overture`
|
|
496
|
+
*/
|
|
497
|
+
venueNames?: PathBuilderLike
|
|
498
|
+
/**
|
|
499
|
+
* `venue`: share of locality rows that also carry the tuple's region after the locality.
|
|
500
|
+
*
|
|
501
|
+
* @defaultValue `0.5`
|
|
502
|
+
*/
|
|
503
|
+
venueRegionFraction?: number
|
|
494
504
|
}
|
|
495
505
|
|
|
496
506
|
/**
|
package/lib/recipes/sources.ts
CHANGED
|
@@ -91,7 +91,7 @@ export interface RecipeSource {
|
|
|
91
91
|
/**
|
|
92
92
|
* Why the producer's path does not fully explain the placement.
|
|
93
93
|
*/
|
|
94
|
-
note
|
|
94
|
+
note: string | null
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
@@ -107,7 +107,7 @@ function entries(
|
|
|
107
107
|
current: `${prefix}-${tail}`,
|
|
108
108
|
operation,
|
|
109
109
|
producer,
|
|
110
|
-
|
|
110
|
+
note: note || null,
|
|
111
111
|
}))
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -164,6 +164,7 @@ export const RECIPE_SOURCES: ReadonlyArray<RecipeSource> = [
|
|
|
164
164
|
current: "rendered-de",
|
|
165
165
|
operation: SourceOperation.Rendered,
|
|
166
166
|
producer: "de/recipes/locale.ts",
|
|
167
|
+
note: null,
|
|
167
168
|
},
|
|
168
169
|
// Three tails include the word `fragment` themselves.
|
|
169
170
|
// It folds into the prefix instead of repeating.
|
|
@@ -183,21 +184,33 @@ export const RECIPE_SOURCES: ReadonlyArray<RecipeSource> = [
|
|
|
183
184
|
current: "fragment-fr",
|
|
184
185
|
operation: SourceOperation.Fragment,
|
|
185
186
|
producer: "fr/recipes/fragment.ts",
|
|
187
|
+
note: null,
|
|
186
188
|
},
|
|
187
189
|
{
|
|
188
190
|
retired: "synth-no-fragment",
|
|
189
191
|
current: "fragment-no",
|
|
190
192
|
operation: SourceOperation.Fragment,
|
|
191
193
|
producer: "no/recipes/fragment.ts",
|
|
194
|
+
note: null,
|
|
192
195
|
},
|
|
193
196
|
...entries(SourceOperation.Fragment, "fragment", [
|
|
194
197
|
["fr-bare-street", "fr/recipes/bare-street.ts"],
|
|
195
198
|
["fr-bare-street-v20", "fr/recipes/bare-street.ts"],
|
|
196
199
|
["fr-bare-street-v21", "fr/recipes/bare-street.ts"],
|
|
197
200
|
["fr-bare-street-v22", "fr/recipes/bare-street.ts"],
|
|
201
|
+
[
|
|
202
|
+
"venue-bare",
|
|
203
|
+
"recipes/venue.ts",
|
|
204
|
+
"An Overture place name as the whole query. The retired spelling never reached a corpus: the recipe was written after the rename.",
|
|
205
|
+
],
|
|
198
206
|
]),
|
|
199
207
|
...entries(SourceOperation.Spliced, "spliced", [
|
|
200
208
|
["unit", "recipes/unit.ts", "The unit designator and number are drawn."],
|
|
209
|
+
[
|
|
210
|
+
"venue-locality",
|
|
211
|
+
"recipes/venue.ts",
|
|
212
|
+
"The locality is drawn from the country's admin tuples. The retired spelling never reached a corpus.",
|
|
213
|
+
],
|
|
201
214
|
["unit-v30", "recipes/unit.ts"],
|
|
202
215
|
["affix", "recipes/street/affix.ts"],
|
|
203
216
|
["suffix-boundary", "recipes/street/affix.ts"],
|
|
@@ -259,7 +272,7 @@ export const CARRIED_SOURCES: ReadonlyArray<string> = [
|
|
|
259
272
|
"gnaf",
|
|
260
273
|
"osm",
|
|
261
274
|
// One id per country for the 2026-10-02 Geofabrik extracts, written by `corpus run osm --source-name`.
|
|
262
|
-
// A country's OSM rows then
|
|
275
|
+
// A country's OSM rows then hold their own weight, so admitting a country,
|
|
263
276
|
// admitting its OSM rows and sampling them stay three settings.
|
|
264
277
|
// The September PK, VN and BD rows keep `osm`.
|
|
265
278
|
"osm-ru",
|
|
@@ -22,9 +22,9 @@ import { mulberry32 as makeMulberry32 } from "@mailwoman/core/utils"
|
|
|
22
22
|
|
|
23
23
|
import { recipeSourceID, requireRegister, type CanonicalRecipeRow, type CorpusRecipe } from "#recipes/scaffold"
|
|
24
24
|
import { defaultRecipeSource } from "#recipes/sources"
|
|
25
|
-
import { DEFAULT_US_BASES } from "#synthesizers/intersection"
|
|
26
|
-
import { synthesizeStreetRow, type StreetBaseTuple } from "#synthesizers/street"
|
|
27
25
|
import { SurfaceOrigin } from "#types"
|
|
26
|
+
import { DEFAULT_US_BASES } from "#us/synthesizers/intersection"
|
|
27
|
+
import { synthesizeStreetRow, type StreetBaseTuple } from "#us/synthesizers/street"
|
|
28
28
|
import { alignRow } from "#utils"
|
|
29
29
|
|
|
30
30
|
/**
|
package/lib/recipes/street.ts
CHANGED
|
@@ -12,8 +12,8 @@ import { makeLcg } from "@mailwoman/core/utils"
|
|
|
12
12
|
import { stableSourceID } from "#adapters/source-id"
|
|
13
13
|
import { alignAndWrite, readTuples, type CorpusRecipe } from "#recipes/scaffold"
|
|
14
14
|
import { defaultRecipeSource } from "#recipes/sources"
|
|
15
|
-
import { synthesizeStreetRow, type StreetBaseTuple } from "#synthesizers/street"
|
|
16
15
|
import { SurfaceOrigin } from "#types"
|
|
16
|
+
import { synthesizeStreetRow, type StreetBaseTuple } from "#us/synthesizers/street"
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* The recipe draws a street name from a pool and joins it to a tuple's locality, region and postcode.
|
|
@@ -62,6 +62,8 @@ export const streetRecipe: CorpusRecipe = {
|
|
|
62
62
|
continue
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
// country-branch: `synthesizeStreetRow` renders the US layout only.
|
|
66
|
+
// The codex layouts in the `locale` recipe cover the rest.
|
|
65
67
|
if (tuple.country !== "US") {
|
|
66
68
|
skipped++
|
|
67
69
|
|
|
@@ -138,6 +138,8 @@ export function buildStreetNegatives(
|
|
|
138
138
|
isPair = true
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
// country-branch: `-gate` is a street-name suffix in British English only.
|
|
142
|
+
// The street-morphology FST per locale would replace it.
|
|
141
143
|
if (country === "GB" && token.length >= MIN_GATE_SUFFIX_TOKEN_LENGTH && token.endsWith("gate")) {
|
|
142
144
|
gateSuffix.push(tuple)
|
|
143
145
|
}
|
|
@@ -150,7 +150,7 @@ export function addressGroups(country: string, tuple: LocaleBaseTuple, withStree
|
|
|
150
150
|
let current: Group = []
|
|
151
151
|
|
|
152
152
|
for (const piece of renderAddress(layout, components).pieces) {
|
|
153
|
-
if (piece.tag
|
|
153
|
+
if (!piece.tag) {
|
|
154
154
|
if (GROUP_BREAK.has(piece.text) && current.length) {
|
|
155
155
|
groups.push(current)
|
|
156
156
|
current = []
|
|
@@ -9,10 +9,9 @@ import { resolveModulePath } from "@mailwoman/core/module/resolvers"
|
|
|
9
9
|
import { sample } from "@mailwoman/core/random"
|
|
10
10
|
import { escapeRegExp } from "@mailwoman/core/strings/regexp"
|
|
11
11
|
import { upperFirst } from "@mailwoman/normalize/case"
|
|
12
|
-
import type { POIDatabase } from "@mailwoman/resolver-wof-sqlite/poi"
|
|
13
|
-
import { DatabaseClient } from "@mailwoman/sqlite/client"
|
|
14
12
|
import type { PathBuilderLike } from "path-ts"
|
|
15
13
|
|
|
14
|
+
import { escapeSQLString, openDuckDB } from "#parquet/duckdb"
|
|
16
15
|
import { classifyIdentifier, readSubVenueJSONL } from "#subvenue/harvest"
|
|
17
16
|
import { SUBVENUE_PROMOTIONS, type SubVenuePromotion } from "#subvenue/promotions"
|
|
18
17
|
import type { SubVenueLexiconTable } from "#subvenue/table"
|
|
@@ -30,7 +29,7 @@ export function defaultLexiconPath(): string {
|
|
|
30
29
|
* Reads the sub-venue lexicon and throws on invalid JSON.
|
|
31
30
|
*/
|
|
32
31
|
export async function readSubVenueLexicon(path: string = defaultLexiconPath()): Promise<SubVenueLexiconTable> {
|
|
33
|
-
return
|
|
32
|
+
return readLocalJSONFile<SubVenueLexiconTable>(path)
|
|
34
33
|
}
|
|
35
34
|
|
|
36
35
|
const MAX_VENUE_NAME_LENGTH = 44
|
|
@@ -516,43 +515,39 @@ const POI_CONFOUND_CATEGORIES: readonly string[] = [
|
|
|
516
515
|
]
|
|
517
516
|
|
|
518
517
|
/**
|
|
519
|
-
* Reads the venue and confound name pools for one country from
|
|
518
|
+
* Reads the venue and confound name pools for one country from the Overture place-names file,
|
|
519
|
+
* which holds `name`, `category` and `country` for every country the release covers.
|
|
520
520
|
*
|
|
521
|
-
* The
|
|
521
|
+
* The venue categories fill the `venues` pool.
|
|
522
|
+
* Every row of a venue or confound category is tested against the rejected phrases
|
|
523
|
+
* and the designator phrases, as the OSM extracts are.
|
|
522
524
|
*/
|
|
523
|
-
export function
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
const
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
if (!wanted.length) throw new Error(`poi.db at ${dbPath} has none of the expected categories`)
|
|
537
|
-
|
|
538
|
-
const rows = db
|
|
539
|
-
.prepare(
|
|
540
|
-
`select name, category_id from poi where country = ? and name is not null and category_id in (${wanted.map(() => "?").join(",")})`
|
|
541
|
-
)
|
|
542
|
-
.all(country, ...wanted) as Array<{ name: string; category_id: number }>
|
|
525
|
+
export async function readOvertureNamePools(
|
|
526
|
+
venueNames: PathBuilderLike,
|
|
527
|
+
country: string,
|
|
528
|
+
query: PoolQuery
|
|
529
|
+
): Promise<NamePools> {
|
|
530
|
+
const categories = [...POI_VENUE_CATEGORIES, ...POI_CONFOUND_CATEGORIES].map((c) => `'${escapeSQLString(c)}'`)
|
|
531
|
+
|
|
532
|
+
using db = await openDuckDB({ threads: 4 })
|
|
533
|
+
|
|
534
|
+
const result = await db.runAndReadAll(
|
|
535
|
+
`SELECT DISTINCT name, category FROM read_parquet('${escapeSQLString(String(venueNames))}')
|
|
536
|
+
WHERE country = '${escapeSQLString(country)}' AND name IS NOT NULL AND category IN (${categories.join(",")})`
|
|
537
|
+
)
|
|
543
538
|
|
|
544
|
-
const venueSet = new Set(
|
|
539
|
+
const venueSet = new Set(POI_VENUE_CATEGORIES)
|
|
545
540
|
const venues = new Set<string>()
|
|
546
541
|
const rejectedVenues = new Set<string>()
|
|
547
542
|
const longerNames = new Set<string>()
|
|
548
543
|
|
|
549
|
-
for (const
|
|
550
|
-
const name =
|
|
544
|
+
for (const [nameValue, categoryValue] of result.getRows()) {
|
|
545
|
+
const name = String(nameValue).trim()
|
|
551
546
|
|
|
552
547
|
if (!isVenueSlotName(name)) continue
|
|
553
548
|
const low = name.toLowerCase()
|
|
554
549
|
|
|
555
|
-
if (venueSet.has(
|
|
550
|
+
if (venueSet.has(String(categoryValue))) {
|
|
556
551
|
venues.add(name)
|
|
557
552
|
}
|
|
558
553
|
|
package/lib/recipes/sub/venue.ts
CHANGED
|
@@ -12,7 +12,6 @@ import { stringifyJSON } from "@mailwoman/core/json"
|
|
|
12
12
|
import { sample } from "@mailwoman/core/random"
|
|
13
13
|
import { mulberry32 as makeMulberry32 } from "@mailwoman/core/utils"
|
|
14
14
|
import { upperFirst } from "@mailwoman/normalize/case"
|
|
15
|
-
import { poiDatabasePath } from "@mailwoman/resolver-wof-sqlite/paths"
|
|
16
15
|
import type { PathBuilderLike } from "path-ts"
|
|
17
16
|
|
|
18
17
|
import { recipeSourceID, type CorpusRecipe } from "#recipes/scaffold"
|
|
@@ -30,19 +29,16 @@ import {
|
|
|
30
29
|
type PromotedSurface,
|
|
31
30
|
promotedSurfacesFor,
|
|
32
31
|
readExtractPools,
|
|
33
|
-
|
|
32
|
+
readOvertureNamePools,
|
|
34
33
|
readSubVenueLexicon,
|
|
35
34
|
rejectedPhrasesFor,
|
|
36
35
|
sampleIdentifier,
|
|
37
36
|
} from "#recipes/sub/venue/sources"
|
|
37
|
+
import { DEFAULT_VENUE_NAMES } from "#recipes/venue"
|
|
38
38
|
import type { SubVenueLexiconTable } from "#subvenue/table"
|
|
39
39
|
import type { LocaleBaseTuple } from "#surfaces/locale"
|
|
40
40
|
import { alignRow } from "#utils"
|
|
41
41
|
|
|
42
|
-
export * from "#recipes/sub/venue/sources"
|
|
43
|
-
export * from "#recipes/sub/venue/context"
|
|
44
|
-
export * from "#recipes/sub/venue/render"
|
|
45
|
-
|
|
46
42
|
// #region Plan
|
|
47
43
|
|
|
48
44
|
/**
|
|
@@ -62,7 +58,7 @@ export interface SubVenueLeg {
|
|
|
62
58
|
/**
|
|
63
59
|
* The OSM extract filename under `--extracts-dir`.
|
|
64
60
|
*
|
|
65
|
-
*
|
|
61
|
+
* Every leg draws venue and confound pools from the Overture place-names file as well.
|
|
66
62
|
*/
|
|
67
63
|
extract?: string
|
|
68
64
|
/**
|
|
@@ -146,7 +142,7 @@ export const SUBVENUE_LEGS: readonly SubVenueLeg[] = [
|
|
|
146
142
|
* The region whose identifier distribution the en-US leg uses.
|
|
147
143
|
*
|
|
148
144
|
* The en-US leg has no OSM extract.
|
|
149
|
-
*
|
|
145
|
+
* The Overture names file carries venue names without refs.
|
|
150
146
|
* The recipe borrows the identifier distribution from GB.
|
|
151
147
|
*/
|
|
152
148
|
export const US_IDENTIFIER_REGION_BORROWED_FROM = "GB"
|
|
@@ -636,23 +632,21 @@ export function allocate(total: number, shares: readonly number[]): number[] {
|
|
|
636
632
|
}
|
|
637
633
|
|
|
638
634
|
/**
|
|
639
|
-
* Builds one leg's name pools from its extract and
|
|
635
|
+
* Builds one leg's name pools from its extract and the Overture place-names file, plus its address context.
|
|
640
636
|
*/
|
|
641
637
|
async function buildLegPools(
|
|
642
638
|
leg: SubVenueLeg,
|
|
643
639
|
query: PoolQuery,
|
|
644
640
|
contextByCountry: ReadonlyMap<string, LocaleBaseTuple[]>,
|
|
645
|
-
paths: { extractsDir: PathBuilderLike;
|
|
641
|
+
paths: { extractsDir: PathBuilderLike; venueNames: PathBuilderLike }
|
|
646
642
|
): Promise<LegPools> {
|
|
647
643
|
const extractPools = leg.extract
|
|
648
644
|
? await readExtractPools(`${paths.extractsDir}/${leg.extract}`, query)
|
|
649
645
|
: EMPTY_NAME_POOLS
|
|
650
646
|
|
|
651
|
-
|
|
652
|
-
const poiPools =
|
|
653
|
-
leg.country === "US" || leg.country === "FR" ? readPOIPools(paths.poiDB, leg.country, query) : EMPTY_NAME_POOLS
|
|
647
|
+
const overturePools = await readOvertureNamePools(paths.venueNames, leg.country, query)
|
|
654
648
|
|
|
655
|
-
const names = mergeNamePools(extractPools,
|
|
649
|
+
const names = mergeNamePools(extractPools, overturePools)
|
|
656
650
|
let context = contextByCountry.get(leg.country) ?? []
|
|
657
651
|
|
|
658
652
|
if (leg.postcodePrefixes) {
|
|
@@ -711,8 +705,8 @@ export const subVenueRecipe: CorpusRecipe = {
|
|
|
711
705
|
description: "OSM sub-venue extract JSONLs (default: $MAILWOMAN_DATA_ROOT/sub-venue/extracts)",
|
|
712
706
|
},
|
|
713
707
|
{
|
|
714
|
-
flag: "--
|
|
715
|
-
description:
|
|
708
|
+
flag: "--venue-names <parquet>",
|
|
709
|
+
description: `Overture place-names file for every leg's venue and confound pools (default ${DEFAULT_VENUE_NAMES})`,
|
|
716
710
|
},
|
|
717
711
|
{ flag: "--sub-venue-tuples <path>", description: "GB/US/FR address-context tuples JSONL" },
|
|
718
712
|
{
|
|
@@ -725,7 +719,7 @@ export const subVenueRecipe: CorpusRecipe = {
|
|
|
725
719
|
const count = opts.count
|
|
726
720
|
const negativeFraction = opts.negativeFraction ?? DEFAULT_NEGATIVE_FRACTION
|
|
727
721
|
const extractsDir = opts.extractsDir ?? dataRootPath("sub-venue", "extracts")
|
|
728
|
-
const
|
|
722
|
+
const venueNames = opts.venueNames ?? DEFAULT_VENUE_NAMES
|
|
729
723
|
const tuplesPath = opts.subVenueTuples ?? dataRootPath("corpus", "intermediate", "house-venue-tuples-v3.jsonl")
|
|
730
724
|
const lexicon: SubVenueLexiconTable = await readSubVenueLexicon(opts.lexicon ?? defaultLexiconPath())
|
|
731
725
|
|
|
@@ -756,7 +750,7 @@ export const subVenueRecipe: CorpusRecipe = {
|
|
|
756
750
|
english: leg.english,
|
|
757
751
|
}
|
|
758
752
|
|
|
759
|
-
const pools = await buildLegPools(leg, query, contextByCountry, { extractsDir,
|
|
753
|
+
const pools = await buildLegPools(leg, query, contextByCountry, { extractsDir, venueNames })
|
|
760
754
|
|
|
761
755
|
legPromoted.set(leg.locale, promoted)
|
|
762
756
|
legPools.set(leg.locale, pools)
|
|
@@ -42,8 +42,13 @@ import { SurfaceOrigin } from "#types"
|
|
|
42
42
|
function regionCodeSurface(cc: string, region: string): string | null {
|
|
43
43
|
const country = cc.toUpperCase()
|
|
44
44
|
|
|
45
|
+
// country-branch: the codex holds region codes for CA and US only.
|
|
46
|
+
// The WOF admin database's `place_abbr` holds codes for ten countries
|
|
47
|
+
// (IT, US, ES, MX, BR, CA, AU, AE, UA, AD), and an ISO 3166-2 table would cover every country.
|
|
48
|
+
// The tree holds neither as a lookup yet.
|
|
45
49
|
if (country === "CA") return lookupCanadianProvince(region)
|
|
46
50
|
|
|
51
|
+
// country-branch: see the CA branch above.
|
|
47
52
|
return country === "US" ? lookupUSState(region) : null
|
|
48
53
|
}
|
|
49
54
|
|
|
@@ -110,8 +115,7 @@ export const trailingRegionRecipe: CorpusRecipe = {
|
|
|
110
115
|
const placement = (t.postcodePlacement as PostcodePlacement | undefined) ?? "leading"
|
|
111
116
|
const bareLocality = postcode && placement === "after_locality" ? `${locality} ${postcode}` : locality
|
|
112
117
|
|
|
113
|
-
const localitySegment =
|
|
114
|
-
components["dependent_locality"] === undefined ? bareLocality : `${dependentLocality}, ${bareLocality}`
|
|
118
|
+
const localitySegment = components["dependent_locality"] ? `${dependentLocality}, ${bareLocality}` : bareLocality
|
|
115
119
|
|
|
116
120
|
// The code alternates with the region name rather than replacing it:
|
|
117
121
|
// both forms are posted and the resolver matches on the name.
|
package/lib/recipes/unit.ts
CHANGED
|
@@ -133,13 +133,13 @@ const tail = (random: () => number, loc: string, reg: string, pc: string): strin
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/**
|
|
136
|
-
* The identifier inside a rendered unit, or `
|
|
136
|
+
* The identifier inside a rendered unit, or `null` when a standalone designator
|
|
137
137
|
* or a letter-only id has none.
|
|
138
138
|
*/
|
|
139
|
-
function unitIdentifier(unit: string): string |
|
|
139
|
+
function unitIdentifier(unit: string): string | null {
|
|
140
140
|
const last = unit.replace(/^#\s*/, "").split(/\s+/).at(-1)
|
|
141
141
|
|
|
142
|
-
return last && /\d/.test(last) ? last :
|
|
142
|
+
return last && /\d/.test(last) ? last : null
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
// `full-comma-bare` writes the identifier with no designator at all, the one unit surface carrying no
|