@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
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* @file The sub-venue lexicon's record schema and the shipped vocabulary it is seeded from — the
|
|
7
|
+
* emitted artifact's shape plus the designator, modifier and Wikidata-concept tables every build
|
|
8
|
+
* starts out holding.
|
|
9
|
+
*
|
|
10
|
+
* The shape follows `@mailwoman/poi-taxonomy`'s `taxonomy.json` idiom exactly — typed records plus a
|
|
11
|
+
* FLAT phrase array keyed back to a record id, which is what makes a longest-match phrase index cheap
|
|
12
|
+
* to build over it. {@link SubVenueSurface} is this table's `SynonymEntry`.
|
|
13
|
+
*
|
|
14
|
+
* The seeds DUPLICATE `neural/venue-structure.ts` knowingly: `@mailwoman/corpus` does not depend on
|
|
15
|
+
* `@mailwoman/neural` (the dependency runs the other way for the training path, and pulling
|
|
16
|
+
* onnxruntime into a corpus build to read three string arrays would be absurd), so the shipped
|
|
17
|
+
* vocabulary is re-declared here. That is a drift surface and it is stated rather than hidden —
|
|
18
|
+
* `sub-venue-lexicon.test.ts` pins the seed's contents literally, so a change in either place fails a
|
|
19
|
+
* test rather than passing silently.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { SubVenuePromotion } from "../sub-venue-promotions.ts"
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This table's own data version. Bump when the source vintages or the build semantics change.
|
|
26
|
+
*
|
|
27
|
+
* `0.2.0` — wave 2: per-region attestation, the phrase-attribution fix (finding 3 above), derived head nouns, the
|
|
28
|
+
* Overture source, and the `promotions[]` receipts section.
|
|
29
|
+
*/
|
|
30
|
+
export const SUBVENUE_LEXICON_VERSION = "0.2.0"
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Which side of the containment relation a designator names. Mirrors `@mailwoman/osm/sdk`'s `SubVenueTier`; re-declared
|
|
34
|
+
* for the same dependency-direction reason as the seed.
|
|
35
|
+
*/
|
|
36
|
+
export const LexiconTier = {
|
|
37
|
+
SubVenue: "subvenue",
|
|
38
|
+
Venue: "venue",
|
|
39
|
+
} as const
|
|
40
|
+
|
|
41
|
+
export type LexiconTier = (typeof LexiconTier)[keyof typeof LexiconTier]
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* One designator record — a venue-interior (or containing-venue) structural noun.
|
|
45
|
+
*/
|
|
46
|
+
export interface SubVenueDesignator {
|
|
47
|
+
/**
|
|
48
|
+
* Canonical id, lowercase English. Matches `neural/venue-structure.ts`'s `VENUE_STRUCTURE_DESIGNATORS` wherever the
|
|
49
|
+
* two overlap.
|
|
50
|
+
*/
|
|
51
|
+
id: string
|
|
52
|
+
tier: LexiconTier
|
|
53
|
+
/**
|
|
54
|
+
* Whether this designator may be preceded by a {@link SubVenueModifier} — the `North Terminal` shape.
|
|
55
|
+
*
|
|
56
|
+
* A SUBSET, and the exclusions are load-bearing: `gate` and `building` form ordinary STREET names in exactly this
|
|
57
|
+
* shape ("East Gate" is a real GB street, "Building Society Place" is a real street), so admitting them turns a
|
|
58
|
+
* correct street parse into a sub-venue one. Setting this true means claiming no street is named `<modifier> <id>`.
|
|
59
|
+
* Check before you do.
|
|
60
|
+
*/
|
|
61
|
+
modifierEligible: boolean
|
|
62
|
+
/**
|
|
63
|
+
* Whether the shipped span proposer already recognizes this designator. `false` means the lexicon proposes it and
|
|
64
|
+
* nothing consumes it yet.
|
|
65
|
+
*/
|
|
66
|
+
shipped: boolean
|
|
67
|
+
/**
|
|
68
|
+
* Where the term comes from, one entry per attesting source: `wof:placetype`, `osm:aeroway=terminal`,
|
|
69
|
+
* `wikidata:Q849706`, `overture:airport_terminal`. Sorted, so a regenerate is stable.
|
|
70
|
+
*/
|
|
71
|
+
provenance: string[]
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* One positional modifier — the `North`/`Upper`/`Main` half of `North Terminal`.
|
|
76
|
+
*/
|
|
77
|
+
export interface SubVenueModifier {
|
|
78
|
+
id: string
|
|
79
|
+
shipped: boolean
|
|
80
|
+
provenance: string[]
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* One surface form: a phrase, the record it names, and where it was attested.
|
|
85
|
+
*
|
|
86
|
+
* This is the table's `SynonymEntry` — the flat array a phrase index is built over.
|
|
87
|
+
*/
|
|
88
|
+
export interface SubVenueSurface {
|
|
89
|
+
/**
|
|
90
|
+
* The phrase, lowercased for Latin-script languages and left as written otherwise — case-folding is meaningless for
|
|
91
|
+
* Han and Kana, which the script guard excludes.
|
|
92
|
+
*
|
|
93
|
+
* It does NOT exclude Turkish: `İ` (U+0130) is `\p{Script=Latin}`, so the guard admits it and `toLowerCase` folds it
|
|
94
|
+
* to `i` plus a combining dot above. A Turkish surface therefore round-trips through a form its own locale would not
|
|
95
|
+
* write. Nothing shipped depends on that today; a Turkish designator would.
|
|
96
|
+
*/
|
|
97
|
+
phrase: string
|
|
98
|
+
/**
|
|
99
|
+
* The {@link SubVenueDesignator.id} or {@link SubVenueModifier.id} this phrase is a surface of.
|
|
100
|
+
*/
|
|
101
|
+
recordID: string
|
|
102
|
+
/**
|
|
103
|
+
* Which record table `recordID` points into.
|
|
104
|
+
*/
|
|
105
|
+
recordKind: "designator" | "modifier"
|
|
106
|
+
/**
|
|
107
|
+
* BCP-47-ish language subtag as the source wrote it (`en`, `ja`, `zh-Hant`, `pt-BR`), or `und` when the source gave
|
|
108
|
+
* an untagged default name.
|
|
109
|
+
*/
|
|
110
|
+
lang: string
|
|
111
|
+
/**
|
|
112
|
+
* ISO 3166-1 alpha-2 of the DATA the phrase was attested in, `""` for vocabulary sources that attest a term's
|
|
113
|
+
* existence rather than its use anywhere. This is the axis promotion is decided on: `hall` is attested 3,274 times in
|
|
114
|
+
* `GB` and every promotion of it lives or dies on a per-region census, never a global one.
|
|
115
|
+
*/
|
|
116
|
+
region: string
|
|
117
|
+
/**
|
|
118
|
+
* `wikidata:label`, `wikidata:alt`, `osm:name`, `osm:name:<lang>`, `overture:name`, `derived:head-noun`, or `seed`.
|
|
119
|
+
*/
|
|
120
|
+
source: string
|
|
121
|
+
/**
|
|
122
|
+
* Whether a human has approved this surface for parsing use IN ITS REGION. Everything machine-derived starts `false`
|
|
123
|
+
* and is flipped only by a matching {@link SubVenuePromotion}. A consumer that gates a parse MUST filter on this — see
|
|
124
|
+
* `sub-venue-lexicon.ts`'s module docstring for what a promotion decides and why it is per-locale.
|
|
125
|
+
*/
|
|
126
|
+
curated: boolean
|
|
127
|
+
/**
|
|
128
|
+
* How many source features attested this exact phrase, when the source counts (OSM, Overture). `0` for vocabulary
|
|
129
|
+
* sources, which attest a term's EXISTENCE rather than its frequency.
|
|
130
|
+
*/
|
|
131
|
+
observations: number
|
|
132
|
+
/**
|
|
133
|
+
* The rule-assigned designator of the FEATURES that carried this phrase, with a count each — `platform:3205
|
|
134
|
+
* campus:49` for GB's `hall`. Empty for vocabulary sources.
|
|
135
|
+
*
|
|
136
|
+
* This is the confound axis. A `hall` on a `platform` row is a British bus stop named after a village hall; a `hall`
|
|
137
|
+
* on a `terminal` row is a real German departure hall. Without it, a surface's `observations` count is a magnitude
|
|
138
|
+
* with no sign — see the repo's "meaning of zero" rule, which applies just as hard to a large number.
|
|
139
|
+
*/
|
|
140
|
+
context: Record<string, number>
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* The measured shape of a designator's identifier half — what follows `Gate`/`Terminal` in real data.
|
|
145
|
+
*
|
|
146
|
+
* Derived from OSM `ref` values, NOT from names, and that is why the artifact has a section for it at all. Every one of
|
|
147
|
+
* Berlin's 26 `aeroway=gate` features is unnamed and carries only a `ref`: `13`, `6`, `0/1`, `14/15`, `16-18`. So `Gate
|
|
148
|
+
* A12` is a RENDERING (`<designator> <ref>`) rather than a string anyone has written down, and a shard that wants to
|
|
149
|
+
* generate the designator+identifier form needs the identifier DISTRIBUTION, not a list of phrases.
|
|
150
|
+
*/
|
|
151
|
+
export interface IdentifierShape {
|
|
152
|
+
designatorID: string
|
|
153
|
+
/**
|
|
154
|
+
* ISO 3166-1 alpha-2 of the extract this distribution was measured in. Per-region because the shapes differ: GB gates
|
|
155
|
+
* are 70% bare digits, Japanese platform refs are overwhelmingly bare digits with a different range, and a shard that
|
|
156
|
+
* generates `Gate <ref>` for a French address should sample France's distribution.
|
|
157
|
+
*/
|
|
158
|
+
region: string
|
|
159
|
+
/**
|
|
160
|
+
* A coarse class: `digit` (`5`), `letter` (`B`), `letter-digit` (`A12`), `digit-letter` (`2F`), `range` (`16-18`,
|
|
161
|
+
* `0/1`), or `other`.
|
|
162
|
+
*/
|
|
163
|
+
shape: string
|
|
164
|
+
observations: number
|
|
165
|
+
/**
|
|
166
|
+
* Up to eight real values, sorted, so a shard author can see what the class actually contains.
|
|
167
|
+
*/
|
|
168
|
+
examples: string[]
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* One input source's provenance, copied off its fetch manifest.
|
|
173
|
+
*/
|
|
174
|
+
export interface SubVenueLexiconSource {
|
|
175
|
+
id: string
|
|
176
|
+
origin: string
|
|
177
|
+
license: string
|
|
178
|
+
retrieved: string
|
|
179
|
+
rows: number
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The committed table.
|
|
184
|
+
*/
|
|
185
|
+
export interface SubVenueLexiconTable {
|
|
186
|
+
version: string
|
|
187
|
+
sources: SubVenueLexiconSource[]
|
|
188
|
+
designators: SubVenueDesignator[]
|
|
189
|
+
modifiers: SubVenueModifier[]
|
|
190
|
+
surfaces: SubVenueSurface[]
|
|
191
|
+
identifierShapes: IdentifierShape[]
|
|
192
|
+
/**
|
|
193
|
+
* Every curation decision taken against this table, promotion AND rejection, each with the census that backs it. A
|
|
194
|
+
* rejection is as load-bearing as a promotion: it is what stops the next reader re-proposing `hall` for en-GB.
|
|
195
|
+
*/
|
|
196
|
+
promotions: SubVenuePromotion[]
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The vocabulary that already ships in `neural/venue-structure.ts`, re-declared. See the module docstring for why this
|
|
201
|
+
* duplication exists.
|
|
202
|
+
*
|
|
203
|
+
* `tier` is added here (the shipped list has no such field): the seven WOF placetypes plus `terminal`/`gate` are all
|
|
204
|
+
* venue-INTERIOR, except `campus` and `building`, which name a whole venue as often as a part of one. They are marked
|
|
205
|
+
* `subvenue` anyway, because that is the role the span proposer uses them in — `Building 43, Googleplex` is a unit
|
|
206
|
+
* inside a venue.
|
|
207
|
+
*/
|
|
208
|
+
export const SHIPPED_DESIGNATOR_SEED: ReadonlyArray<{
|
|
209
|
+
id: string
|
|
210
|
+
modifierEligible: boolean
|
|
211
|
+
provenance: string[]
|
|
212
|
+
}> = [
|
|
213
|
+
{ id: "arcade", modifierEligible: true, provenance: ["wof:placetype"] },
|
|
214
|
+
{ id: "building", modifierEligible: false, provenance: ["wof:placetype"] },
|
|
215
|
+
{ id: "campus", modifierEligible: true, provenance: ["wof:placetype"] },
|
|
216
|
+
{ id: "concourse", modifierEligible: true, provenance: ["wof:placetype"] },
|
|
217
|
+
{ id: "enclosure", modifierEligible: false, provenance: ["wof:placetype"] },
|
|
218
|
+
{ id: "gate", modifierEligible: false, provenance: ["osm:aeroway=gate"] },
|
|
219
|
+
{ id: "installation", modifierEligible: false, provenance: ["wof:placetype"] },
|
|
220
|
+
{ id: "terminal", modifierEligible: true, provenance: ["osm:aeroway=terminal"] },
|
|
221
|
+
{ id: "wing", modifierEligible: true, provenance: ["wof:placetype"] },
|
|
222
|
+
]
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The shipped positional modifiers, re-declared from `neural/venue-structure.ts`'s `VENUE_STRUCTURE_MODIFIERS`.
|
|
226
|
+
*/
|
|
227
|
+
export const SHIPPED_MODIFIER_SEED: readonly string[] = [
|
|
228
|
+
"central",
|
|
229
|
+
"east",
|
|
230
|
+
"front",
|
|
231
|
+
"inner",
|
|
232
|
+
"lower",
|
|
233
|
+
"main",
|
|
234
|
+
"north",
|
|
235
|
+
"outer",
|
|
236
|
+
"rear",
|
|
237
|
+
"south",
|
|
238
|
+
"upper",
|
|
239
|
+
"west",
|
|
240
|
+
]
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Designators the lexicon ADDS beyond what ships, each with the source that attests it.
|
|
244
|
+
*
|
|
245
|
+
* `platform`, `station` and `airport` come from the OSM extractor's rule table and are the rail/aviation venue-side
|
|
246
|
+
* vocabulary the corpus line needs. `hall` and `satellite` come from Wikidata concepts and from
|
|
247
|
+
* `wof-osm-placetype-map.mdx`'s own "plausible additions" note, which lists `hall` explicitly. `pier` joins them in
|
|
248
|
+
* wave 2 on 282 Overture attestations in the `pier` category plus 162 in the GB extract — the corpus task names `Pier
|
|
249
|
+
* C` as a target shape, so the record has to exist before a shard can generate it.
|
|
250
|
+
*
|
|
251
|
+
* None is `modifierEligible`: that claim needs a confound board per term AND per locale, and `sub-venue-promotions.ts`
|
|
252
|
+
* is where those live. A promotion marks a SURFACE usable; it does not widen the modifier grammar.
|
|
253
|
+
*/
|
|
254
|
+
export const PROPOSED_DESIGNATORS: ReadonlyArray<{
|
|
255
|
+
id: string
|
|
256
|
+
tier: LexiconTier
|
|
257
|
+
provenance: string[]
|
|
258
|
+
}> = [
|
|
259
|
+
{ id: "airport", tier: LexiconTier.Venue, provenance: ["osm:aeroway=aerodrome"] },
|
|
260
|
+
{ id: "hall", tier: LexiconTier.SubVenue, provenance: ["wikidata:Q240854"] },
|
|
261
|
+
{ id: "pier", tier: LexiconTier.SubVenue, provenance: ["overture:pier"] },
|
|
262
|
+
{ id: "platform", tier: LexiconTier.SubVenue, provenance: ["osm:public_transport=platform", "osm:railway=platform"] },
|
|
263
|
+
{ id: "satellite", tier: LexiconTier.SubVenue, provenance: ["wikidata:Q15990706"] },
|
|
264
|
+
{ id: "station", tier: LexiconTier.Venue, provenance: ["osm:railway=station"] },
|
|
265
|
+
]
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* `designatorID` → Wikidata QID, mirroring `fetch/wikidata-subvenue.ts`'s `SUBVENUE_CONCEPTS`. Re-declared here so the
|
|
269
|
+
* builder stays a pure function over PARSED input rather than reaching into a fetch module for a constant; the test
|
|
270
|
+
* pins the two against each other.
|
|
271
|
+
*/
|
|
272
|
+
export const CONCEPT_QIDS: Readonly<Record<string, string>> = {
|
|
273
|
+
terminal: "Q849706",
|
|
274
|
+
gate: "Q247739",
|
|
275
|
+
concourse: "Q862212",
|
|
276
|
+
campus: "Q209465",
|
|
277
|
+
building: "Q41176",
|
|
278
|
+
arcade: "Q186637",
|
|
279
|
+
hall: "Q240854",
|
|
280
|
+
satellite: "Q15990706",
|
|
281
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* @file The Wikidata leg of the sub-venue lexicon — turning the designator-label SPARQL payload into
|
|
7
|
+
* surfaces.
|
|
8
|
+
*
|
|
9
|
+
* Reads an already-parsed payload rather than issuing a query: the acquisition lives in
|
|
10
|
+
* `fetch/wikidata-subvenue.ts`, and keeping the conversion a pure function of parsed input is what
|
|
11
|
+
* lets the builder stay deterministic and testable with no network and no fixture on disk.
|
|
12
|
+
*
|
|
13
|
+
* Wikidata gives a CONCEPT NAME per language, not a designator as addressed. Q849706's Spanish label
|
|
14
|
+
* is `terminal aeroportuaria`; the addressed form is `Terminal`. So every surface produced here lands
|
|
15
|
+
* `curated: false`, and the head-noun derivation is what proposes the addressed form from it.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { normalizeSurface } from "./surfaces.ts"
|
|
19
|
+
import { CONCEPT_QIDS, type SubVenueSurface } from "./table.ts"
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The SPARQL results envelope, narrowed to the columns the designator-label query produces.
|
|
23
|
+
*/
|
|
24
|
+
interface SPARQLBinding {
|
|
25
|
+
item?: { value: string }
|
|
26
|
+
lang?: { value: string }
|
|
27
|
+
label?: { value: string }
|
|
28
|
+
kind?: { value: string }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface SPARQLEnvelope {
|
|
32
|
+
results?: { bindings?: SPARQLBinding[] }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Turn the Wikidata designator-label payload into surfaces.
|
|
37
|
+
*
|
|
38
|
+
* A row is dropped when its language tag is empty (an untagged literal, which Wikidata occasionally carries), when the
|
|
39
|
+
* QID maps to no designator in {@link CONCEPT_QIDS}, or when the normalized phrase is empty. Everything that survives
|
|
40
|
+
* lands `curated: false` — see the module docstring.
|
|
41
|
+
*/
|
|
42
|
+
export function surfacesFromWikidata(
|
|
43
|
+
payload: unknown,
|
|
44
|
+
conceptQIDs: Readonly<Record<string, string>> = CONCEPT_QIDS
|
|
45
|
+
): SubVenueSurface[] {
|
|
46
|
+
const byQID = new Map(Object.entries(conceptQIDs).map(([id, qid]) => [qid, id]))
|
|
47
|
+
const envelope = payload as SPARQLEnvelope
|
|
48
|
+
const seen = new Set<string>()
|
|
49
|
+
const out: SubVenueSurface[] = []
|
|
50
|
+
|
|
51
|
+
for (const binding of envelope.results?.bindings ?? []) {
|
|
52
|
+
const qid = binding.item?.value?.split("/").pop()
|
|
53
|
+
const recordID = qid ? byQID.get(qid) : undefined
|
|
54
|
+
const lang = binding.lang?.value
|
|
55
|
+
const raw = binding.label?.value
|
|
56
|
+
|
|
57
|
+
if (!recordID || !lang || !raw) continue
|
|
58
|
+
|
|
59
|
+
const phrase = normalizeSurface(raw)
|
|
60
|
+
|
|
61
|
+
if (!phrase) continue
|
|
62
|
+
|
|
63
|
+
const source = binding.kind?.value === "alt" ? "wikidata:alt" : "wikidata:label"
|
|
64
|
+
// A concept can carry the same string as both a label and an alias, and across dialect subtags
|
|
65
|
+
// (`zh`, `zh-cn`, `zh-hans` all say 航站楼). Key the dedupe on the tuple that identifies a row.
|
|
66
|
+
const key = `${phrase}\0${recordID}\0${lang}\0${source}`
|
|
67
|
+
|
|
68
|
+
if (seen.has(key)) continue
|
|
69
|
+
seen.add(key)
|
|
70
|
+
|
|
71
|
+
out.push({
|
|
72
|
+
phrase,
|
|
73
|
+
recordID,
|
|
74
|
+
recordKind: "designator",
|
|
75
|
+
lang,
|
|
76
|
+
region: "",
|
|
77
|
+
source,
|
|
78
|
+
curated: false,
|
|
79
|
+
observations: 0,
|
|
80
|
+
context: {},
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return out
|
|
85
|
+
}
|