@mailwoman/corpus 9.0.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/data/PROVENANCE.md +227 -0
- package/data/reviewed-ve-postcode-tuples.json +74 -0
- package/data/sub-venue-lexicon.json +18269 -0
- package/out/src/adapters/ban/adapter.d.ts +1 -1
- package/out/src/adapters/ban/adapter.d.ts.map +1 -1
- package/out/src/adapters/ban/adapter.js +5 -4
- package/out/src/adapters/ban/adapter.js.map +1 -1
- package/out/src/adapters/fcc-bdc/adapter.d.ts +1 -1
- package/out/src/adapters/fcc-bdc/adapter.d.ts.map +1 -1
- package/out/src/adapters/fcc-bdc/adapter.js +3 -3
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- package/out/src/adapters/gnaf/adapter.js.map +1 -1
- package/out/src/adapters/gnaf/assemble.js +1 -1
- 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 +3 -3
- 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 +2 -2
- 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 +7 -6
- 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 +12 -7
- 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 +12 -18
- 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 +12 -7
- 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 +3 -3
- 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/usgov-hrsa-fqhc/adapter.d.ts +1 -1
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.js +7 -6
- 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 +11 -7
- 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 +6 -5
- 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 +8 -8
- 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 +10 -10
- 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 +7 -6
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.js.map +1 -1
- package/out/src/{adapter.d.ts → adapters/utils/index.d.ts} +8 -2
- package/out/src/adapters/utils/index.d.ts.map +1 -0
- package/out/src/{adapter.js → adapters/utils/index.js} +11 -3
- 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 +5 -5
- package/out/src/adapters/wof-admin-jp/adapter.js.map +1 -1
- package/out/src/adapters/wof-admin-json/adapter.d.ts +4 -15
- package/out/src/adapters/wof-admin-json/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-admin-json/adapter.js +11 -35
- package/out/src/adapters/wof-admin-json/adapter.js.map +1 -1
- package/out/src/adapters/wof-json-rows.d.ts +32 -0
- package/out/src/adapters/wof-json-rows.d.ts.map +1 -0
- package/out/src/adapters/wof-json-rows.js +45 -0
- package/out/src/adapters/wof-json-rows.js.map +1 -0
- package/out/src/adapters/wof-postalcode-json/adapter.d.ts +4 -9
- package/out/src/adapters/wof-postalcode-json/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-postalcode-json/adapter.js +12 -37
- package/out/src/adapters/wof-postalcode-json/adapter.js.map +1 -1
- package/out/src/build.d.ts +4 -4
- package/out/src/build.d.ts.map +1 -1
- package/out/src/build.js +7 -7
- 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.map +1 -1
- package/out/src/parquet-wrapper/reader.js +5 -0
- package/out/src/parquet-wrapper/reader.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 +4 -5
- package/out/src/shard-recipes/anchor-absorption.js.map +1 -1
- package/out/src/shard-recipes/bare-country.d.ts +25 -0
- package/out/src/shard-recipes/bare-country.d.ts.map +1 -0
- package/out/src/shard-recipes/bare-country.js +87 -0
- package/out/src/shard-recipes/bare-country.js.map +1 -0
- 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 +14 -21
- package/out/src/shard-recipes/country-balanced.js.map +1 -1
- package/out/src/shard-recipes/cz-pcfirst-preposition.d.ts.map +1 -1
- package/out/src/shard-recipes/cz-pcfirst-preposition.js +28 -10
- package/out/src/shard-recipes/cz-pcfirst-preposition.js.map +1 -1
- package/out/src/shard-recipes/fr-admin-split.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-admin-split.js +4 -3
- package/out/src/shard-recipes/fr-admin-split.js.map +1 -1
- package/out/src/shard-recipes/fr-bare-street.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-bare-street.js +72 -11
- package/out/src/shard-recipes/fr-bare-street.js.map +1 -1
- package/out/src/shard-recipes/fr-lieudit.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-lieudit.js +4 -3
- 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 +11 -20
- 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 +8 -14
- 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 +8 -1
- package/out/src/shard-recipes/index.js.map +1 -1
- package/out/src/shard-recipes/intersection.d.ts.map +1 -1
- package/out/src/shard-recipes/intersection.js +7 -13
- 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 +13 -20
- package/out/src/shard-recipes/locale.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.map +1 -1
- package/out/src/shard-recipes/po-box-cedex.js +60 -43
- 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/reviewed-postcode-tail.d.ts +47 -0
- package/out/src/shard-recipes/reviewed-postcode-tail.d.ts.map +1 -0
- package/out/src/shard-recipes/reviewed-postcode-tail.js +125 -0
- package/out/src/shard-recipes/reviewed-postcode-tail.js.map +1 -0
- package/out/src/shard-recipes/scaffold.d.ts +51 -23
- package/out/src/shard-recipes/scaffold.d.ts.map +1 -1
- package/out/src/shard-recipes/scaffold.js +59 -23
- 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 +203 -35
- 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 +3 -6
- package/out/src/shard-recipes/sub-venue-sources.d.ts.map +1 -1
- package/out/src/shard-recipes/sub-venue-sources.js +4 -9
- package/out/src/shard-recipes/sub-venue-sources.js.map +1 -1
- package/out/src/shard-recipes/sub-venue.d.ts +2 -2
- package/out/src/shard-recipes/sub-venue.d.ts.map +1 -1
- package/out/src/shard-recipes/sub-venue.js +7 -6
- package/out/src/shard-recipes/sub-venue.js.map +1 -1
- package/out/src/shard-recipes/trailing-region.d.ts +74 -0
- package/out/src/shard-recipes/trailing-region.d.ts.map +1 -0
- package/out/src/shard-recipes/trailing-region.js +157 -0
- package/out/src/shard-recipes/trailing-region.js.map +1 -0
- package/out/src/shard-recipes/unit.d.ts.map +1 -1
- package/out/src/shard-recipes/unit.js +6 -12
- 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} +20 -6
- 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} +4 -3
- 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} +5 -4
- 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 +2 -2
- package/out/src/tools/align-shard.js.map +1 -1
- package/out/src/tools/fetch/ban.d.ts.map +1 -1
- package/out/src/tools/fetch/ban.js +2 -18
- package/out/src/tools/fetch/ban.js.map +1 -1
- package/out/src/tools/fetch/download.d.ts +12 -3
- package/out/src/tools/fetch/download.d.ts.map +1 -1
- package/out/src/tools/fetch/download.js +20 -4
- package/out/src/tools/fetch/download.js.map +1 -1
- package/out/src/tools/fetch/geonames-dump.d.ts +87 -0
- package/out/src/tools/fetch/geonames-dump.d.ts.map +1 -0
- package/out/src/tools/fetch/geonames-dump.js +178 -0
- package/out/src/tools/fetch/geonames-dump.js.map +1 -0
- package/out/src/tools/fetch/geonames-postal.d.ts +76 -0
- package/out/src/tools/fetch/geonames-postal.d.ts.map +1 -0
- package/out/src/tools/fetch/geonames-postal.js +125 -0
- package/out/src/tools/fetch/geonames-postal.js.map +1 -0
- package/out/src/tools/fetch/imls-pls.d.ts.map +1 -1
- package/out/src/tools/fetch/imls-pls.js +5 -17
- package/out/src/tools/fetch/imls-pls.js.map +1 -1
- package/out/src/tools/fetch/index.d.ts +11 -0
- package/out/src/tools/fetch/index.d.ts.map +1 -1
- package/out/src/tools/fetch/index.js +11 -0
- package/out/src/tools/fetch/index.js.map +1 -1
- package/out/src/tools/fetch/nad.d.ts.map +1 -1
- package/out/src/tools/fetch/nad.js +20 -11
- package/out/src/tools/fetch/nad.js.map +1 -1
- package/out/src/tools/fetch/nppes.d.ts.map +1 -1
- package/out/src/tools/fetch/nppes.js +17 -22
- package/out/src/tools/fetch/nppes.js.map +1 -1
- package/out/src/tools/fetch/openaddresses.d.ts.map +1 -1
- package/out/src/tools/fetch/openaddresses.js +18 -17
- package/out/src/tools/fetch/openaddresses.js.map +1 -1
- package/out/src/tools/fetch/ourairports.d.ts.map +1 -1
- package/out/src/tools/fetch/ourairports.js +7 -2
- package/out/src/tools/fetch/ourairports.js.map +1 -1
- package/out/src/tools/fetch/ppd.d.ts +0 -4
- package/out/src/tools/fetch/ppd.d.ts.map +1 -1
- package/out/src/tools/fetch/ppd.js +1 -1
- package/out/src/tools/fetch/ppd.js.map +1 -1
- package/out/src/tools/fetch/state-hi-schools.d.ts.map +1 -1
- package/out/src/tools/fetch/state-hi-schools.js +3 -19
- package/out/src/tools/fetch/state-hi-schools.js.map +1 -1
- package/out/src/tools/fetch/state-sources.d.ts +4 -0
- package/out/src/tools/fetch/state-sources.d.ts.map +1 -1
- package/out/src/tools/fetch/state-sources.js +1 -5
- package/out/src/tools/fetch/state-sources.js.map +1 -1
- package/out/src/tools/fetch/tiger-full.d.ts.map +1 -1
- package/out/src/tools/fetch/tiger-full.js +15 -21
- package/out/src/tools/fetch/tiger-full.js.map +1 -1
- package/out/src/tools/golden-expand.d.ts.map +1 -1
- package/out/src/tools/golden-expand.js +34 -25
- package/out/src/tools/golden-expand.js.map +1 -1
- package/out/src/tools/golden-relabel-street.d.ts.map +1 -1
- package/out/src/tools/golden-relabel-street.js +4 -77
- package/out/src/tools/golden-relabel-street.js.map +1 -1
- package/out/src/tools/index.d.ts +2 -2
- package/out/src/tools/index.d.ts.map +1 -1
- package/out/src/tools/index.js +2 -2
- package/out/src/tools/index.js.map +1 -1
- package/out/src/tools/ingest-csv.d.ts.map +1 -1
- package/out/src/tools/ingest-csv.js +0 -11
- package/out/src/tools/ingest-csv.js.map +1 -1
- package/out/src/tools/overlay-manifest.d.ts +4 -0
- package/out/src/tools/overlay-manifest.d.ts.map +1 -1
- package/out/src/tools/overlay-manifest.js +16 -6
- package/out/src/tools/overlay-manifest.js.map +1 -1
- package/out/src/tools/postcode-triples.d.ts +175 -0
- package/out/src/tools/postcode-triples.d.ts.map +1 -0
- package/out/src/tools/postcode-triples.js +304 -0
- package/out/src/tools/postcode-triples.js.map +1 -0
- package/out/src/tools/shard-kryptonite.d.ts.map +1 -1
- package/out/src/tools/shard-kryptonite.js +1 -3
- package/out/src/tools/shard-kryptonite.js.map +1 -1
- package/out/src/tools/shard-translit.d.ts.map +1 -1
- package/out/src/tools/shard-translit.js +4 -27
- package/out/src/tools/shard-translit.js.map +1 -1
- package/out/src/tools/sub-venue/harvest.d.ts +100 -0
- package/out/src/tools/sub-venue/harvest.d.ts.map +1 -0
- package/out/src/tools/sub-venue/harvest.js +168 -0
- package/out/src/tools/sub-venue/harvest.js.map +1 -0
- package/out/src/tools/sub-venue/head-nouns.d.ts +50 -0
- package/out/src/tools/sub-venue/head-nouns.d.ts.map +1 -0
- package/out/src/tools/sub-venue/head-nouns.js +210 -0
- package/out/src/tools/sub-venue/head-nouns.js.map +1 -0
- package/out/src/tools/sub-venue/surfaces.d.ts +45 -0
- package/out/src/tools/sub-venue/surfaces.d.ts.map +1 -0
- package/out/src/tools/sub-venue/surfaces.js +77 -0
- package/out/src/tools/sub-venue/surfaces.js.map +1 -0
- package/out/src/tools/sub-venue/table.d.ts +229 -0
- package/out/src/tools/sub-venue/table.d.ts.map +1 -0
- package/out/src/tools/sub-venue/table.js +108 -0
- package/out/src/tools/sub-venue/table.js.map +1 -0
- package/out/src/tools/sub-venue/wikidata.d.ts +26 -0
- package/out/src/tools/sub-venue/wikidata.d.ts.map +1 -0
- package/out/src/tools/sub-venue/wikidata.js +62 -0
- package/out/src/tools/sub-venue/wikidata.js.map +1 -0
- package/out/src/tools/sub-venue-lexicon.d.ts +27 -378
- package/out/src/tools/sub-venue-lexicon.d.ts.map +1 -1
- package/out/src/tools/sub-venue-lexicon.js +30 -565
- package/out/src/tools/sub-venue-lexicon.js.map +1 -1
- 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/utils/golden.d.ts.map +1 -0
- package/out/src/{golden.js → utils/golden.js} +2 -2
- 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/{license.js → utils/license.js} +1 -1
- package/out/src/utils/license.js.map +1 -0
- package/out/src/{parquet.d.ts → utils/parquet.d.ts} +24 -5
- package/out/src/utils/parquet.d.ts.map +1 -0
- package/out/src/{parquet.js → utils/parquet.js} +6 -3
- package/out/src/utils/parquet.js.map +1 -0
- package/out/src/{split.d.ts → utils/split.d.ts} +1 -1
- package/out/src/utils/split.d.ts.map +1 -0
- package/out/src/{split.js → utils/split.js} +2 -2
- 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/utils/wof-json.d.ts.map +1 -0
- package/out/src/utils/wof-json.js.map +1 -0
- package/package.json +287 -21
- package/src/adapters/ban/adapter.ts +7 -5
- package/src/adapters/fcc-bdc/adapter.ts +5 -4
- package/src/adapters/geonames/adapter.ts +3 -3
- package/src/adapters/geonames-postal/adapter.ts +4 -4
- package/src/adapters/gnaf/adapter.ts +3 -3
- package/src/adapters/gnaf/assemble.ts +1 -1
- package/src/adapters/index.ts +3 -2
- package/src/adapters/openaddresses/adapter.ts +4 -4
- package/src/adapters/overture/adapter.ts +3 -3
- package/src/adapters/state-hi-schools/adapter.ts +8 -7
- package/src/adapters/state-ia-contractors/adapter.ts +13 -8
- package/src/adapters/state-ny-notaries/adapter.ts +13 -32
- package/src/adapters/state-tx-notaries/adapter.ts +13 -8
- package/src/adapters/synth-po-box/adapter.ts +4 -4
- package/src/adapters/tiger/adapter.ts +5 -3
- package/src/adapters/usgov-hrsa-fqhc/adapter.ts +8 -7
- package/src/adapters/usgov-imls-pls/adapter.ts +12 -8
- package/src/adapters/usgov-irs-bmf/adapter.ts +7 -6
- package/src/adapters/usgov-nad/adapter.ts +9 -9
- package/src/adapters/usgov-nppes/adapter.ts +13 -12
- package/src/adapters/usgov-samhsa-treatment-locator/adapter.ts +8 -7
- package/src/{adapter.ts → adapters/utils/index.ts} +15 -3
- package/src/adapters/wof-admin-jp/adapter.ts +9 -12
- package/src/adapters/wof-admin-json/adapter.ts +15 -54
- package/src/adapters/wof-json-rows.ts +79 -0
- package/src/adapters/wof-postalcode-json/adapter.ts +16 -50
- package/src/build.ts +8 -8
- package/src/index.ts +3 -17
- package/src/name-prone-us-suffixes.ts +12 -0
- package/src/parquet-wrapper/reader.ts +9 -0
- package/src/runner.ts +2 -2
- package/src/shard-recipes/anchor-absorption.ts +5 -5
- package/src/shard-recipes/bare-country.ts +95 -0
- package/src/shard-recipes/boundary-stress.ts +3 -2
- package/src/shard-recipes/country-balanced.ts +16 -27
- package/src/shard-recipes/cz-pcfirst-preposition.ts +29 -10
- package/src/shard-recipes/fr-admin-split.ts +6 -4
- package/src/shard-recipes/fr-bare-street.ts +85 -10
- package/src/shard-recipes/fr-lieudit.ts +6 -4
- package/src/shard-recipes/fr-order.ts +13 -26
- package/src/shard-recipes/german.ts +9 -18
- package/src/shard-recipes/house-venue.ts +2 -1
- package/src/shard-recipes/index.ts +8 -1
- package/src/shard-recipes/intersection.ts +9 -17
- package/src/shard-recipes/locale.ts +16 -24
- package/src/shard-recipes/no-street.ts +2 -1
- package/src/shard-recipes/po-box-cedex.ts +76 -58
- package/src/shard-recipes/po-box.ts +2 -1
- package/src/shard-recipes/reviewed-postcode-tail.ts +189 -0
- package/src/shard-recipes/scaffold.ts +99 -24
- package/src/shard-recipes/street-affix.ts +284 -45
- 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 +13 -23
- package/src/shard-recipes/sub-venue.ts +11 -9
- package/src/shard-recipes/trailing-region.ts +183 -0
- package/src/shard-recipes/unit.ts +8 -17
- package/src/{synthesize-boundary-stress.ts → synthesizers/boundary-stress.ts} +2 -2
- package/src/{synthesize-german.ts → synthesizers/german.ts} +3 -2
- package/src/{synthesize-house-venue.ts → synthesizers/house-venue.ts} +20 -6
- 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} +5 -3
- package/src/{synthesize.ts → synthesizers/utils.ts} +6 -4
- package/src/tools/align-shard.ts +3 -2
- package/src/tools/fetch/ban.ts +2 -22
- package/src/tools/fetch/download.ts +22 -4
- package/src/tools/fetch/geonames-dump.ts +267 -0
- package/src/tools/fetch/geonames-postal.ts +180 -0
- package/src/tools/fetch/imls-pls.ts +6 -20
- package/src/tools/fetch/index.ts +11 -0
- package/src/tools/fetch/nad.ts +21 -10
- package/src/tools/fetch/nppes.ts +17 -23
- package/src/tools/fetch/openaddresses.ts +18 -22
- package/src/tools/fetch/ourairports.ts +7 -2
- package/src/tools/fetch/ppd.ts +1 -1
- package/src/tools/fetch/state-hi-schools.ts +3 -23
- package/src/tools/fetch/state-sources.ts +1 -1
- package/src/tools/fetch/tiger-full.ts +17 -24
- package/src/tools/golden-expand.ts +44 -33
- package/src/tools/golden-relabel-street.ts +5 -68
- package/src/tools/index.ts +2 -2
- package/src/tools/ingest-csv.ts +0 -13
- package/src/tools/overlay-manifest.ts +20 -8
- package/src/tools/postcode-triples.ts +375 -0
- package/src/tools/shard-kryptonite.ts +4 -5
- package/src/tools/shard-translit.ts +16 -35
- package/src/tools/sub-venue/harvest.ts +235 -0
- package/src/tools/sub-venue/head-nouns.ts +242 -0
- package/src/tools/sub-venue/surfaces.ts +95 -0
- package/src/tools/sub-venue/table.ts +281 -0
- package/src/tools/sub-venue/wikidata.ts +85 -0
- package/src/tools/sub-venue-lexicon.ts +67 -886
- package/src/{align.ts → utils/align.ts} +2 -1
- package/src/{golden.ts → utils/golden.ts} +2 -3
- package/src/utils/index.ts +14 -0
- package/src/{license.ts → utils/license.ts} +1 -1
- package/src/{parquet.ts → utils/parquet.ts} +22 -9
- package/src/{split.ts → utils/split.ts} +3 -3
- 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/{golden.d.ts → utils/golden.d.ts} +0 -0
- /package/out/src/{license.d.ts → utils/license.d.ts} +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/out/src/{wof-json.d.ts → utils/wof-json.d.ts} +0 -0
- /package/out/src/{wof-json.js → utils/wof-json.js} +0 -0
- /package/src/{synthesize-anchor-absorption.ts → synthesizers/anchor-absorption.ts} +0 -0
- /package/src/{tokenize.ts → utils/tokenize.ts} +0 -0
- /package/src/{wof-json.ts → utils/wof-json.ts} +0 -0
|
@@ -14,12 +14,13 @@
|
|
|
14
14
|
* License: stamped `"Public Domain"` per New York state government open-data terms.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
18
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
17
19
|
import { CSVSpliterator } from "spliterator"
|
|
18
20
|
|
|
19
|
-
import { splitStreetLine, stableSourceID } from "
|
|
20
|
-
import { lookupStateAbbreviation } from "
|
|
21
|
-
import {
|
|
22
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
21
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils"
|
|
22
|
+
import { lookupStateAbbreviation } from "#codex/us-fips-state"
|
|
23
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -32,30 +33,6 @@ export const STATE_NY_NOTARIES_ADAPTER_ID = "state-ny-notaries"
|
|
|
32
33
|
*/
|
|
33
34
|
export const STATE_NY_NOTARIES_DEFAULT_LICENSE = "Public Domain"
|
|
34
35
|
|
|
35
|
-
interface NyNotaryRow {
|
|
36
|
-
"Commission Holder Name": string
|
|
37
|
-
"Commission Number (UID)": string
|
|
38
|
-
"Business Name (if available)": string
|
|
39
|
-
"Business Address 1 (if available)": string
|
|
40
|
-
"Business Address 2 (if available)": string
|
|
41
|
-
" Business City (if available)": string
|
|
42
|
-
"Business State (if available)": string
|
|
43
|
-
"Business Zip (if available)": string
|
|
44
|
-
"Commissioned County": string
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const RAW_NY_COLUMNS = [
|
|
48
|
-
"Commission Holder Name",
|
|
49
|
-
"Commission Number (UID)",
|
|
50
|
-
"Business Name (if available)",
|
|
51
|
-
"Business Address 1 (if available)",
|
|
52
|
-
"Business Address 2 (if available)",
|
|
53
|
-
" Business City (if available)",
|
|
54
|
-
"Business State (if available)",
|
|
55
|
-
"Business Zip (if available)",
|
|
56
|
-
"Commissioned County",
|
|
57
|
-
] as const
|
|
58
|
-
|
|
59
36
|
export function createStateNyNotariesAdapter(): CorpusAdapter {
|
|
60
37
|
return {
|
|
61
38
|
id: STATE_NY_NOTARIES_ADAPTER_ID,
|
|
@@ -104,7 +81,7 @@ export function createStateNyNotariesAdapter(): CorpusAdapter {
|
|
|
104
81
|
|
|
105
82
|
if (!state) continue
|
|
106
83
|
|
|
107
|
-
const fullAddress = [address1, address2].filter(
|
|
84
|
+
const fullAddress = [address1, address2].filter(isPresent).join(" ")
|
|
108
85
|
const split = splitStreetLine(fullAddress)
|
|
109
86
|
|
|
110
87
|
if (!split) continue
|
|
@@ -121,10 +98,14 @@ export function createStateNyNotariesAdapter(): CorpusAdapter {
|
|
|
121
98
|
...(county ? { subregion: county } : {}),
|
|
122
99
|
}
|
|
123
100
|
|
|
124
|
-
const streetPart = [split.house_number, split.street].filter(
|
|
101
|
+
const streetPart = [split.house_number, split.street].filter(isPresent).join(" ").trim()
|
|
125
102
|
|
|
126
|
-
const raw = [
|
|
127
|
-
|
|
103
|
+
const raw = [
|
|
104
|
+
venue,
|
|
105
|
+
streetPart,
|
|
106
|
+
[city, [stateAbbr, zip].filter(isPresent).join(" ")].filter(isPresent).join(", "),
|
|
107
|
+
]
|
|
108
|
+
.filter(isPresent)
|
|
128
109
|
.join(", ")
|
|
129
110
|
|
|
130
111
|
const aligned = reconcileComponents(components, raw)
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
* License: stamped `"Public Domain"` per Texas state government open-data terms.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
19
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
18
20
|
import { CSVSpliterator } from "spliterator"
|
|
19
21
|
|
|
20
|
-
import { splitStreetLine, stableSourceID } from "
|
|
21
|
-
import { lookupStateAbbreviation } from "
|
|
22
|
-
import {
|
|
23
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
22
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils"
|
|
23
|
+
import { lookupStateAbbreviation } from "#codex/us-fips-state"
|
|
24
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -104,7 +105,7 @@ export function createStateTxNotariesAdapter(): CorpusAdapter {
|
|
|
104
105
|
|
|
105
106
|
if (!split) continue
|
|
106
107
|
|
|
107
|
-
const venue = [firstName, lastName].filter(
|
|
108
|
+
const venue = [firstName, lastName].filter(isPresent).join(" ") || undefined
|
|
108
109
|
|
|
109
110
|
const components: CanonicalRow["components"] = {
|
|
110
111
|
...(venue ? { venue } : {}),
|
|
@@ -115,10 +116,14 @@ export function createStateTxNotariesAdapter(): CorpusAdapter {
|
|
|
115
116
|
...(zip ? { postcode: zip } : {}),
|
|
116
117
|
}
|
|
117
118
|
|
|
118
|
-
const streetPart = [split.house_number, split.street].filter(
|
|
119
|
+
const streetPart = [split.house_number, split.street].filter(isPresent).join(" ").trim()
|
|
119
120
|
|
|
120
|
-
const raw = [
|
|
121
|
-
|
|
121
|
+
const raw = [
|
|
122
|
+
venue,
|
|
123
|
+
streetPart,
|
|
124
|
+
[city, [stateAbbr, zip].filter(isPresent).join(" ")].filter(isPresent).join(", "),
|
|
125
|
+
]
|
|
126
|
+
.filter(isPresent)
|
|
122
127
|
.join(", ")
|
|
123
128
|
|
|
124
129
|
const aligned = reconcileComponents(components, raw)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Consumes a JSONL stream of (locality, region, postcode, country) tuples — typically extracted
|
|
9
9
|
* from existing corpus output (TIGER/NAD/BAN/WOF) — and emits synthetic PO box training rows. See
|
|
10
|
-
*
|
|
10
|
+
* `@mailwoman/corpus/synthesizers/po-box` for the per-locale templates and number-noise logic.
|
|
11
11
|
*
|
|
12
12
|
* Why an adapter and not an augmenter:
|
|
13
13
|
*
|
|
@@ -24,15 +24,15 @@ import { tryParsingJSON } from "@mailwoman/core/objects"
|
|
|
24
24
|
import { makeLcg } from "@mailwoman/core/utils"
|
|
25
25
|
import { TextSpliterator } from "spliterator"
|
|
26
26
|
|
|
27
|
-
import { stableSourceID } from "
|
|
27
|
+
import { stableSourceID } from "#adapters/utils"
|
|
28
28
|
import {
|
|
29
29
|
countryToLocale,
|
|
30
30
|
REGION_OPTIONAL_LOCALES,
|
|
31
31
|
synthesizeMilitaryPoBoxRow,
|
|
32
32
|
synthesizePoBoxRow,
|
|
33
33
|
type PoBoxBaseTuple,
|
|
34
|
-
} from "
|
|
35
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "
|
|
34
|
+
} from "#synthesizers/po-box"
|
|
35
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -36,9 +36,11 @@
|
|
|
36
36
|
|
|
37
37
|
import { DatabaseSync } from "node:sqlite"
|
|
38
38
|
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
import
|
|
39
|
+
import { formatAddress, reconcileComponents } from "@mailwoman/formatter"
|
|
40
|
+
|
|
41
|
+
import { lookupFipsState } from "#codex/us-fips-state"
|
|
42
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
43
|
+
|
|
42
44
|
import { decomposeStreet } from "./street-decompose.ts"
|
|
43
45
|
|
|
44
46
|
/**
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
* terms.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
33
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
32
34
|
import { CSVSpliterator } from "spliterator"
|
|
33
35
|
|
|
34
|
-
import { splitStreetLine, stableSourceID } from "
|
|
35
|
-
import { lookupStateAbbreviation } from "
|
|
36
|
-
import {
|
|
37
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
36
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils"
|
|
37
|
+
import { lookupStateAbbreviation } from "#codex/us-fips-state"
|
|
38
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -90,10 +91,10 @@ function composeRaw(
|
|
|
90
91
|
state: string,
|
|
91
92
|
postcode: string
|
|
92
93
|
): string {
|
|
93
|
-
const streetPart = [house, street].filter(
|
|
94
|
-
const cityPart = [city.trim(), [state, postcode].filter(
|
|
94
|
+
const streetPart = [house, street].filter(isPresent).join(" ").trim()
|
|
95
|
+
const cityPart = [city.trim(), [state, postcode].filter(isPresent).join(" ").trim()].filter(isPresent).join(", ")
|
|
95
96
|
|
|
96
|
-
return [venue.trim(), streetPart, cityPart].filter(
|
|
97
|
+
return [venue.trim(), streetPart, cityPart].filter(isPresent).join(", ")
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
export function createUsgovHrsaFqhcAdapter(): CorpusAdapter {
|
|
@@ -18,12 +18,13 @@
|
|
|
18
18
|
* License: stamped `"Public Domain"` per IMLS federal government distribution terms.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
22
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
21
23
|
import { CSVSpliterator } from "spliterator"
|
|
22
24
|
|
|
23
|
-
import { splitStreetLine, stableSourceID } from "
|
|
24
|
-
import { lookupStateAbbreviation } from "
|
|
25
|
-
import {
|
|
26
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
25
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils"
|
|
26
|
+
import { lookupStateAbbreviation } from "#codex/us-fips-state"
|
|
27
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -75,7 +76,6 @@ export function createUsgovImlsPlsAdapter(): CorpusAdapter {
|
|
|
75
76
|
const city = (record.CITY ?? "").trim()
|
|
76
77
|
const zip = (record.ZIP ?? "").trim()
|
|
77
78
|
const stateAbbr = (record.STABR ?? "").trim()
|
|
78
|
-
const county = (record.CNTY ?? "").trim()
|
|
79
79
|
|
|
80
80
|
if (!libName || !city || !zip) continue
|
|
81
81
|
|
|
@@ -100,10 +100,14 @@ export function createUsgovImlsPlsAdapter(): CorpusAdapter {
|
|
|
100
100
|
// a postal-surface component here.
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
const streetPart = [split.house_number, split.street].filter(
|
|
103
|
+
const streetPart = [split.house_number, split.street].filter(isPresent).join(" ").trim()
|
|
104
104
|
|
|
105
|
-
const raw = [
|
|
106
|
-
|
|
105
|
+
const raw = [
|
|
106
|
+
libName,
|
|
107
|
+
streetPart,
|
|
108
|
+
[city, [stateAbbr, zip].filter(isPresent).join(" ")].filter(isPresent).join(", "),
|
|
109
|
+
]
|
|
110
|
+
.filter(isPresent)
|
|
107
111
|
.join(", ")
|
|
108
112
|
|
|
109
113
|
const aligned = reconcileComponents(components, raw)
|
|
@@ -19,11 +19,12 @@
|
|
|
19
19
|
* federal).
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
23
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
22
24
|
import { CSVSpliterator } from "spliterator"
|
|
23
25
|
|
|
24
|
-
import { splitStreetLine, stableSourceID } from "
|
|
25
|
-
import {
|
|
26
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
26
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils"
|
|
27
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -72,9 +73,9 @@ function composeRaw(
|
|
|
72
73
|
state: string,
|
|
73
74
|
postcode: string
|
|
74
75
|
): string {
|
|
75
|
-
const cityPart = [city.trim(), [state, postcode].filter(
|
|
76
|
+
const cityPart = [city.trim(), [state, postcode].filter(isPresent).join(" ").trim()].filter(isPresent).join(", ")
|
|
76
77
|
|
|
77
|
-
return [venue, streetPart, cityPart].filter(
|
|
78
|
+
return [venue, streetPart, cityPart].filter(isPresent).join(", ")
|
|
78
79
|
}
|
|
79
80
|
|
|
80
81
|
export function createUsgovIrsBmfAdapter(): CorpusAdapter {
|
|
@@ -117,7 +118,7 @@ export function createUsgovIrsBmfAdapter(): CorpusAdapter {
|
|
|
117
118
|
if (!split) continue
|
|
118
119
|
|
|
119
120
|
const streetPart =
|
|
120
|
-
"po_box" in split ? split.po_box : [split.house_number, split.street].filter(
|
|
121
|
+
"po_box" in split ? split.po_box : [split.house_number, split.street].filter(isPresent).join(" ")
|
|
121
122
|
|
|
122
123
|
const components: CanonicalRow["components"] = {
|
|
123
124
|
...(venue ? { venue } : {}),
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
import { readdir } from "node:fs/promises"
|
|
34
34
|
import { join } from "node:path"
|
|
35
35
|
|
|
36
|
-
import { tryParsingJSON } from "@mailwoman/core/objects"
|
|
36
|
+
import { isPresent, tryParsingJSON } from "@mailwoman/core/objects"
|
|
37
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
37
38
|
import { TextSpliterator } from "spliterator"
|
|
38
39
|
|
|
39
|
-
import {
|
|
40
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
40
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -176,7 +176,7 @@ function composeHouseNumber(r: NADRecord): string | undefined {
|
|
|
176
176
|
const pre = (r.AddNum_Pre ?? "").toString().trim()
|
|
177
177
|
const suf = (r.AddNum_Suf ?? "").toString().trim()
|
|
178
178
|
|
|
179
|
-
return [pre, num, suf].filter(
|
|
179
|
+
return [pre, num, suf].filter(isPresent).join(" ").trim() || undefined
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
interface DecomposedNADStreet {
|
|
@@ -195,9 +195,9 @@ function decomposeNADStreet(r: NADRecord): DecomposedNADStreet | undefined {
|
|
|
195
195
|
const preSep = (r.St_PreSep ?? "").toString().trim()
|
|
196
196
|
const posTyp = (r.St_PosTyp ?? "").toString().trim()
|
|
197
197
|
const posDir = (r.St_PosDir ?? "").toString().trim()
|
|
198
|
-
const prefix = [preDir, preTyp, preSep].filter(
|
|
199
|
-
const suffix = [posTyp, posDir].filter(
|
|
200
|
-
const full = [prefix, name, suffix].filter(
|
|
198
|
+
const prefix = [preDir, preTyp, preSep].filter(isPresent).join(" ") || undefined
|
|
199
|
+
const suffix = [posTyp, posDir].filter(isPresent).join(" ") || undefined
|
|
200
|
+
const full = [prefix, name, suffix].filter(isPresent).join(" ")
|
|
201
201
|
|
|
202
202
|
return { prefix, street: name, suffix, full }
|
|
203
203
|
}
|
|
@@ -231,10 +231,10 @@ function composeRaw(parts: {
|
|
|
231
231
|
region: string
|
|
232
232
|
postcode: string
|
|
233
233
|
}): string {
|
|
234
|
-
const streetLine = [parts.houseNumber, parts.street, parts.unit].filter(
|
|
234
|
+
const streetLine = [parts.houseNumber, parts.street, parts.unit].filter(isPresent).join(" ").trim()
|
|
235
235
|
const tail = `${parts.locality}, ${parts.region} ${parts.postcode}`
|
|
236
236
|
|
|
237
|
-
return [parts.venue, streetLine || undefined, tail].filter(
|
|
237
|
+
return [parts.venue, streetLine || undefined, tail].filter(isPresent).join(", ")
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
export function createUsgovNADAdapter(): CorpusAdapter {
|
|
@@ -21,12 +21,13 @@
|
|
|
21
21
|
* License: stamped `"Public Domain"` per CMS's federal government distribution terms.
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
25
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
24
26
|
import { CSVSpliterator } from "spliterator"
|
|
25
27
|
|
|
26
|
-
import { splitStreetLine, stableSourceID } from "
|
|
27
|
-
import { lookupStateAbbreviation } from "
|
|
28
|
-
import {
|
|
29
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
28
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils"
|
|
29
|
+
import { lookupStateAbbreviation } from "#codex/us-fips-state"
|
|
30
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -49,7 +50,7 @@ interface NPPESRow {
|
|
|
49
50
|
"Provider Second Line Business Practice Location Address": string
|
|
50
51
|
"Provider Business Practice Location Address City Name": string
|
|
51
52
|
"Provider Business Practice Location Address State Name": string
|
|
52
|
-
"Provider Business Practice Location Address
|
|
53
|
+
"Provider Business Practice Location Address Postcode": string
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
function composeRaw(
|
|
@@ -60,10 +61,11 @@ function composeRaw(
|
|
|
60
61
|
state: string,
|
|
61
62
|
postcode: string
|
|
62
63
|
): string {
|
|
63
|
-
const streetPart = [house, street].filter(
|
|
64
|
-
const cityPart = [city.trim(), [state, postcode].filter(Boolean).join(" ").trim()].filter(Boolean).join(", ")
|
|
64
|
+
const streetPart = [house, street].filter(isPresent).join(" ").trim()
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
const cityPart = [city.trim(), [state, postcode].filter(isPresent).join(" ").trim()].filter(isPresent).join(", ")
|
|
67
|
+
|
|
68
|
+
return [venue, streetPart, cityPart].filter(isPresent).join(", ")
|
|
67
69
|
}
|
|
68
70
|
|
|
69
71
|
export function createUsgovNPPESAdapter(): CorpusAdapter {
|
|
@@ -92,7 +94,6 @@ export function createUsgovNPPESAdapter(): CorpusAdapter {
|
|
|
92
94
|
if (opts.limit !== undefined && emitted >= opts.limit) break
|
|
93
95
|
|
|
94
96
|
const npi = (record.NPI ?? "").trim()
|
|
95
|
-
const entityType = (record["Entity Type Code"] ?? "").trim()
|
|
96
97
|
const orgName = (record["Provider Organization Name (Legal Business Name)"] ?? "").trim()
|
|
97
98
|
const lastName = (record["Provider Last Name (Legal Name)"] ?? "").trim()
|
|
98
99
|
const firstName = (record["Provider First Name"] ?? "").trim()
|
|
@@ -101,7 +102,7 @@ export function createUsgovNPPESAdapter(): CorpusAdapter {
|
|
|
101
102
|
const address2 = (record["Provider Second Line Business Practice Location Address"] ?? "").trim()
|
|
102
103
|
const city = (record["Provider Business Practice Location Address City Name"] ?? "").trim()
|
|
103
104
|
const stateRaw = (record["Provider Business Practice Location Address State Name"] ?? "").trim()
|
|
104
|
-
const postcode = (record["Provider Business Practice Location Address
|
|
105
|
+
const postcode = (record["Provider Business Practice Location Address Postcode"] ?? "").trim()
|
|
105
106
|
|
|
106
107
|
if (!city || !postcode) continue
|
|
107
108
|
|
|
@@ -109,12 +110,12 @@ export function createUsgovNPPESAdapter(): CorpusAdapter {
|
|
|
109
110
|
|
|
110
111
|
if (!state) continue
|
|
111
112
|
|
|
112
|
-
const fullStreet = [address1, address2].filter(
|
|
113
|
+
const fullStreet = [address1, address2].filter(isPresent).join(" ")
|
|
113
114
|
const split = splitStreetLine(fullStreet)
|
|
114
115
|
|
|
115
116
|
if (!split) continue
|
|
116
117
|
|
|
117
|
-
const venue = orgName || [firstName, lastName].filter(
|
|
118
|
+
const venue = orgName || [firstName, lastName].filter(isPresent).join(" ") || undefined
|
|
118
119
|
|
|
119
120
|
const components: CanonicalRow["components"] = {
|
|
120
121
|
...(venue ? { venue } : {}),
|
|
@@ -28,12 +28,13 @@
|
|
|
28
28
|
* distribution terms.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
32
|
+
import { reconcileComponents } from "@mailwoman/formatter"
|
|
31
33
|
import { CSVSpliterator } from "spliterator"
|
|
32
34
|
|
|
33
|
-
import { splitStreetLine, stableSourceID } from "
|
|
34
|
-
import { lookupStateAbbreviation } from "
|
|
35
|
-
import {
|
|
36
|
-
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "../../types.ts"
|
|
35
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils"
|
|
36
|
+
import { lookupStateAbbreviation } from "#codex/us-fips-state"
|
|
37
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
@@ -115,10 +116,10 @@ function composeRaw(
|
|
|
115
116
|
state: string,
|
|
116
117
|
postcode: string
|
|
117
118
|
): string {
|
|
118
|
-
const streetPart = [house, street].filter(
|
|
119
|
-
const cityPart = [city.trim(), [state, postcode].filter(
|
|
119
|
+
const streetPart = [house, street].filter(isPresent).join(" ").trim()
|
|
120
|
+
const cityPart = [city.trim(), [state, postcode].filter(isPresent).join(" ").trim()].filter(isPresent).join(", ")
|
|
120
121
|
|
|
121
|
-
return [venue.trim(), streetPart, cityPart].filter(
|
|
122
|
+
return [venue.trim(), streetPart, cityPart].filter(isPresent).join(", ")
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
export function createUsgovSamhsaTreatmentLocatorAdapter(): CorpusAdapter {
|
|
@@ -27,7 +27,7 @@ import { createHash, type Hash } from "node:crypto"
|
|
|
27
27
|
import type { ComponentTag } from "@mailwoman/core/types"
|
|
28
28
|
import { sha256Hex } from "@mailwoman/core/utils"
|
|
29
29
|
|
|
30
|
-
import type { CanonicalRow, CorpusAdapter } from "
|
|
30
|
+
import type { CanonicalRow, CorpusAdapter } from "#types"
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Lookup table for corpus adapters.
|
|
@@ -104,8 +104,20 @@ export const defaultAdapterRegistry = new InMemoryAdapterRegistry()
|
|
|
104
104
|
* length.
|
|
105
105
|
*/
|
|
106
106
|
export function stableSourceID(adapterID: string, components: Partial<Record<ComponentTag, string>>): string {
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
return stableSourceIDFromParts(adapterID, components)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* {@link stableSourceID} over arbitrary disambiguator keys — a variant index, a slot number, anything that is not a
|
|
112
|
+
* `ComponentTag`. Every key handed in is sorted and hashed either way; only the key vocabulary differs, and the narrow
|
|
113
|
+
* signature above is what stops an adapter hashing a misspelled component name.
|
|
114
|
+
*/
|
|
115
|
+
export function stableSourceIDFromParts(
|
|
116
|
+
adapterID: string,
|
|
117
|
+
parts: Readonly<Record<string, string | undefined>>
|
|
118
|
+
): string {
|
|
119
|
+
const sortedKeys = Object.keys(parts).toSorted()
|
|
120
|
+
const payload = sortedKeys.map((k) => `${k}=${parts[k] ?? ""}`).join("\u001F")
|
|
109
121
|
// One `update` over the joined string, not three chained ones — identical byte stream either way,
|
|
110
122
|
// but the separator has to stay inline or every id in every shard changes.
|
|
111
123
|
const digest = sha256Hex(`${adapterID}\u001E${payload}`)
|
|
@@ -31,7 +31,10 @@
|
|
|
31
31
|
|
|
32
32
|
import { DatabaseSync } from "node:sqlite"
|
|
33
33
|
|
|
34
|
-
import
|
|
34
|
+
import { isPresent } from "@mailwoman/core/objects"
|
|
35
|
+
import { allRows, getRow } from "@mailwoman/core/utils"
|
|
36
|
+
|
|
37
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
35
38
|
|
|
36
39
|
/**
|
|
37
40
|
* Ancestry hops walked upward from a WOF record before giving up — deeper than any real JP admin chain.
|
|
@@ -52,12 +55,6 @@ interface PlaceRow {
|
|
|
52
55
|
country: string
|
|
53
56
|
}
|
|
54
57
|
|
|
55
|
-
interface NameRow {
|
|
56
|
-
id: number
|
|
57
|
-
name: string
|
|
58
|
-
language: string
|
|
59
|
-
}
|
|
60
|
-
|
|
61
58
|
/**
|
|
62
59
|
* Walk parent chain up to 6 levels, over a place table already resident in memory.
|
|
63
60
|
*
|
|
@@ -125,7 +122,7 @@ export function synthesizeJpAddress(
|
|
|
125
122
|
components.dependent_locality = neighbourhoodName
|
|
126
123
|
}
|
|
127
124
|
|
|
128
|
-
const raw = [regionName, localityName, neighbourhoodName].filter(
|
|
125
|
+
const raw = [regionName, localityName, neighbourhoodName].filter(isPresent).join("")
|
|
129
126
|
|
|
130
127
|
return { raw, components }
|
|
131
128
|
}
|
|
@@ -161,16 +158,16 @@ export function createWOFAdminJpAdapter(): CorpusAdapter {
|
|
|
161
158
|
// seed; there are tens of thousands of neighbourhood seeds.
|
|
162
159
|
const byID = new Map<number, PlaceRow>()
|
|
163
160
|
|
|
164
|
-
for (const row of
|
|
165
|
-
.prepare(`SELECT id, name, placetype, parent_id, country FROM spr WHERE country='JP'`)
|
|
166
|
-
|
|
161
|
+
for (const row of allRows<PlaceRow>(
|
|
162
|
+
db.prepare(`SELECT id, name, placetype, parent_id, country FROM spr WHERE country='JP'`)
|
|
163
|
+
)) {
|
|
167
164
|
byID.set(row.id, row)
|
|
168
165
|
}
|
|
169
166
|
|
|
170
167
|
const outsideStmt = db.prepare(`SELECT id, name, placetype, parent_id, country FROM spr WHERE id = ?`)
|
|
171
168
|
|
|
172
169
|
const resolveOutside = (id: number): PlaceRow | undefined => {
|
|
173
|
-
const row = outsideStmt
|
|
170
|
+
const row = getRow<PlaceRow>(outsideStmt, id)
|
|
174
171
|
|
|
175
172
|
if (row) {
|
|
176
173
|
byID.set(id, row)
|
|
@@ -42,9 +42,10 @@
|
|
|
42
42
|
import type { WhosOnFirstPlacetype } from "@mailwoman/core/resources/whosonfirst"
|
|
43
43
|
import type { ComponentTag } from "@mailwoman/core/types"
|
|
44
44
|
|
|
45
|
-
import {
|
|
46
|
-
import
|
|
47
|
-
|
|
45
|
+
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "#types"
|
|
46
|
+
import { buildAncestryIndex, normalizeNameKey, walkFeatures, type WOFRecord } from "#utils"
|
|
47
|
+
|
|
48
|
+
import { emitWOFJSONRows, type WOFVariantSpec } from "../wof-json-rows.ts"
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
51
|
* Display name for the country, keyed by ISO 3166-1 alpha-2.
|
|
@@ -96,18 +97,6 @@ function placetypeToTag(placetype: WhosOnFirstPlacetype | string): ComponentTag
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
interface VariantSpec {
|
|
100
|
-
/**
|
|
101
|
-
* Hierarchy-variant id appended to `source_id`.
|
|
102
|
-
*/
|
|
103
|
-
suffix: string
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Component tag → display string the adapter will hand to the runner.
|
|
107
|
-
*/
|
|
108
|
-
components: Partial<Record<ComponentTag, string>>
|
|
109
|
-
}
|
|
110
|
-
|
|
111
100
|
/**
|
|
112
101
|
* Compute the hierarchy variants for a record given its ancestry chain and the chosen `selfName`.
|
|
113
102
|
*
|
|
@@ -118,7 +107,7 @@ interface VariantSpec {
|
|
|
118
107
|
* Country variants substitute `COUNTRY_DISPLAY_NAME` for the default slot so the OpenCage template produces the
|
|
119
108
|
* canonicalized form (`"United States of America"`), matching the legacy SQLite adapter's behavior.
|
|
120
109
|
*/
|
|
121
|
-
export function variantsFor(row: WOFRecord, ancestry: WOFRecord[], selfName: string):
|
|
110
|
+
export function variantsFor(row: WOFRecord, ancestry: WOFRecord[], selfName: string): WOFVariantSpec[] {
|
|
122
111
|
const selfTag = placetypeToTag(row.placetype)
|
|
123
112
|
|
|
124
113
|
if (!selfTag) return []
|
|
@@ -127,7 +116,7 @@ export function variantsFor(row: WOFRecord, ancestry: WOFRecord[], selfName: str
|
|
|
127
116
|
const country = ancestry.find((a) => placetypeToTag(a.placetype) === "country")
|
|
128
117
|
const countryDisplay = COUNTRY_DISPLAY_NAME[row.country] ?? country?.name ?? row.country
|
|
129
118
|
|
|
130
|
-
const variants:
|
|
119
|
+
const variants: WOFVariantSpec[] = []
|
|
131
120
|
|
|
132
121
|
switch (selfTag) {
|
|
133
122
|
case "locality":
|
|
@@ -248,43 +237,15 @@ export function createWOFAdminAdapter(): CorpusAdapter {
|
|
|
248
237
|
const ancestry = buildAncestryIndex(byID)
|
|
249
238
|
|
|
250
239
|
// Pass 2: emit rows in sorted-id order for deterministic JSONL.
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
for (const slot of slots) {
|
|
261
|
-
const variants = variantsFor(rec, chain, slot.value)
|
|
262
|
-
|
|
263
|
-
for (const variant of variants) {
|
|
264
|
-
if (opts.limit !== undefined && emitted >= opts.limit) return
|
|
265
|
-
|
|
266
|
-
const raw = formatAddress(variant.components, rec.country, { separator: ", " })
|
|
267
|
-
|
|
268
|
-
if (!raw) continue
|
|
269
|
-
const aligned = reconcileComponents(variant.components, raw)
|
|
270
|
-
|
|
271
|
-
if (!Object.keys(aligned).length) continue
|
|
272
|
-
|
|
273
|
-
yield {
|
|
274
|
-
raw,
|
|
275
|
-
components: aligned,
|
|
276
|
-
country: rec.country,
|
|
277
|
-
locale: LOCALE_BY_COUNTRY[rec.country],
|
|
278
|
-
source: WOF_ADMIN_ADAPTER_ID,
|
|
279
|
-
source_id: `${WOF_ADMIN_ADAPTER_ID}-${rec.id}-${slot.key}-${variant.suffix}`,
|
|
280
|
-
corpus_version: "",
|
|
281
|
-
license: "CC0-1.0",
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
emitted++
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
240
|
+
yield* emitWOFJSONRows({
|
|
241
|
+
records: byID,
|
|
242
|
+
ancestry,
|
|
243
|
+
adapterOptions: opts,
|
|
244
|
+
adapterID: WOF_ADMIN_ADAPTER_ID,
|
|
245
|
+
localeByCountry: LOCALE_BY_COUNTRY,
|
|
246
|
+
nameSlotsFor,
|
|
247
|
+
variantsFor,
|
|
248
|
+
})
|
|
288
249
|
},
|
|
289
250
|
}
|
|
290
251
|
}
|