@mailwoman/corpus 8.6.0 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/data/PROVENANCE.md +214 -0
- package/data/sub-venue-lexicon.json +18269 -0
- package/out/src/adapters/ban/adapter.d.ts +5 -4
- package/out/src/adapters/ban/adapter.d.ts.map +1 -1
- package/out/src/adapters/ban/adapter.js +62 -69
- package/out/src/adapters/ban/adapter.js.map +1 -1
- package/out/src/adapters/ban/street-decompose.d.ts.map +1 -1
- package/out/src/adapters/ban/street-decompose.js +18 -25
- package/out/src/adapters/ban/street-decompose.js.map +1 -1
- package/out/src/adapters/fcc-bdc/adapter.d.ts +1 -7
- package/out/src/adapters/fcc-bdc/adapter.d.ts.map +1 -1
- package/out/src/adapters/fcc-bdc/adapter.js +4 -26
- package/out/src/adapters/fcc-bdc/adapter.js.map +1 -1
- package/out/src/adapters/geonames/adapter.d.ts +1 -1
- package/out/src/adapters/geonames/adapter.d.ts.map +1 -1
- package/out/src/adapters/geonames/adapter.js +72 -78
- package/out/src/adapters/geonames/adapter.js.map +1 -1
- package/out/src/adapters/geonames-postal/adapter.d.ts +1 -1
- package/out/src/adapters/geonames-postal/adapter.d.ts.map +1 -1
- package/out/src/adapters/geonames-postal/adapter.js +46 -51
- package/out/src/adapters/geonames-postal/adapter.js.map +1 -1
- package/out/src/adapters/gnaf/adapter.d.ts +1 -1
- package/out/src/adapters/gnaf/adapter.d.ts.map +1 -1
- package/out/src/adapters/gnaf/adapter.js +6 -9
- package/out/src/adapters/gnaf/adapter.js.map +1 -1
- package/out/src/adapters/gnaf/assemble.d.ts.map +1 -1
- package/out/src/adapters/gnaf/assemble.js +7 -12
- package/out/src/adapters/gnaf/assemble.js.map +1 -1
- package/out/src/adapters/index.d.ts +1 -1
- package/out/src/adapters/index.d.ts.map +1 -1
- package/out/src/adapters/index.js +1 -1
- package/out/src/adapters/index.js.map +1 -1
- package/out/src/adapters/openaddresses/adapter.d.ts +1 -1
- package/out/src/adapters/openaddresses/adapter.d.ts.map +1 -1
- package/out/src/adapters/openaddresses/adapter.js +5 -10
- package/out/src/adapters/openaddresses/adapter.js.map +1 -1
- package/out/src/adapters/overture/adapter.d.ts +1 -1
- package/out/src/adapters/overture/adapter.d.ts.map +1 -1
- package/out/src/adapters/overture/adapter.js +5 -9
- package/out/src/adapters/overture/adapter.js.map +1 -1
- package/out/src/adapters/state-hi-schools/adapter.d.ts +1 -1
- package/out/src/adapters/state-hi-schools/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-hi-schools/adapter.js +57 -75
- package/out/src/adapters/state-hi-schools/adapter.js.map +1 -1
- package/out/src/adapters/state-ia-contractors/adapter.d.ts +1 -1
- package/out/src/adapters/state-ia-contractors/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-ia-contractors/adapter.js +60 -78
- package/out/src/adapters/state-ia-contractors/adapter.js.map +1 -1
- package/out/src/adapters/state-ny-notaries/adapter.d.ts +1 -1
- package/out/src/adapters/state-ny-notaries/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-ny-notaries/adapter.js +69 -87
- package/out/src/adapters/state-ny-notaries/adapter.js.map +1 -1
- package/out/src/adapters/state-tx-notaries/adapter.d.ts +1 -1
- package/out/src/adapters/state-tx-notaries/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-tx-notaries/adapter.js +71 -89
- package/out/src/adapters/state-tx-notaries/adapter.js.map +1 -1
- package/out/src/adapters/synth-po-box/adapter.d.ts +3 -3
- package/out/src/adapters/synth-po-box/adapter.d.ts.map +1 -1
- package/out/src/adapters/synth-po-box/adapter.js +10 -18
- package/out/src/adapters/synth-po-box/adapter.js.map +1 -1
- package/out/src/adapters/tiger/adapter.d.ts +1 -1
- package/out/src/adapters/tiger/adapter.d.ts.map +1 -1
- package/out/src/adapters/tiger/adapter.js +2 -2
- package/out/src/adapters/tiger/adapter.js.map +1 -1
- package/out/src/adapters/tiger/street-decompose.d.ts.map +1 -1
- package/out/src/adapters/tiger/street-decompose.js +18 -27
- package/out/src/adapters/tiger/street-decompose.js.map +1 -1
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts +4 -4
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.js +64 -82
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.js.map +1 -1
- package/out/src/adapters/usgov-imls-pls/adapter.d.ts +1 -1
- package/out/src/adapters/usgov-imls-pls/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-imls-pls/adapter.js +62 -84
- package/out/src/adapters/usgov-imls-pls/adapter.js.map +1 -1
- package/out/src/adapters/usgov-irs-bmf/adapter.d.ts +1 -1
- package/out/src/adapters/usgov-irs-bmf/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-irs-bmf/adapter.js +59 -66
- package/out/src/adapters/usgov-irs-bmf/adapter.js.map +1 -1
- package/out/src/adapters/usgov-nad/adapter.d.ts +1 -1
- package/out/src/adapters/usgov-nad/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-nad/adapter.js +6 -9
- package/out/src/adapters/usgov-nad/adapter.js.map +1 -1
- package/out/src/adapters/usgov-nppes/adapter.d.ts +1 -1
- package/out/src/adapters/usgov-nppes/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-nppes/adapter.js +60 -78
- package/out/src/adapters/usgov-nppes/adapter.js.map +1 -1
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.d.ts +1 -1
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.js +53 -73
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.js.map +1 -1
- package/out/src/{adapter.d.ts → adapters/utils/index.d.ts} +43 -2
- package/out/src/adapters/utils/index.d.ts.map +1 -0
- package/out/src/{adapter.js → adapters/utils/index.js} +47 -2
- package/out/src/adapters/utils/index.js.map +1 -0
- package/out/src/adapters/wof-admin-jp/adapter.d.ts +1 -1
- package/out/src/adapters/wof-admin-jp/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-admin-jp/adapter.js +24 -6
- package/out/src/adapters/wof-admin-jp/adapter.js.map +1 -1
- package/out/src/adapters/wof-admin-json/adapter.d.ts +2 -2
- package/out/src/adapters/wof-admin-json/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-admin-json/adapter.js +2 -2
- package/out/src/adapters/wof-admin-json/adapter.js.map +1 -1
- package/out/src/adapters/wof-postalcode-json/adapter.d.ts +2 -2
- package/out/src/adapters/wof-postalcode-json/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-postalcode-json/adapter.js +2 -2
- package/out/src/adapters/wof-postalcode-json/adapter.js.map +1 -1
- package/out/src/build.d.ts +3 -4
- package/out/src/build.d.ts.map +1 -1
- package/out/src/build.js +6 -8
- package/out/src/build.js.map +1 -1
- package/out/src/index.d.ts +3 -17
- package/out/src/index.d.ts.map +1 -1
- package/out/src/index.js +3 -17
- package/out/src/index.js.map +1 -1
- package/out/src/name-prone-us-suffixes.d.ts +12 -0
- package/out/src/name-prone-us-suffixes.d.ts.map +1 -0
- package/out/src/name-prone-us-suffixes.js +12 -0
- package/out/src/name-prone-us-suffixes.js.map +1 -0
- package/out/src/parquet-wrapper/reader.d.ts +8 -0
- package/out/src/parquet-wrapper/reader.d.ts.map +1 -1
- package/out/src/parquet-wrapper/reader.js +16 -0
- package/out/src/parquet-wrapper/reader.js.map +1 -1
- package/out/src/parquet-wrapper/schema.d.ts +4 -0
- package/out/src/parquet-wrapper/schema.d.ts.map +1 -1
- package/out/src/parquet-wrapper/schema.js.map +1 -1
- package/out/src/runner.d.ts +2 -2
- package/out/src/runner.d.ts.map +1 -1
- package/out/src/runner.js +1 -1
- package/out/src/runner.js.map +1 -1
- package/out/src/shard-recipes/anchor-absorption.d.ts.map +1 -1
- package/out/src/shard-recipes/anchor-absorption.js +5 -4
- package/out/src/shard-recipes/anchor-absorption.js.map +1 -1
- package/out/src/shard-recipes/boundary-stress.d.ts.map +1 -1
- package/out/src/shard-recipes/boundary-stress.js +2 -2
- package/out/src/shard-recipes/boundary-stress.js.map +1 -1
- package/out/src/shard-recipes/country-balanced.d.ts.map +1 -1
- package/out/src/shard-recipes/country-balanced.js +75 -75
- package/out/src/shard-recipes/country-balanced.js.map +1 -1
- package/out/src/shard-recipes/fr-admin-split.js +2 -2
- package/out/src/shard-recipes/fr-admin-split.js.map +1 -1
- package/out/src/shard-recipes/fr-fragment.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-fragment.js +8 -5
- package/out/src/shard-recipes/fr-fragment.js.map +1 -1
- package/out/src/shard-recipes/fr-lieudit.js +2 -2
- package/out/src/shard-recipes/fr-lieudit.js.map +1 -1
- package/out/src/shard-recipes/fr-order.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-order.js +18 -72
- package/out/src/shard-recipes/fr-order.js.map +1 -1
- package/out/src/shard-recipes/german.d.ts.map +1 -1
- package/out/src/shard-recipes/german.js +17 -70
- package/out/src/shard-recipes/german.js.map +1 -1
- package/out/src/shard-recipes/house-venue.d.ts.map +1 -1
- package/out/src/shard-recipes/house-venue.js +1 -1
- package/out/src/shard-recipes/house-venue.js.map +1 -1
- package/out/src/shard-recipes/index.d.ts.map +1 -1
- package/out/src/shard-recipes/index.js +4 -1
- package/out/src/shard-recipes/index.js.map +1 -1
- package/out/src/shard-recipes/intersection.d.ts +2 -2
- package/out/src/shard-recipes/intersection.d.ts.map +1 -1
- package/out/src/shard-recipes/intersection.js +28 -72
- package/out/src/shard-recipes/intersection.js.map +1 -1
- package/out/src/shard-recipes/locale.d.ts +5 -5
- package/out/src/shard-recipes/locale.d.ts.map +1 -1
- package/out/src/shard-recipes/locale.js +25 -35
- package/out/src/shard-recipes/locale.js.map +1 -1
- package/out/src/shard-recipes/no-fragment.d.ts.map +1 -1
- package/out/src/shard-recipes/no-fragment.js +8 -5
- package/out/src/shard-recipes/no-fragment.js.map +1 -1
- package/out/src/shard-recipes/no-street-led.d.ts.map +1 -1
- package/out/src/shard-recipes/no-street-led.js +8 -5
- package/out/src/shard-recipes/no-street-led.js.map +1 -1
- package/out/src/shard-recipes/no-street.d.ts.map +1 -1
- package/out/src/shard-recipes/no-street.js +1 -1
- package/out/src/shard-recipes/no-street.js.map +1 -1
- package/out/src/shard-recipes/po-box-cedex.d.ts +3 -3
- package/out/src/shard-recipes/po-box-cedex.d.ts.map +1 -1
- package/out/src/shard-recipes/po-box-cedex.js +101 -127
- package/out/src/shard-recipes/po-box-cedex.js.map +1 -1
- package/out/src/shard-recipes/po-box.d.ts.map +1 -1
- package/out/src/shard-recipes/po-box.js +1 -1
- package/out/src/shard-recipes/po-box.js.map +1 -1
- package/out/src/shard-recipes/scaffold.d.ts +58 -9
- package/out/src/shard-recipes/scaffold.d.ts.map +1 -1
- package/out/src/shard-recipes/scaffold.js +87 -29
- package/out/src/shard-recipes/scaffold.js.map +1 -1
- package/out/src/shard-recipes/street-affix.d.ts +54 -0
- package/out/src/shard-recipes/street-affix.d.ts.map +1 -1
- package/out/src/shard-recipes/street-affix.js +253 -111
- package/out/src/shard-recipes/street-affix.js.map +1 -1
- package/out/src/shard-recipes/street-bare.d.ts.map +1 -1
- package/out/src/shard-recipes/street-bare.js +3 -3
- package/out/src/shard-recipes/street-bare.js.map +1 -1
- package/out/src/shard-recipes/street.d.ts.map +1 -1
- package/out/src/shard-recipes/street.js +2 -2
- package/out/src/shard-recipes/street.js.map +1 -1
- package/out/src/shard-recipes/sub-venue-sources.d.ts +228 -0
- package/out/src/shard-recipes/sub-venue-sources.d.ts.map +1 -0
- package/out/src/shard-recipes/sub-venue-sources.js +664 -0
- package/out/src/shard-recipes/sub-venue-sources.js.map +1 -0
- package/out/src/shard-recipes/sub-venue.d.ts +269 -0
- package/out/src/shard-recipes/sub-venue.d.ts.map +1 -0
- package/out/src/shard-recipes/sub-venue.js +709 -0
- package/out/src/shard-recipes/sub-venue.js.map +1 -0
- package/out/src/shard-recipes/unit.d.ts +1 -1
- package/out/src/shard-recipes/unit.d.ts.map +1 -1
- package/out/src/shard-recipes/unit.js +26 -74
- package/out/src/shard-recipes/unit.js.map +1 -1
- package/out/src/{synthesize-anchor-absorption.d.ts → synthesizers/anchor-absorption.d.ts} +1 -1
- package/out/src/synthesizers/anchor-absorption.d.ts.map +1 -0
- package/out/src/{synthesize-anchor-absorption.js → synthesizers/anchor-absorption.js} +1 -1
- package/out/src/synthesizers/anchor-absorption.js.map +1 -0
- package/out/src/{synthesize-boundary-stress.d.ts → synthesizers/boundary-stress.d.ts} +3 -3
- package/out/src/synthesizers/boundary-stress.d.ts.map +1 -0
- package/out/src/{synthesize-boundary-stress.js → synthesizers/boundary-stress.js} +2 -2
- package/out/src/synthesizers/boundary-stress.js.map +1 -0
- package/out/src/{synthesize-german.d.ts → synthesizers/german.d.ts} +2 -2
- package/out/src/synthesizers/german.d.ts.map +1 -0
- package/out/src/{synthesize-german.js → synthesizers/german.js} +2 -2
- package/out/src/synthesizers/german.js.map +1 -0
- package/out/src/{synthesize-house-venue.d.ts → synthesizers/house-venue.d.ts} +4 -4
- package/out/src/synthesizers/house-venue.d.ts.map +1 -0
- package/out/src/{synthesize-house-venue.js → synthesizers/house-venue.js} +4 -4
- package/out/src/synthesizers/house-venue.js.map +1 -0
- package/out/src/{synthesize-intersection.d.ts → synthesizers/intersection.d.ts} +2 -2
- package/out/src/synthesizers/intersection.d.ts.map +1 -0
- package/out/src/{synthesize-intersection.js → synthesizers/intersection.js} +1 -1
- package/out/src/synthesizers/intersection.js.map +1 -0
- package/out/src/{synthesize-no-street.d.ts → synthesizers/no-street.d.ts} +3 -3
- package/out/src/synthesizers/no-street.d.ts.map +1 -0
- package/out/src/{synthesize-no-street.js → synthesizers/no-street.js} +2 -2
- package/out/src/synthesizers/no-street.js.map +1 -0
- package/out/src/{synthesize-po-box.d.ts → synthesizers/po-box.d.ts} +2 -2
- package/out/src/synthesizers/po-box.d.ts.map +1 -0
- package/out/src/{synthesize-po-box.js → synthesizers/po-box.js} +1 -1
- package/out/src/synthesizers/po-box.js.map +1 -0
- package/out/src/{synthesize-street.d.ts → synthesizers/street.d.ts} +2 -2
- package/out/src/synthesizers/street.d.ts.map +1 -0
- package/out/src/{synthesize-street.js → synthesizers/street.js} +2 -2
- package/out/src/synthesizers/street.js.map +1 -0
- package/out/src/{synthesize.d.ts → synthesizers/utils.d.ts} +3 -3
- package/out/src/synthesizers/utils.d.ts.map +1 -0
- package/out/src/{synthesize.js → synthesizers/utils.js} +4 -15
- package/out/src/synthesizers/utils.js.map +1 -0
- package/out/src/tools/align-shard.d.ts.map +1 -1
- package/out/src/tools/align-shard.js +4 -8
- package/out/src/tools/align-shard.js.map +1 -1
- package/out/src/tools/audit.d.ts.map +1 -1
- package/out/src/tools/audit.js +4 -4
- package/out/src/tools/audit.js.map +1 -1
- package/out/src/tools/corpus-stats.d.ts +2 -2
- package/out/src/tools/corpus-stats.d.ts.map +1 -1
- package/out/src/tools/corpus-stats.js +18 -31
- package/out/src/tools/corpus-stats.js.map +1 -1
- package/out/src/tools/fetch/download.d.ts.map +1 -1
- package/out/src/tools/fetch/download.js +5 -6
- package/out/src/tools/fetch/download.js.map +1 -1
- package/out/src/tools/fetch/imls-pls.d.ts.map +1 -1
- package/out/src/tools/fetch/imls-pls.js +3 -15
- package/out/src/tools/fetch/imls-pls.js.map +1 -1
- package/out/src/tools/fetch/index.d.ts +14 -1
- package/out/src/tools/fetch/index.d.ts.map +1 -1
- package/out/src/tools/fetch/index.js +14 -1
- package/out/src/tools/fetch/index.js.map +1 -1
- package/out/src/tools/fetch/nad.d.ts +1 -1
- package/out/src/tools/fetch/nad.js +1 -1
- package/out/src/tools/fetch/nppes.d.ts.map +1 -1
- package/out/src/tools/fetch/nppes.js +8 -14
- package/out/src/tools/fetch/nppes.js.map +1 -1
- package/out/src/tools/fetch/openaddresses.d.ts +1 -1
- package/out/src/tools/fetch/openaddresses.js +1 -1
- package/out/src/tools/fetch/ourairports.d.ts +45 -0
- package/out/src/tools/fetch/ourairports.d.ts.map +1 -0
- package/out/src/tools/fetch/ourairports.js +123 -0
- package/out/src/tools/fetch/ourairports.js.map +1 -0
- package/out/src/tools/fetch/wikidata-subvenue.d.ts +171 -0
- package/out/src/tools/fetch/wikidata-subvenue.d.ts.map +1 -0
- package/out/src/tools/fetch/wikidata-subvenue.js +275 -0
- package/out/src/tools/fetch/wikidata-subvenue.js.map +1 -0
- package/out/src/tools/golden-expand.d.ts.map +1 -1
- package/out/src/tools/golden-expand.js +18 -16
- package/out/src/tools/golden-expand.js.map +1 -1
- package/out/src/tools/golden-promote.d.ts.map +1 -1
- package/out/src/tools/golden-promote.js +12 -6
- package/out/src/tools/golden-promote.js.map +1 -1
- package/out/src/tools/golden-relabel-street.d.ts +196 -0
- package/out/src/tools/golden-relabel-street.d.ts.map +1 -0
- package/out/src/tools/golden-relabel-street.js +440 -0
- package/out/src/tools/golden-relabel-street.js.map +1 -0
- package/out/src/tools/index.d.ts +4 -0
- package/out/src/tools/index.d.ts.map +1 -1
- package/out/src/tools/index.js +4 -0
- package/out/src/tools/index.js.map +1 -1
- package/out/src/tools/jsonl-to-parquet.d.ts.map +1 -1
- package/out/src/tools/jsonl-to-parquet.js +3 -2
- package/out/src/tools/jsonl-to-parquet.js.map +1 -1
- package/out/src/tools/lint-shard-vocab.d.ts.map +1 -1
- package/out/src/tools/lint-shard-vocab.js +3 -2
- package/out/src/tools/lint-shard-vocab.js.map +1 -1
- package/out/src/tools/lint-shard.d.ts +3 -3
- package/out/src/tools/lint-shard.d.ts.map +1 -1
- package/out/src/tools/lint-shard.js +23 -32
- package/out/src/tools/lint-shard.js.map +1 -1
- package/out/src/tools/overlay-manifest.d.ts.map +1 -1
- package/out/src/tools/overlay-manifest.js +2 -1
- package/out/src/tools/overlay-manifest.js.map +1 -1
- package/out/src/tools/overture-subvenue.d.ts +112 -0
- package/out/src/tools/overture-subvenue.d.ts.map +1 -0
- package/out/src/tools/overture-subvenue.js +144 -0
- package/out/src/tools/overture-subvenue.js.map +1 -0
- package/out/src/tools/shard-kryptonite.d.ts +1 -1
- package/out/src/tools/shard-kryptonite.d.ts.map +1 -1
- package/out/src/tools/shard-kryptonite.js +6 -6
- package/out/src/tools/shard-kryptonite.js.map +1 -1
- package/out/src/tools/shard-translit.d.ts +6 -3
- package/out/src/tools/shard-translit.d.ts.map +1 -1
- package/out/src/tools/shard-translit.js +9 -8
- package/out/src/tools/shard-translit.js.map +1 -1
- package/out/src/tools/sub-venue-lexicon.d.ts +507 -0
- package/out/src/tools/sub-venue-lexicon.d.ts.map +1 -0
- package/out/src/tools/sub-venue-lexicon.js +817 -0
- package/out/src/tools/sub-venue-lexicon.js.map +1 -0
- package/out/src/tools/sub-venue-promotions.d.ts +94 -0
- package/out/src/tools/sub-venue-promotions.d.ts.map +1 -0
- package/out/src/tools/sub-venue-promotions.js +266 -0
- package/out/src/tools/sub-venue-promotions.js.map +1 -0
- package/out/src/{align.d.ts → utils/align.d.ts} +1 -1
- package/out/src/utils/align.d.ts.map +1 -0
- package/out/src/utils/align.js.map +1 -0
- package/out/src/{golden.d.ts → utils/golden.d.ts} +5 -0
- package/out/src/utils/golden.d.ts.map +1 -0
- package/out/src/{golden.js → utils/golden.js} +24 -10
- package/out/src/utils/golden.js.map +1 -0
- package/out/src/utils/index.d.ts +14 -0
- package/out/src/utils/index.d.ts.map +1 -0
- package/out/src/utils/index.js +14 -0
- package/out/src/utils/index.js.map +1 -0
- package/out/src/utils/license.d.ts.map +1 -0
- package/out/src/utils/license.js.map +1 -0
- package/out/src/{parquet.d.ts → utils/parquet.d.ts} +2 -2
- package/out/src/utils/parquet.d.ts.map +1 -0
- package/out/src/{parquet.js → utils/parquet.js} +3 -15
- package/out/src/utils/parquet.js.map +1 -0
- package/out/src/{split.d.ts → utils/split.d.ts} +8 -1
- package/out/src/utils/split.d.ts.map +1 -0
- package/out/src/{split.js → utils/split.js} +7 -0
- package/out/src/utils/split.js.map +1 -0
- package/out/src/utils/tokenize.d.ts.map +1 -0
- package/out/src/utils/tokenize.js.map +1 -0
- package/out/src/{wof-json.d.ts → utils/wof-json.d.ts} +2 -2
- package/out/src/utils/wof-json.d.ts.map +1 -0
- package/out/src/{wof-json.js → utils/wof-json.js} +5 -8
- package/out/src/utils/wof-json.js.map +1 -0
- package/package.json +66 -20
- package/src/adapters/ban/adapter.ts +58 -68
- package/src/adapters/ban/street-decompose.ts +17 -25
- package/src/adapters/fcc-bdc/adapter.ts +5 -36
- package/src/adapters/geonames/adapter.ts +67 -76
- package/src/adapters/geonames-postal/adapter.ts +45 -54
- package/src/adapters/gnaf/adapter.ts +7 -11
- package/src/adapters/gnaf/assemble.ts +7 -11
- package/src/adapters/index.ts +3 -2
- package/src/adapters/openaddresses/adapter.ts +6 -12
- package/src/adapters/overture/adapter.ts +6 -10
- package/src/adapters/state-hi-schools/adapter.ts +53 -77
- package/src/adapters/state-ia-contractors/adapter.ts +55 -80
- package/src/adapters/state-ny-notaries/adapter.ts +64 -89
- package/src/adapters/state-tx-notaries/adapter.ts +63 -88
- package/src/adapters/synth-po-box/adapter.ts +12 -23
- package/src/adapters/tiger/adapter.ts +4 -3
- package/src/adapters/tiger/street-decompose.ts +21 -31
- package/src/adapters/usgov-hrsa-fqhc/adapter.ts +64 -88
- package/src/adapters/usgov-imls-pls/adapter.ts +57 -86
- package/src/adapters/usgov-irs-bmf/adapter.ts +55 -66
- package/src/adapters/usgov-nad/adapter.ts +7 -11
- package/src/adapters/usgov-nppes/adapter.ts +54 -79
- package/src/adapters/usgov-samhsa-treatment-locator/adapter.ts +48 -75
- package/src/{adapter.ts → adapters/utils/index.ts} +59 -3
- package/src/adapters/wof-admin-jp/adapter.ts +35 -9
- package/src/adapters/wof-admin-json/adapter.ts +3 -4
- package/src/adapters/wof-postalcode-json/adapter.ts +3 -4
- package/src/build.ts +12 -11
- package/src/index.ts +3 -17
- package/src/name-prone-us-suffixes.ts +12 -0
- package/src/parquet-wrapper/reader.ts +19 -0
- package/src/parquet-wrapper/schema.ts +4 -0
- package/src/runner.ts +7 -2
- package/src/shard-recipes/anchor-absorption.ts +5 -4
- package/src/shard-recipes/boundary-stress.ts +6 -2
- package/src/shard-recipes/country-balanced.ts +77 -91
- package/src/shard-recipes/fr-admin-split.ts +3 -3
- package/src/shard-recipes/fr-fragment.ts +10 -7
- package/src/shard-recipes/fr-lieudit.ts +3 -3
- package/src/shard-recipes/fr-order.ts +18 -83
- package/src/shard-recipes/german.ts +17 -80
- package/src/shard-recipes/house-venue.ts +2 -1
- package/src/shard-recipes/index.ts +4 -1
- package/src/shard-recipes/intersection.ts +37 -74
- package/src/shard-recipes/locale.ts +31 -39
- package/src/shard-recipes/no-fragment.ts +10 -7
- package/src/shard-recipes/no-street-led.ts +10 -7
- package/src/shard-recipes/no-street.ts +2 -1
- package/src/shard-recipes/po-box-cedex.ts +127 -161
- package/src/shard-recipes/po-box.ts +6 -1
- package/src/shard-recipes/scaffold.ts +125 -27
- package/src/shard-recipes/street-affix.ts +335 -134
- package/src/shard-recipes/street-bare.ts +4 -3
- package/src/shard-recipes/street.ts +3 -2
- package/src/shard-recipes/sub-venue-sources.ts +895 -0
- package/src/shard-recipes/sub-venue.ts +982 -0
- package/src/shard-recipes/unit.ts +27 -85
- package/src/{synthesize-boundary-stress.ts → synthesizers/boundary-stress.ts} +2 -2
- package/src/{synthesize-german.ts → synthesizers/german.ts} +2 -2
- package/src/{synthesize-house-venue.ts → synthesizers/house-venue.ts} +4 -4
- package/src/{synthesize-intersection.ts → synthesizers/intersection.ts} +1 -1
- package/src/{synthesize-no-street.ts → synthesizers/no-street.ts} +2 -2
- package/src/{synthesize-po-box.ts → synthesizers/po-box.ts} +1 -1
- package/src/{synthesize-street.ts → synthesizers/street.ts} +2 -2
- package/src/{synthesize.ts → synthesizers/utils.ts} +4 -18
- package/src/tools/align-shard.ts +4 -7
- package/src/tools/audit.ts +6 -5
- package/src/tools/corpus-stats.ts +25 -33
- package/src/tools/fetch/download.ts +7 -5
- package/src/tools/fetch/imls-pls.ts +4 -18
- package/src/tools/fetch/index.ts +14 -1
- package/src/tools/fetch/nad.ts +1 -1
- package/src/tools/fetch/nppes.ts +9 -16
- package/src/tools/fetch/openaddresses.ts +1 -1
- package/src/tools/fetch/ourairports.ts +166 -0
- package/src/tools/fetch/wikidata-subvenue.ts +386 -0
- package/src/tools/golden-expand.ts +18 -13
- package/src/tools/golden-promote.ts +15 -6
- package/src/tools/golden-relabel-street.ts +685 -0
- package/src/tools/index.ts +4 -0
- package/src/tools/jsonl-to-parquet.ts +3 -2
- package/src/tools/lint-shard-vocab.ts +3 -2
- package/src/tools/lint-shard.ts +33 -36
- package/src/tools/overlay-manifest.ts +2 -1
- package/src/tools/overture-subvenue.ts +215 -0
- package/src/tools/shard-kryptonite.ts +8 -9
- package/src/tools/shard-translit.ts +22 -11
- package/src/tools/sub-venue-lexicon.ts +1250 -0
- package/src/tools/sub-venue-promotions.ts +330 -0
- package/src/{align.ts → utils/align.ts} +1 -1
- package/src/{golden.ts → utils/golden.ts} +25 -11
- package/src/utils/index.ts +14 -0
- package/src/{parquet.ts → utils/parquet.ts} +5 -19
- package/src/{split.ts → utils/split.ts} +8 -2
- package/src/{wof-json.ts → utils/wof-json.ts} +5 -8
- package/out/src/adapter.d.ts.map +0 -1
- package/out/src/adapter.js.map +0 -1
- package/out/src/align.d.ts.map +0 -1
- package/out/src/align.js.map +0 -1
- package/out/src/format.d.ts +0 -14
- package/out/src/format.d.ts.map +0 -1
- package/out/src/format.js +0 -14
- package/out/src/format.js.map +0 -1
- package/out/src/golden.d.ts.map +0 -1
- package/out/src/golden.js.map +0 -1
- package/out/src/license.d.ts.map +0 -1
- package/out/src/license.js.map +0 -1
- package/out/src/parquet.d.ts.map +0 -1
- package/out/src/parquet.js.map +0 -1
- package/out/src/split.d.ts.map +0 -1
- package/out/src/split.js.map +0 -1
- package/out/src/synthesize-anchor-absorption.d.ts.map +0 -1
- package/out/src/synthesize-anchor-absorption.js.map +0 -1
- package/out/src/synthesize-boundary-stress.d.ts.map +0 -1
- package/out/src/synthesize-boundary-stress.js.map +0 -1
- package/out/src/synthesize-german.d.ts.map +0 -1
- package/out/src/synthesize-german.js.map +0 -1
- package/out/src/synthesize-house-venue.d.ts.map +0 -1
- package/out/src/synthesize-house-venue.js.map +0 -1
- package/out/src/synthesize-intersection.d.ts.map +0 -1
- package/out/src/synthesize-intersection.js.map +0 -1
- package/out/src/synthesize-no-street.d.ts.map +0 -1
- package/out/src/synthesize-no-street.js.map +0 -1
- package/out/src/synthesize-po-box.d.ts.map +0 -1
- package/out/src/synthesize-po-box.js.map +0 -1
- package/out/src/synthesize-street.d.ts.map +0 -1
- package/out/src/synthesize-street.js.map +0 -1
- package/out/src/synthesize.d.ts.map +0 -1
- package/out/src/synthesize.js.map +0 -1
- package/out/src/tokenize.d.ts.map +0 -1
- package/out/src/tokenize.js.map +0 -1
- package/out/src/wof-json.d.ts.map +0 -1
- package/out/src/wof-json.js.map +0 -1
- package/src/format.ts +0 -14
- /package/out/src/{align.js → utils/align.js} +0 -0
- /package/out/src/{license.d.ts → utils/license.d.ts} +0 -0
- /package/out/src/{license.js → utils/license.js} +0 -0
- /package/out/src/{tokenize.d.ts → utils/tokenize.d.ts} +0 -0
- /package/out/src/{tokenize.js → utils/tokenize.js} +0 -0
- /package/src/{synthesize-anchor-absorption.ts → synthesizers/anchor-absorption.ts} +0 -0
- /package/src/{license.ts → utils/license.ts} +0 -0
- /package/src/{tokenize.ts → utils/tokenize.ts} +0 -0
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
* External inputs (`--edges-dir`, opts.edgesDir; both already on disk — do not re-download):
|
|
31
31
|
*
|
|
32
32
|
* - <edges-dir>/tl_2023_{17031,34027,50023}_edges.shp (unzipped TIGER 2023 EDGES; default
|
|
33
|
-
* /
|
|
34
|
-
* - /
|
|
33
|
+
* `$MAILWOMAN_DATA_ROOT/census/tiger2023-edges`, where `mailwoman situs interpolation` puts them)
|
|
34
|
+
* - `$MAILWOMAN_DATA_ROOT/oa-cache/us__il__cook.zip` (ZIP→city tails)
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
import { spawnSync } from "node:child_process"
|
|
38
37
|
import { existsSync, readFileSync, writeFileSync } from "node:fs"
|
|
39
38
|
|
|
40
39
|
import type { DuckDBConnection } from "@duckdb/node-api"
|
|
41
40
|
import type { ComponentTag } from "@mailwoman/core/types"
|
|
42
|
-
import { repoRootPath } from "@mailwoman/core/utils"
|
|
41
|
+
import { dataRootPath, repoRootPath } from "@mailwoman/core/utils"
|
|
42
|
+
import { stableSourceID } from "@mailwoman/corpus/adapters/utils"
|
|
43
|
+
import type { CanonicalRow, LabeledRow } from "@mailwoman/corpus/types"
|
|
44
|
+
import { alignRow } from "@mailwoman/corpus/utils"
|
|
45
|
+
import { JSONSpliterator } from "spliterator"
|
|
43
46
|
|
|
44
|
-
import {
|
|
45
|
-
import { alignRow } from "../align.ts"
|
|
46
|
-
import type { CanonicalRow, LabeledRow } from "../types.ts"
|
|
47
|
-
import { makeMulberry32, type ShardRecipe } from "./scaffold.ts"
|
|
47
|
+
import { makeMulberry32, readZippedCSVRecords, type ShardRecipe } from "./scaffold.ts"
|
|
48
48
|
|
|
49
49
|
interface County {
|
|
50
50
|
fips: string
|
|
@@ -60,7 +60,13 @@ const TRAIN_COUNTIES: readonly County[] = [
|
|
|
60
60
|
const GOLDEN_COUNTIES: readonly County[] = [{ fips: "50023", state: "VT", regime: "rural" }]
|
|
61
61
|
|
|
62
62
|
const EVAL_GOLD_PATH = repoRootPath("data", "eval", "external", "intersection-real.jsonl")
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Where `mailwoman situs interpolation` unpacks the per-county TIGER EDGES shapefiles — a Census download, so it sits
|
|
65
|
+
* beside the other Census vintages under `census/`. `--edges-dir` overrides it.
|
|
66
|
+
*/
|
|
67
|
+
const DEFAULT_EDGES_DIR = dataRootPath("census", "tiger2023-edges")
|
|
68
|
+
|
|
69
|
+
const OA_COOK = { zip: dataRootPath("oa-cache", "us__il__cook.zip"), csv: "us/il/cook.csv" }
|
|
64
70
|
|
|
65
71
|
/**
|
|
66
72
|
* One real crossing extracted from a county's TIGER EDGES shapefile.
|
|
@@ -157,52 +163,22 @@ function weightedPick<T extends { w: number }>(items: readonly T[], random: () =
|
|
|
157
163
|
}
|
|
158
164
|
|
|
159
165
|
/**
|
|
160
|
-
*
|
|
166
|
+
* Order-insensitive crossing key, for eval-leakage exclusion + pair dedup.
|
|
161
167
|
*/
|
|
162
|
-
|
|
163
|
-
const out: string[] = []
|
|
164
|
-
let cur = ""
|
|
165
|
-
let inQ = false
|
|
166
|
-
|
|
167
|
-
for (let i = 0; i < line.length; i++) {
|
|
168
|
-
const c = line[i]
|
|
169
|
-
|
|
170
|
-
if (inQ) {
|
|
171
|
-
if (c === '"') {
|
|
172
|
-
if (line[i + 1] === '"') {
|
|
173
|
-
cur += '"'
|
|
174
|
-
|
|
175
|
-
i++
|
|
176
|
-
} else {
|
|
177
|
-
inQ = false
|
|
178
|
-
}
|
|
179
|
-
} else {
|
|
180
|
-
cur += c
|
|
181
|
-
}
|
|
182
|
-
} else if (c === '"') {
|
|
183
|
-
inQ = true
|
|
184
|
-
} else if (c === ",") {
|
|
185
|
-
out.push(cur)
|
|
186
|
-
cur = ""
|
|
187
|
-
} else {
|
|
188
|
-
cur += c
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
out.push(cur)
|
|
193
|
-
|
|
194
|
-
return out
|
|
195
|
-
}
|
|
168
|
+
const pairKey = (a: string, b: string): string => [a.toLowerCase(), b.toLowerCase()].toSorted().join("\u001F")
|
|
196
169
|
|
|
197
170
|
/**
|
|
198
|
-
*
|
|
171
|
+
* One row of the intersection eval gold — the shape this recipe reads to exclude eval crossings.
|
|
199
172
|
*/
|
|
200
|
-
|
|
173
|
+
interface EvalGoldRow {
|
|
174
|
+
node: number | string
|
|
175
|
+
components: { intersection_a: string; intersection_b: string }
|
|
176
|
+
}
|
|
201
177
|
|
|
202
178
|
/**
|
|
203
179
|
* Load the eval's crossings so neither train nor golden ever sees them.
|
|
204
180
|
*/
|
|
205
|
-
function readEvalExclusions(): { nodes: Set<number>; pairs: Set<string> } {
|
|
181
|
+
async function readEvalExclusions(): Promise<{ nodes: Set<number>; pairs: Set<string> }> {
|
|
206
182
|
const nodes = new Set<number>()
|
|
207
183
|
const pairs = new Set<string>()
|
|
208
184
|
|
|
@@ -212,9 +188,7 @@ function readEvalExclusions(): { nodes: Set<number>; pairs: Set<string> } {
|
|
|
212
188
|
return { nodes, pairs }
|
|
213
189
|
}
|
|
214
190
|
|
|
215
|
-
for (const
|
|
216
|
-
if (!line) continue
|
|
217
|
-
const row = JSON.parse(line)
|
|
191
|
+
for await (const row of JSONSpliterator.fromAsync<EvalGoldRow>(EVAL_GOLD_PATH)) {
|
|
218
192
|
nodes.add(Number(row.node))
|
|
219
193
|
pairs.add(pairKey(row.components.intersection_a, row.components.intersection_b))
|
|
220
194
|
}
|
|
@@ -276,29 +250,13 @@ async function extractCrossings(
|
|
|
276
250
|
/**
|
|
277
251
|
* ZIP → majority city from the cached OA Cook-county CSV (real ZIP/city pairings).
|
|
278
252
|
*/
|
|
279
|
-
function buildZipCityMap(): Map<string, string
|
|
280
|
-
const r = spawnSync("unzip", ["-p", OA_COOK.zip, OA_COOK.csv], { maxBuffer: 1024 * 1024 * 1024, encoding: "buffer" })
|
|
281
|
-
|
|
282
|
-
if (r.status !== 0) {
|
|
283
|
-
console.error(` WARN: unzip failed for ${OA_COOK.zip} — city tails disabled`)
|
|
284
|
-
|
|
285
|
-
return new Map()
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const lines = r.stdout.toString("utf8").split(/\r?\n/)
|
|
289
|
-
|
|
290
|
-
if (lines.length < 2) return new Map()
|
|
291
|
-
const header = splitCSV(lines[0]!).map((h) => h.trim().toLowerCase())
|
|
292
|
-
const iCity = header.indexOf("city")
|
|
293
|
-
const iPost = header.indexOf("postcode")
|
|
253
|
+
async function buildZipCityMap(): Promise<Map<string, string>> {
|
|
294
254
|
const counts = new Map<string, Map<string, number>>()
|
|
295
255
|
|
|
296
256
|
// zip → Map(city → n)
|
|
297
|
-
for (
|
|
298
|
-
|
|
299
|
-
const
|
|
300
|
-
const city = (cells[iCity] ?? "").trim()
|
|
301
|
-
const zip = (cells[iPost] ?? "").trim()
|
|
257
|
+
for await (const row of readZippedCSVRecords(OA_COOK.zip, OA_COOK.csv)) {
|
|
258
|
+
const city = row.city ?? ""
|
|
259
|
+
const zip = row.postcode ?? ""
|
|
302
260
|
|
|
303
261
|
if (!city || !/^\d{5}$/.test(zip) || BAD_NAME.test(city)) continue
|
|
304
262
|
let byCity = counts.get(zip)
|
|
@@ -486,15 +444,20 @@ export const intersectionRecipe: ShardRecipe = {
|
|
|
486
444
|
name: "intersection",
|
|
487
445
|
description: "Real-pair intersection rows (US): TIGER 2023 EDGES crossings → audited intersection_a/b labels",
|
|
488
446
|
mode: "generate",
|
|
489
|
-
options: [
|
|
447
|
+
options: [
|
|
448
|
+
{
|
|
449
|
+
flag: "--edges-dir <dir>",
|
|
450
|
+
description: `Unzipped TIGER 2023 EDGES dir. Default ${DEFAULT_EDGES_DIR}`,
|
|
451
|
+
},
|
|
452
|
+
],
|
|
490
453
|
async run(opts, write) {
|
|
491
454
|
// Legacy build-intersection-shard.mjs seeded `mulberry32(opts.seed)`.
|
|
492
455
|
const random = makeMulberry32(opts.seed)
|
|
493
456
|
const count = opts.count ?? 40_000
|
|
494
457
|
const source = opts.sourceName ?? "synth-intersection"
|
|
495
|
-
const edgesDir = opts.edgesDir ??
|
|
458
|
+
const edgesDir = opts.edgesDir ?? DEFAULT_EDGES_DIR
|
|
496
459
|
const counties = opts.golden ? GOLDEN_COUNTIES : TRAIN_COUNTIES
|
|
497
|
-
const exclusions = readEvalExclusions()
|
|
460
|
+
const exclusions = await readEvalExclusions()
|
|
498
461
|
|
|
499
462
|
console.error(` eval exclusions: ${exclusions.nodes.size} nodes, ${exclusions.pairs.size} pairs`)
|
|
500
463
|
|
|
@@ -546,7 +509,7 @@ export const intersectionRecipe: ShardRecipe = {
|
|
|
546
509
|
throw new Error(`No crossings found — are the TIGER EDGES shapefiles present in ${edgesDir}?`)
|
|
547
510
|
}
|
|
548
511
|
|
|
549
|
-
const zipCity = opts.golden ? new Map<string, string>() : buildZipCityMap()
|
|
512
|
+
const zipCity = opts.golden ? new Map<string, string>() : await buildZipCityMap()
|
|
550
513
|
|
|
551
514
|
if (!opts.golden) {
|
|
552
515
|
console.error(` zip→city map: ${zipCity.size} ZIPs (OA Cook)`)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* OpenAddresses tuples for a `--country` (DE/FR/NL/IT/ES), renders each via
|
|
8
8
|
* {@link synthesizeLocaleRow} in BOTH orders (`--intl-fraction`, default 0.4 international / the
|
|
9
9
|
* rest country-native), aligns to BIO, and emits a labeled JSONL. Generate-mode: it STREAMS each
|
|
10
|
-
* source CSV (
|
|
10
|
+
* source CSV (a streamed zip member for cached zips, plain `createReadStream` for extracted CSVs) and
|
|
11
11
|
* reservoir-samples to {@link RESERVOIR_CAP} (so FR/ES countrywide work in bounded memory), then
|
|
12
12
|
* draws `--count` rows from the pool with the passed `random`. Ported from
|
|
13
13
|
* scripts/build-locale-shard.mjs.
|
|
@@ -25,21 +25,25 @@
|
|
|
25
25
|
* country, so DE/FR emit streams are unchanged for a given seed.
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import { spawn } from "node:child_process"
|
|
29
28
|
import { createReadStream } from "node:fs"
|
|
30
29
|
|
|
31
30
|
import { COUNTRY_SURFACE_FORMS } from "@mailwoman/codex/country"
|
|
31
|
+
import { readZipEntry } from "@mailwoman/core/fs/zip"
|
|
32
32
|
import { dataRootPath } from "@mailwoman/core/utils"
|
|
33
|
+
import { stableSourceID } from "@mailwoman/corpus/adapters/utils"
|
|
34
|
+
import {
|
|
35
|
+
type LocaleBaseTuple,
|
|
36
|
+
type SynthesizedLocaleRow,
|
|
37
|
+
synthesizeLocaleRow,
|
|
38
|
+
} from "@mailwoman/corpus/synthesizers/german"
|
|
39
|
+
import { alignRow } from "@mailwoman/corpus/utils"
|
|
33
40
|
import { CSVSpliterator } from "spliterator"
|
|
34
41
|
|
|
35
|
-
import { stableSourceID } from "../adapter.ts"
|
|
36
|
-
import { alignRow } from "../align.ts"
|
|
37
|
-
import { type LocaleBaseTuple, type SynthesizedLocaleRow, synthesizeLocaleRow } from "../synthesize-german.ts"
|
|
38
42
|
import { makeMulberry32, type ShardRecipe } from "./scaffold.ts"
|
|
39
43
|
|
|
40
44
|
/**
|
|
41
|
-
* One per-country OA source part: either a cached `zip` + `csv` member (streamed
|
|
42
|
-
* `path` (streamed via `createReadStream`). Both carry the standard OA header
|
|
45
|
+
* One per-country OA source part: either a cached `zip` + `csv` member (streamed out of the archive) or an extracted
|
|
46
|
+
* plain `path` (streamed via `createReadStream`). Both carry the standard OA header
|
|
43
47
|
* (LON,LAT,NUMBER,STREET,UNIT,CITY,DISTRICT,REGION,POSTCODE,ID,HASH). An optional `region` fallback covers countries
|
|
44
48
|
* whose REGION column is empty (DE — the Bundesland is implied by the per-state file).
|
|
45
49
|
*/
|
|
@@ -86,26 +90,26 @@ export interface LocaleCountrySource {
|
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
/**
|
|
89
|
-
* Per-country OA sources + the source name used in the corpus. DE/FR
|
|
90
|
-
*
|
|
91
|
-
* IT the cached national zip under `$MAILWOMAN_DATA_ROOT` (#241; the fresh ES extract is
|
|
92
|
-
* raw-CNIG conform map is gone). DE carries a per-part `region` fallback (its REGION column is
|
|
93
|
-
* international-order tail needs it, #327). FR/NL/IT/ES REGION is populated per-row (ES = comunidad
|
|
94
|
-
* regione, NL = province).
|
|
93
|
+
* Per-country OA sources + the source name used in the corpus. DE/FR read their historical build inputs, the cached
|
|
94
|
+
* zips under `$MAILWOMAN_DATA_ROOT/oa-cache` — materialize them there to regenerate. ES/NL read the extracted
|
|
95
|
+
* countrywide CSVs and IT the cached national zip under `$MAILWOMAN_DATA_ROOT` (#241; the fresh ES extract is
|
|
96
|
+
* OA-conformed, so the old raw-CNIG conform map is gone). DE carries a per-part `region` fallback (its REGION column is
|
|
97
|
+
* empty; the international-order tail needs it, #327). FR/NL/IT/ES REGION is populated per-row (ES = comunidad
|
|
98
|
+
* autónoma, IT = regione, NL = province).
|
|
95
99
|
*/
|
|
96
100
|
const COUNTRY_SOURCES: Record<string, LocaleCountrySource> = {
|
|
97
101
|
DE: {
|
|
98
102
|
source: "synth-german",
|
|
99
103
|
corpusVersion: "0.4.0",
|
|
100
104
|
parts: [
|
|
101
|
-
{ zip: "
|
|
102
|
-
{ zip: "
|
|
105
|
+
{ zip: dataRootPath("oa-cache", "de__berlin.zip"), csv: "de/berlin.csv", region: "Berlin" },
|
|
106
|
+
{ zip: dataRootPath("oa-cache", "de__sn__statewide.zip"), csv: "de/sn/statewide.csv", region: "Sachsen" },
|
|
103
107
|
],
|
|
104
108
|
},
|
|
105
109
|
FR: {
|
|
106
110
|
source: "synth-fr",
|
|
107
111
|
corpusVersion: "0.4.0",
|
|
108
|
-
parts: [{ zip: "
|
|
112
|
+
parts: [{ zip: dataRootPath("oa-cache", "fr__countrywide.zip"), csv: "fr/countrywide.csv" }],
|
|
109
113
|
},
|
|
110
114
|
NL: {
|
|
111
115
|
source: "synth-nl",
|
|
@@ -144,7 +148,7 @@ const COUNTRY_SOURCES: Record<string, LocaleCountrySource> = {
|
|
|
144
148
|
parts: [{ path: dataRootPath("openaddresses", "extracted", "nz", "countrywide.csv"), districtAsLocality: true }],
|
|
145
149
|
},
|
|
146
150
|
GB: {
|
|
147
|
-
// HM Land Registry Price Paid Data tuples (25.67M rows
|
|
151
|
+
// HM Land Registry Price Paid Data tuples (25.67M rows out of the PPD ingest). PPD's DISTRICT is the
|
|
148
152
|
// postal town (locality) and CITY is the dependent locality — legitimately EMPTY on the majority of rows
|
|
149
153
|
// (most GB addresses have no dependent locality). `districtAsLocality` maps DISTRICT→locality and, when
|
|
150
154
|
// present, CITY→dependent_locality; the `readTuples` gate above only drops a row when BOTH are empty, so
|
|
@@ -223,7 +227,7 @@ interface ColumnIndex {
|
|
|
223
227
|
|
|
224
228
|
/**
|
|
225
229
|
* Stream real tuples out of an OA source part and reservoir-sample to {@link RESERVOIR_CAP}. Reads the CSV row-by-row —
|
|
226
|
-
* `
|
|
230
|
+
* `readZipEntry | CSVSpliterator` for zip parts, `createReadStream | CSVSpliterator` for extracted parts (both bounded
|
|
227
231
|
* memory) — and keeps a uniform random sample (Algorithm R) seeded by `rng`, separate from the emit loop's PRNG. NO
|
|
228
232
|
* global dedup (a 25M-key Set would OOM; OA rows are near-unique). The city passes through {@link cleanCityNoise}; the
|
|
229
233
|
* region falls back to `part.region` when the row's REGION cell is empty (DE).
|
|
@@ -231,21 +235,11 @@ interface ColumnIndex {
|
|
|
231
235
|
* Exported for {@link locale.test.ts} — the CSV read path (quote handling, CRLF, region fallback) has no other test.
|
|
232
236
|
*/
|
|
233
237
|
export async function readTuples(part: LocalePart, rng: () => number): Promise<LocaleBaseTuple[]> {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
input = createReadStream(part.path)
|
|
240
|
-
} else {
|
|
241
|
-
const child = spawn("unzip", ["-p", part.zip!, part.csv!])
|
|
242
|
-
|
|
243
|
-
child.on("error", (err) => {
|
|
244
|
-
console.error(` WARN: unzip failed for ${part.zip}: ${err.message}`)
|
|
245
|
-
})
|
|
246
|
-
|
|
247
|
-
input = child.stdout!
|
|
248
|
-
}
|
|
238
|
+
// No `encoding` on the file path — CSVSpliterator delimits raw bytes and decodes utf-8 itself; a string stream
|
|
239
|
+
// (from `{ encoding: "utf8" }`) would defeat its byte-range scanner.
|
|
240
|
+
const input: NodeJS.ReadableStream | AsyncIterable<Uint8Array> = part.path
|
|
241
|
+
? createReadStream(part.path)
|
|
242
|
+
: readZipEntry(part.zip!, part.csv!)
|
|
249
243
|
|
|
250
244
|
const get = (cells: string[], i: number): string => (i >= 0 && i < cells.length ? (cells[i] ?? "").trim() : "")
|
|
251
245
|
const reservoir: LocaleBaseTuple[] = []
|
|
@@ -256,9 +250,8 @@ export async function readTuples(part: LocalePart, rng: () => number): Promise<L
|
|
|
256
250
|
|
|
257
251
|
try {
|
|
258
252
|
// CSVSpliterator handles OA's quoted fields (embedded commas/newlines) and CRLF row terminators
|
|
259
|
-
// (spliterator ≥ 3.2.0); `header: false` yields the header row too, so
|
|
260
|
-
// from
|
|
261
|
-
// on 10M+ real OA rows — the only raw-cell difference was a trailing CR on the discarded HASH column.
|
|
253
|
+
// (spliterator ≥ 3.2.0); `header: false` yields the header row too, so the column index is built
|
|
254
|
+
// from that first row rather than from a header option.
|
|
262
255
|
for await (const cells of CSVSpliterator.fromAsync<string[]>(input, {
|
|
263
256
|
mode: "array",
|
|
264
257
|
header: false,
|
|
@@ -315,9 +308,8 @@ export async function readTuples(part: LocalePart, rng: () => number): Promise<L
|
|
|
315
308
|
// dependent_locality. When DISTRICT is empty (~18% of NZ rows), fall back to CITY → locality with no
|
|
316
309
|
// sub-locality. GB PPD tuples flip which side is legitimately empty — on the MAJORITY of GB rows CITY
|
|
317
310
|
// (the dependent_locality) is empty and DISTRICT (the locality) is populated, so the gate below only
|
|
318
|
-
// drops a `districtAsLocality` row when BOTH are empty,
|
|
319
|
-
//
|
|
320
|
-
// {@link LocalePart.districtAsLocality}.
|
|
311
|
+
// drops a `districtAsLocality` row when BOTH are empty, never when CITY alone is — gating on CITY
|
|
312
|
+
// alone silently discards most of the GB source. See {@link LocalePart.districtAsLocality}.
|
|
321
313
|
let locality: string | null
|
|
322
314
|
let dependent_locality: string | undefined
|
|
323
315
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
* list. Diacritic-KEEPING normalizer, matching the board (see the norm docstring).
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
import {
|
|
38
|
+
import { TextSpliterator } from "spliterator"
|
|
39
39
|
|
|
40
40
|
import { alignAndWrite, makeMulberry32, readTuples, type ShardRecipe, shardSourceID } from "./scaffold.ts"
|
|
41
41
|
|
|
@@ -100,12 +100,15 @@ export const noFragmentRecipe: ShardRecipe = {
|
|
|
100
100
|
)
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
const excluded = new Set(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
const excluded = new Set<string>()
|
|
104
|
+
|
|
105
|
+
for await (const line of TextSpliterator.fromAsync(excludePath)) {
|
|
106
|
+
const trimmed = line.trim()
|
|
107
|
+
|
|
108
|
+
if (trimmed && !trimmed.startsWith("#")) {
|
|
109
|
+
excluded.add(trimmed)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
109
112
|
|
|
110
113
|
if (!excluded.size) throw new Error(`no-fragment: --exclude-surfaces "${excludePath}" listed no surfaces`)
|
|
111
114
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* 3. pc-first "«pc» «city», «st» «n»" (the 7% floor — the anchor the others converge to)
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import {
|
|
19
|
+
import { TextSpliterator } from "spliterator"
|
|
20
20
|
|
|
21
21
|
import { alignAndWrite, makeMulberry32, readTuples, type ShardRecipe, shardSourceID } from "./scaffold.ts"
|
|
22
22
|
|
|
@@ -62,12 +62,15 @@ export const noStreetLedRecipe: ShardRecipe = {
|
|
|
62
62
|
)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
const excluded = new Set(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
const excluded = new Set<string>()
|
|
66
|
+
|
|
67
|
+
for await (const line of TextSpliterator.fromAsync(excludePath)) {
|
|
68
|
+
const trimmed = line.trim()
|
|
69
|
+
|
|
70
|
+
if (trimmed && !trimmed.startsWith("#")) {
|
|
71
|
+
excluded.add(trimmed)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
71
74
|
|
|
72
75
|
if (!excluded.size) throw new Error(`no-street-led: --exclude-surfaces "${excludePath}" listed no surfaces`)
|
|
73
76
|
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* scripts/build-no-street-shard.mjs.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { synthesizeNoStreetRow, type NoStreetBaseTuple } from "
|
|
13
|
+
import { synthesizeNoStreetRow, type NoStreetBaseTuple } from "@mailwoman/corpus/synthesizers/no-street"
|
|
14
|
+
|
|
14
15
|
import { alignAndWrite, makeLcg, readTuples, shardSourceID, type ShardRecipe } from "./scaffold.ts"
|
|
15
16
|
|
|
16
17
|
const LICENSE = "Synthetic — derived from CC-BY / public-domain input tuples"
|