@mailwoman/corpus 9.3.0 → 10.0.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 +16 -0
- package/lib/adapters/geonames/adapter.ts +3 -3
- package/lib/adapters/geonames/postal/adapter.ts +122 -0
- package/lib/adapters/index.ts +39 -32
- package/lib/adapters/openaddresses/adapter.ts +4 -7
- package/lib/adapters/osm/adapter.ts +278 -0
- package/lib/adapters/overture/adapter.ts +22 -7
- package/lib/adapters/utils/index.ts +1 -1
- package/lib/adapters/wof/admin/json/adapter.ts +239 -0
- package/lib/adapters/wof/json-rows.ts +181 -0
- package/lib/adapters/wof/postalcode-json/adapter.ts +196 -0
- package/lib/au/adapters/gnaf/adapter.ts +152 -0
- package/lib/au/adapters/gnaf/assemble.ts +225 -0
- package/lib/cz/recipes/pcfirst-preposition.ts +112 -0
- package/lib/de/recipes/locale.ts +360 -0
- package/lib/fr/adapters/ban/adapter.ts +159 -0
- package/lib/fr/recipes/admin-split.ts +243 -0
- package/lib/fr/recipes/bare-street.ts +171 -0
- package/lib/fr/recipes/fragment.ts +334 -0
- package/lib/fr/recipes/lieudit.ts +274 -0
- package/lib/fr/recipes/order.ts +246 -0
- package/lib/fr/tools/fetch/ban.ts +289 -0
- package/lib/index.ts +1 -1
- package/lib/international/recipes/locale.ts +598 -0
- package/lib/jp/tools/fetch/houjin.ts +141 -0
- package/lib/kr/adapters/juso/label-rows.ts +259 -0
- package/lib/kr/adapters/localdata/align.ts +299 -0
- package/lib/kr/adapters/localdata/key-index.ts +185 -0
- package/lib/kr/adapters/localdata/permit-rows.ts +186 -0
- package/lib/kr/tools/fetch/juso.ts +172 -0
- package/lib/kr/tools/fetch/localdata.ts +206 -0
- package/lib/nl/recipes/postcode.ts +117 -0
- package/lib/no/recipes/fragment.ts +213 -0
- package/lib/no/recipes/street/index.ts +91 -0
- package/lib/no/recipes/street/led.ts +135 -0
- package/lib/recipes/anchor-absorption.ts +2 -2
- package/lib/recipes/bare/country.ts +95 -0
- package/lib/recipes/bare/postcode/eval.ts +99 -0
- package/lib/recipes/bare/postcode/index.ts +327 -0
- package/lib/recipes/boundary-stress.ts +3 -1
- package/lib/recipes/country-balanced.ts +3 -2
- package/lib/recipes/house-venue.ts +2 -1
- package/lib/recipes/index.ts +28 -21
- package/lib/recipes/intersection.ts +3 -2
- package/lib/recipes/po/box/cedex/au-nz.ts +82 -0
- package/lib/recipes/po/box/cedex/ca.ts +58 -0
- package/lib/recipes/po/box/cedex/fr.ts +76 -0
- package/lib/recipes/po/box/cedex/phrases.ts +108 -0
- package/lib/recipes/po/box/cedex/recipe.ts +203 -0
- package/lib/recipes/po/box/cedex/sources.ts +189 -0
- package/lib/recipes/po/box/cedex/types.ts +35 -0
- package/lib/recipes/po/box/cedex/us.ts +69 -0
- package/lib/recipes/po/box/cedex/vocabulary.ts +106 -0
- package/lib/recipes/po/box/cedex.ts +9 -0
- package/lib/recipes/po/box/index.ts +128 -0
- package/lib/recipes/scaffold.ts +18 -42
- package/lib/recipes/street/affix.ts +807 -0
- package/lib/recipes/street/bare.ts +102 -0
- package/lib/recipes/street.ts +3 -1
- package/lib/recipes/sub/venue/context.ts +149 -0
- package/lib/recipes/sub/venue/index.ts +997 -0
- package/lib/recipes/sub/venue/sources.ts +739 -0
- package/lib/recipes/trailing-region.ts +9 -9
- package/lib/recipes/unit.ts +3 -3
- package/lib/sg/recipes/register.ts +270 -0
- package/lib/sg/tools/fetch/acra.ts +179 -0
- package/lib/si/recipes/bare-village.ts +99 -0
- package/lib/south-asia/recipes/register.ts +214 -0
- package/lib/synthesizers/anchor-absorption.ts +1 -1
- package/lib/synthesizers/locale.ts +261 -0
- package/lib/synthesizers/street.ts +1 -1
- package/lib/synthesizers/utils.ts +2 -2
- package/lib/tools/audit.ts +3 -2
- package/lib/tools/corpus-stats.ts +3 -3
- package/lib/tools/fetch/download/index.ts +10 -0
- package/lib/tools/fetch/download/manifest.ts +102 -0
- package/lib/tools/fetch/download/network.ts +226 -0
- package/lib/tools/fetch/download/retry.ts +173 -0
- package/lib/tools/fetch/geonames/dump.ts +257 -0
- package/lib/tools/fetch/geonames/postal.ts +180 -0
- package/lib/tools/fetch/index.ts +47 -20
- package/lib/tools/fetch/openaddresses.ts +2 -2
- package/lib/tools/fetch/ourairports.ts +2 -2
- package/lib/tools/fetch/ppd.ts +1 -3
- package/lib/tools/fetch/wikidata-subvenue.ts +2 -2
- package/lib/tools/golden/promote.ts +340 -0
- package/lib/tools/golden/relabel-street/directory.ts +340 -0
- package/lib/tools/golden/relabel-street/index.ts +9 -0
- package/lib/tools/golden/relabel-street/row.ts +361 -0
- package/lib/tools/index.ts +10 -10
- package/lib/tools/ingest-csv.ts +5 -7
- package/lib/tools/lint/slice/vocab.ts +376 -0
- package/lib/tools/overlay-manifest.ts +92 -25
- package/lib/tools/overture-subvenue.ts +1 -1
- package/lib/tools/postcode-triples.ts +138 -14
- package/lib/tools/sub/venue/harvest.ts +234 -0
- package/lib/tools/sub/venue/head-nouns.ts +245 -0
- package/lib/tools/sub/venue/lexicon.ts +429 -0
- package/lib/tools/sub/venue/surfaces.ts +95 -0
- package/lib/tools/sub/venue/table.ts +281 -0
- package/lib/tools/sub/venue/wikidata.ts +85 -0
- package/lib/tw/tools/fetch/gcis.ts +180 -0
- package/lib/types.ts +1 -1
- package/lib/us/adapters/fcc-bdc/adapter.ts +173 -0
- package/lib/us/adapters/state/hi-schools/adapter.ts +160 -0
- package/lib/us/adapters/state/ia-contractors/adapter.ts +136 -0
- package/lib/us/adapters/state/ny-notaries/adapter.ts +133 -0
- package/lib/us/adapters/state/tx-notaries/adapter.ts +149 -0
- package/lib/us/adapters/tiger/adapter.ts +250 -0
- package/lib/us/adapters/usgov/hrsa-fqhc/adapter.ts +156 -0
- package/lib/us/adapters/usgov/imls-pls/adapter.ts +134 -0
- package/lib/us/adapters/usgov/irs-bmf/adapter.ts +145 -0
- package/lib/us/adapters/usgov/nad/adapter.ts +324 -0
- package/lib/us/adapters/usgov/nppes/adapter.ts +143 -0
- package/lib/us/adapters/usgov/samhsa-treatment-locator/adapter.ts +182 -0
- package/lib/us/tools/fetch/hrsa.ts +59 -0
- package/lib/us/tools/fetch/imls-pls.ts +149 -0
- package/lib/us/tools/fetch/nad.ts +341 -0
- package/lib/us/tools/fetch/nppes.ts +165 -0
- package/lib/us/tools/fetch/state/hi-schools.ts +161 -0
- package/lib/us/tools/fetch/state/sources.ts +146 -0
- package/lib/us/tools/fetch/tiger-full.ts +308 -0
- package/lib/utils/align.ts +1 -1
- package/lib/utils/golden.ts +12 -8
- package/lib/utils/wof-json.ts +7 -13
- package/out/adapters/geonames/adapter.d.ts +1 -1
- package/out/adapters/geonames/adapter.js +3 -3
- package/out/adapters/geonames/adapter.js.map +1 -1
- package/out/adapters/geonames/postal/adapter.d.ts.map +1 -0
- package/out/adapters/geonames/postal/adapter.js +107 -0
- package/out/adapters/geonames/postal/adapter.js.map +1 -0
- package/out/adapters/index.d.ts +16 -16
- package/out/adapters/index.d.ts.map +1 -1
- package/out/adapters/index.js +34 -32
- package/out/adapters/index.js.map +1 -1
- package/out/adapters/openaddresses/adapter.d.ts.map +1 -1
- package/out/adapters/openaddresses/adapter.js +4 -6
- package/out/adapters/openaddresses/adapter.js.map +1 -1
- package/out/adapters/osm/adapter.d.ts +95 -0
- package/out/adapters/osm/adapter.d.ts.map +1 -0
- package/out/adapters/osm/adapter.js +211 -0
- package/out/adapters/osm/adapter.js.map +1 -0
- package/out/adapters/overture/adapter.d.ts +10 -0
- package/out/adapters/overture/adapter.d.ts.map +1 -1
- package/out/adapters/overture/adapter.js +20 -7
- package/out/adapters/overture/adapter.js.map +1 -1
- package/out/adapters/synth-po-box/adapter.js.map +1 -1
- package/out/adapters/utils/index.d.ts +1 -1
- package/out/adapters/utils/index.d.ts.map +1 -1
- package/out/adapters/utils/index.js.map +1 -1
- package/out/adapters/wof/admin/json/adapter.d.ts +79 -0
- package/out/adapters/wof/admin/json/adapter.d.ts.map +1 -0
- package/out/adapters/wof/admin/json/adapter.js +204 -0
- package/out/adapters/wof/admin/json/adapter.js.map +1 -0
- package/out/adapters/wof/json-rows.d.ts +73 -0
- package/out/adapters/wof/json-rows.d.ts.map +1 -0
- package/out/adapters/wof/json-rows.js +115 -0
- package/out/adapters/wof/json-rows.js.map +1 -0
- package/out/adapters/wof/postalcode-json/adapter.d.ts +65 -0
- package/out/adapters/wof/postalcode-json/adapter.d.ts.map +1 -0
- package/out/adapters/wof/postalcode-json/adapter.js +167 -0
- package/out/adapters/wof/postalcode-json/adapter.js.map +1 -0
- package/out/au/adapters/gnaf/adapter.d.ts.map +1 -0
- package/out/au/adapters/gnaf/adapter.js +127 -0
- package/out/au/adapters/gnaf/adapter.js.map +1 -0
- package/out/au/adapters/gnaf/assemble.d.ts +65 -0
- package/out/au/adapters/gnaf/assemble.d.ts.map +1 -0
- package/out/au/adapters/gnaf/assemble.js +154 -0
- package/out/au/adapters/gnaf/assemble.js.map +1 -0
- package/out/cn/recipes/organizational-units.d.ts +36 -0
- package/out/cn/recipes/organizational-units.d.ts.map +1 -0
- package/out/cn/recipes/organizational-units.js +159 -0
- package/out/cn/recipes/organizational-units.js.map +1 -0
- package/out/cz/recipes/pcfirst-preposition.d.ts +22 -0
- package/out/cz/recipes/pcfirst-preposition.d.ts.map +1 -0
- package/out/cz/recipes/pcfirst-preposition.js +101 -0
- package/out/cz/recipes/pcfirst-preposition.js.map +1 -0
- package/out/de/recipes/locale.d.ts +44 -0
- package/out/de/recipes/locale.d.ts.map +1 -0
- package/out/de/recipes/locale.js +289 -0
- package/out/de/recipes/locale.js.map +1 -0
- package/out/env.d.ts +1 -1
- package/out/fr/adapters/ban/adapter.d.ts.map +1 -0
- package/out/fr/adapters/ban/adapter.js +123 -0
- package/out/fr/adapters/ban/adapter.js.map +1 -0
- package/out/fr/adapters/ban/street-decompose.d.ts.map +1 -0
- package/out/fr/adapters/ban/street-decompose.js.map +1 -0
- package/out/fr/recipes/admin-split.d.ts +38 -0
- package/out/fr/recipes/admin-split.d.ts.map +1 -0
- package/out/fr/recipes/admin-split.js +192 -0
- package/out/fr/recipes/admin-split.js.map +1 -0
- package/out/fr/recipes/bare-street.d.ts +28 -0
- package/out/fr/recipes/bare-street.d.ts.map +1 -0
- package/out/fr/recipes/bare-street.js +144 -0
- package/out/fr/recipes/bare-street.js.map +1 -0
- package/out/fr/recipes/fragment.d.ts +77 -0
- package/out/fr/recipes/fragment.d.ts.map +1 -0
- package/out/fr/recipes/fragment.js +277 -0
- package/out/fr/recipes/fragment.js.map +1 -0
- package/out/fr/recipes/lieudit.d.ts +32 -0
- package/out/fr/recipes/lieudit.d.ts.map +1 -0
- package/out/fr/recipes/lieudit.js +211 -0
- package/out/fr/recipes/lieudit.js.map +1 -0
- package/out/fr/recipes/order.d.ts +38 -0
- package/out/fr/recipes/order.d.ts.map +1 -0
- package/out/fr/recipes/order.js +198 -0
- package/out/fr/recipes/order.js.map +1 -0
- package/out/fr/tools/fetch/ban.d.ts +31 -0
- package/out/fr/tools/fetch/ban.d.ts.map +1 -0
- package/out/fr/tools/fetch/ban.js +239 -0
- package/out/fr/tools/fetch/ban.js.map +1 -0
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/index.js.map +1 -1
- package/out/international/recipes/locale.d.ts +136 -0
- package/out/international/recipes/locale.d.ts.map +1 -0
- package/out/international/recipes/locale.js +458 -0
- package/out/international/recipes/locale.js.map +1 -0
- package/out/jp/adapters/wof-admin/adapter.d.ts.map +1 -0
- package/out/jp/adapters/wof-admin/adapter.js.map +1 -0
- package/out/jp/tools/fetch/houjin.d.ts +24 -0
- package/out/jp/tools/fetch/houjin.d.ts.map +1 -0
- package/out/jp/tools/fetch/houjin.js +102 -0
- package/out/jp/tools/fetch/houjin.js.map +1 -0
- package/out/kr/adapters/juso/label-rows.d.ts +76 -0
- package/out/kr/adapters/juso/label-rows.d.ts.map +1 -0
- package/out/kr/adapters/juso/label-rows.js +194 -0
- package/out/kr/adapters/juso/label-rows.js.map +1 -0
- package/out/kr/adapters/localdata/align.d.ts +43 -0
- package/out/kr/adapters/localdata/align.d.ts.map +1 -0
- package/out/kr/adapters/localdata/align.js +223 -0
- package/out/kr/adapters/localdata/align.js.map +1 -0
- package/out/kr/adapters/localdata/key-index.d.ts +71 -0
- package/out/kr/adapters/localdata/key-index.d.ts.map +1 -0
- package/out/kr/adapters/localdata/key-index.js +133 -0
- package/out/kr/adapters/localdata/key-index.js.map +1 -0
- package/out/kr/adapters/localdata/permit-rows.d.ts +66 -0
- package/out/kr/adapters/localdata/permit-rows.d.ts.map +1 -0
- package/out/kr/adapters/localdata/permit-rows.js +131 -0
- package/out/kr/adapters/localdata/permit-rows.js.map +1 -0
- package/out/kr/tools/fetch/juso.d.ts +30 -0
- package/out/kr/tools/fetch/juso.d.ts.map +1 -0
- package/out/kr/tools/fetch/juso.js +120 -0
- package/out/kr/tools/fetch/juso.js.map +1 -0
- package/out/kr/tools/fetch/localdata.d.ts +30 -0
- package/out/kr/tools/fetch/localdata.d.ts.map +1 -0
- package/out/kr/tools/fetch/localdata.js +139 -0
- package/out/kr/tools/fetch/localdata.js.map +1 -0
- package/out/nl/recipes/postcode.d.ts +26 -0
- package/out/nl/recipes/postcode.d.ts.map +1 -0
- package/out/nl/recipes/postcode.js +103 -0
- package/out/nl/recipes/postcode.js.map +1 -0
- package/out/no/recipes/fragment.d.ts +43 -0
- package/out/no/recipes/fragment.d.ts.map +1 -0
- package/out/no/recipes/fragment.js +183 -0
- package/out/no/recipes/fragment.js.map +1 -0
- package/out/no/recipes/street/index.d.ts +18 -0
- package/out/no/recipes/street/index.d.ts.map +1 -0
- package/out/no/recipes/street/index.js +72 -0
- package/out/no/recipes/street/index.js.map +1 -0
- package/out/no/recipes/street/led.d.ts +24 -0
- package/out/no/recipes/street/led.d.ts.map +1 -0
- package/out/no/recipes/street/led.js +114 -0
- package/out/no/recipes/street/led.js.map +1 -0
- package/out/recipes/anchor-absorption.d.ts.map +1 -1
- package/out/recipes/anchor-absorption.js +2 -1
- package/out/recipes/anchor-absorption.js.map +1 -1
- package/out/recipes/bare/country.d.ts +25 -0
- package/out/recipes/bare/country.d.ts.map +1 -0
- package/out/recipes/bare/country.js +88 -0
- package/out/recipes/bare/country.js.map +1 -0
- package/out/recipes/bare/postcode/eval.d.ts +29 -0
- package/out/recipes/bare/postcode/eval.d.ts.map +1 -0
- package/out/recipes/bare/postcode/eval.js +85 -0
- package/out/recipes/bare/postcode/eval.js.map +1 -0
- package/out/recipes/bare/postcode/index.d.ts +62 -0
- package/out/recipes/bare/postcode/index.d.ts.map +1 -0
- package/out/recipes/bare/postcode/index.js +267 -0
- package/out/recipes/bare/postcode/index.js.map +1 -0
- package/out/recipes/boundary-stress.d.ts.map +1 -1
- package/out/recipes/boundary-stress.js +2 -1
- package/out/recipes/boundary-stress.js.map +1 -1
- package/out/recipes/country-balanced.d.ts.map +1 -1
- package/out/recipes/country-balanced.js +2 -1
- package/out/recipes/country-balanced.js.map +1 -1
- package/out/recipes/house-venue.d.ts.map +1 -1
- package/out/recipes/house-venue.js +2 -1
- package/out/recipes/house-venue.js.map +1 -1
- package/out/recipes/index.d.ts.map +1 -1
- package/out/recipes/index.js +28 -21
- package/out/recipes/index.js.map +1 -1
- package/out/recipes/intersection.d.ts.map +1 -1
- package/out/recipes/intersection.js +2 -1
- package/out/recipes/intersection.js.map +1 -1
- package/out/recipes/po/box/cedex/au-nz.d.ts +7 -0
- package/out/recipes/po/box/cedex/au-nz.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/au-nz.js +56 -0
- package/out/recipes/po/box/cedex/au-nz.js.map +1 -0
- package/out/recipes/po/box/cedex/ca.d.ts +7 -0
- package/out/recipes/po/box/cedex/ca.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/ca.js +38 -0
- package/out/recipes/po/box/cedex/ca.js.map +1 -0
- package/out/recipes/po/box/cedex/fr.d.ts +7 -0
- package/out/recipes/po/box/cedex/fr.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/fr.js +57 -0
- package/out/recipes/po/box/cedex/fr.js.map +1 -0
- package/out/recipes/po/box/cedex/phrases.d.ts +8 -0
- package/out/recipes/po/box/cedex/phrases.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/phrases.js +76 -0
- package/out/recipes/po/box/cedex/phrases.js.map +1 -0
- package/out/recipes/po/box/cedex/recipe.d.ts +9 -0
- package/out/recipes/po/box/cedex/recipe.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/recipe.js +153 -0
- package/out/recipes/po/box/cedex/recipe.js.map +1 -0
- package/out/recipes/po/box/cedex/sources.d.ts +86 -0
- package/out/recipes/po/box/cedex/sources.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/sources.js +143 -0
- package/out/recipes/po/box/cedex/sources.js.map +1 -0
- package/out/recipes/po/box/cedex/types.d.ts +31 -0
- package/out/recipes/po/box/cedex/types.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/types.js +5 -0
- package/out/recipes/po/box/cedex/types.js.map +1 -0
- package/out/recipes/po/box/cedex/us.d.ts +7 -0
- package/out/recipes/po/box/cedex/us.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/us.js +51 -0
- package/out/recipes/po/box/cedex/us.js.map +1 -0
- package/out/recipes/po/box/cedex/vocabulary.d.ts +68 -0
- package/out/recipes/po/box/cedex/vocabulary.d.ts.map +1 -0
- package/out/recipes/po/box/cedex/vocabulary.js +90 -0
- package/out/recipes/po/box/cedex/vocabulary.js.map +1 -0
- package/out/recipes/po/box/cedex.d.ts +9 -0
- package/out/recipes/po/box/cedex.d.ts.map +1 -0
- package/out/recipes/po/box/cedex.js +9 -0
- package/out/recipes/po/box/cedex.js.map +1 -0
- package/out/recipes/po/box/index.d.ts +17 -0
- package/out/recipes/po/box/index.d.ts.map +1 -0
- package/out/recipes/po/box/index.js +105 -0
- package/out/recipes/po/box/index.js.map +1 -0
- package/out/recipes/scaffold.d.ts +20 -1
- package/out/recipes/scaffold.d.ts.map +1 -1
- package/out/recipes/scaffold.js +18 -49
- package/out/recipes/scaffold.js.map +1 -1
- package/out/recipes/street/affix.d.ts +89 -0
- package/out/recipes/street/affix.d.ts.map +1 -0
- package/out/recipes/street/affix.js +565 -0
- package/out/recipes/street/affix.js.map +1 -0
- package/out/recipes/street/bare.d.ts +25 -0
- package/out/recipes/street/bare.d.ts.map +1 -0
- package/out/recipes/street/bare.js +87 -0
- package/out/recipes/street/bare.js.map +1 -0
- package/out/recipes/street.d.ts.map +1 -1
- package/out/recipes/street.js +2 -1
- package/out/recipes/street.js.map +1 -1
- package/out/recipes/sub/venue/context.d.ts +29 -0
- package/out/recipes/sub/venue/context.d.ts.map +1 -0
- package/out/recipes/sub/venue/context.js +106 -0
- package/out/recipes/sub/venue/context.js.map +1 -0
- package/out/recipes/sub/venue/index.d.ts +270 -0
- package/out/recipes/sub/venue/index.d.ts.map +1 -0
- package/out/recipes/sub/venue/index.js +728 -0
- package/out/recipes/sub/venue/index.js.map +1 -0
- package/out/recipes/sub/venue/sources.d.ts +209 -0
- package/out/recipes/sub/venue/sources.d.ts.map +1 -0
- package/out/recipes/sub/venue/sources.js +555 -0
- package/out/recipes/sub/venue/sources.js.map +1 -0
- package/out/recipes/trailing-region.d.ts.map +1 -1
- package/out/recipes/trailing-region.js +8 -2
- package/out/recipes/trailing-region.js.map +1 -1
- package/out/recipes/unit.d.ts.map +1 -1
- package/out/recipes/unit.js +2 -1
- package/out/recipes/unit.js.map +1 -1
- package/out/sg/recipes/register.d.ts +69 -0
- package/out/sg/recipes/register.d.ts.map +1 -0
- package/out/sg/recipes/register.js +211 -0
- package/out/sg/recipes/register.js.map +1 -0
- package/out/sg/tools/fetch/acra.d.ts +23 -0
- package/out/sg/tools/fetch/acra.d.ts.map +1 -0
- package/out/sg/tools/fetch/acra.js +126 -0
- package/out/sg/tools/fetch/acra.js.map +1 -0
- package/out/si/recipes/bare-village.d.ts +32 -0
- package/out/si/recipes/bare-village.d.ts.map +1 -0
- package/out/si/recipes/bare-village.js +89 -0
- package/out/si/recipes/bare-village.js.map +1 -0
- package/out/south-asia/recipes/register.d.ts +51 -0
- package/out/south-asia/recipes/register.d.ts.map +1 -0
- package/out/south-asia/recipes/register.js +154 -0
- package/out/south-asia/recipes/register.js.map +1 -0
- package/out/synthesizers/anchor-absorption.d.ts +1 -1
- package/out/synthesizers/anchor-absorption.d.ts.map +1 -1
- package/out/synthesizers/anchor-absorption.js.map +1 -1
- package/out/synthesizers/boundary-stress.js.map +1 -1
- package/out/synthesizers/house-venue.js.map +1 -1
- package/out/synthesizers/intersection.js.map +1 -1
- package/out/synthesizers/locale.d.ts +116 -0
- package/out/synthesizers/locale.d.ts.map +1 -0
- package/out/synthesizers/locale.js +150 -0
- package/out/synthesizers/locale.js.map +1 -0
- package/out/synthesizers/no-street.d.ts.map +1 -1
- package/out/synthesizers/no-street.js.map +1 -1
- package/out/synthesizers/po-box.js.map +1 -1
- package/out/synthesizers/street.d.ts.map +1 -1
- package/out/synthesizers/street.js +1 -1
- package/out/synthesizers/street.js.map +1 -1
- package/out/synthesizers/utils.js +1 -1
- package/out/synthesizers/utils.js.map +1 -1
- package/out/test-kit/corpus-recipe.d.ts.map +1 -1
- package/out/test-kit/corpus-recipe.js.map +1 -1
- package/out/tools/audit.d.ts.map +1 -1
- package/out/tools/audit.js +3 -2
- package/out/tools/audit.js.map +1 -1
- package/out/tools/corpus-stats.js +3 -3
- package/out/tools/corpus-stats.js.map +1 -1
- package/out/tools/fetch/download/index.d.ts +10 -0
- package/out/tools/fetch/download/index.d.ts.map +1 -0
- package/out/tools/fetch/download/index.js +10 -0
- package/out/tools/fetch/download/index.js.map +1 -0
- package/out/tools/fetch/download/manifest.d.ts +47 -0
- package/out/tools/fetch/download/manifest.d.ts.map +1 -0
- package/out/tools/fetch/download/manifest.js +74 -0
- package/out/tools/fetch/download/manifest.js.map +1 -0
- package/out/tools/fetch/download/network.d.ts +105 -0
- package/out/tools/fetch/download/network.d.ts.map +1 -0
- package/out/tools/fetch/download/network.js +130 -0
- package/out/tools/fetch/download/network.js.map +1 -0
- package/out/tools/fetch/download/retry.d.ts +45 -0
- package/out/tools/fetch/download/retry.d.ts.map +1 -0
- package/out/tools/fetch/download/retry.js +136 -0
- package/out/tools/fetch/download/retry.js.map +1 -0
- package/out/tools/fetch/geonames/dump.d.ts +91 -0
- package/out/tools/fetch/geonames/dump.d.ts.map +1 -0
- package/out/tools/fetch/geonames/dump.js +171 -0
- package/out/tools/fetch/geonames/dump.js.map +1 -0
- package/out/tools/fetch/geonames/postal.d.ts +76 -0
- package/out/tools/fetch/geonames/postal.d.ts.map +1 -0
- package/out/tools/fetch/geonames/postal.js +126 -0
- package/out/tools/fetch/geonames/postal.js.map +1 -0
- package/out/tools/fetch/index.d.ts +47 -20
- package/out/tools/fetch/index.d.ts.map +1 -1
- package/out/tools/fetch/index.js +47 -20
- package/out/tools/fetch/index.js.map +1 -1
- package/out/tools/fetch/openaddresses.d.ts +1 -1
- package/out/tools/fetch/openaddresses.d.ts.map +1 -1
- package/out/tools/fetch/openaddresses.js +1 -1
- package/out/tools/fetch/openaddresses.js.map +1 -1
- package/out/tools/fetch/ourairports.d.ts +1 -1
- package/out/tools/fetch/ourairports.d.ts.map +1 -1
- package/out/tools/fetch/ourairports.js +1 -1
- package/out/tools/fetch/ourairports.js.map +1 -1
- package/out/tools/fetch/ppd.js +1 -3
- package/out/tools/fetch/ppd.js.map +1 -1
- package/out/tools/fetch/wikidata-subvenue.d.ts +1 -1
- package/out/tools/fetch/wikidata-subvenue.d.ts.map +1 -1
- package/out/tools/fetch/wikidata-subvenue.js +1 -1
- package/out/tools/fetch/wikidata-subvenue.js.map +1 -1
- package/out/tools/golden/expand.d.ts +90 -0
- package/out/tools/golden/expand.d.ts.map +1 -0
- package/out/tools/golden/expand.js +406 -0
- package/out/tools/golden/expand.js.map +1 -0
- package/out/tools/golden/promote.d.ts +72 -0
- package/out/tools/golden/promote.d.ts.map +1 -0
- package/out/tools/golden/promote.js +243 -0
- package/out/tools/golden/promote.js.map +1 -0
- package/out/tools/golden/relabel-street/directory.d.ts +83 -0
- package/out/tools/golden/relabel-street/directory.d.ts.map +1 -0
- package/out/tools/golden/relabel-street/directory.js +216 -0
- package/out/tools/golden/relabel-street/directory.js.map +1 -0
- package/out/tools/golden/relabel-street/index.d.ts +9 -0
- package/out/tools/golden/relabel-street/index.d.ts.map +1 -0
- package/out/tools/golden/relabel-street/index.js +9 -0
- package/out/tools/golden/relabel-street/index.js.map +1 -0
- package/out/tools/golden/relabel-street/row.d.ts +121 -0
- package/out/tools/golden/relabel-street/row.d.ts.map +1 -0
- package/out/tools/golden/relabel-street/row.js +232 -0
- package/out/tools/golden/relabel-street/row.js.map +1 -0
- package/out/tools/index.d.ts +10 -10
- package/out/tools/index.d.ts.map +1 -1
- package/out/tools/index.js +10 -10
- package/out/tools/index.js.map +1 -1
- package/out/tools/ingest-csv.d.ts.map +1 -1
- package/out/tools/ingest-csv.js +5 -7
- package/out/tools/ingest-csv.js.map +1 -1
- package/out/tools/lint/slice/index.d.ts +93 -0
- package/out/tools/lint/slice/index.d.ts.map +1 -0
- package/out/tools/lint/slice/index.js +322 -0
- package/out/tools/lint/slice/index.js.map +1 -0
- package/out/tools/lint/slice/vocab.d.ts +90 -0
- package/out/tools/lint/slice/vocab.d.ts.map +1 -0
- package/out/tools/lint/slice/vocab.js +254 -0
- package/out/tools/lint/slice/vocab.js.map +1 -0
- package/out/tools/overlay-manifest.d.ts +56 -6
- package/out/tools/overlay-manifest.d.ts.map +1 -1
- package/out/tools/overlay-manifest.js +56 -15
- package/out/tools/overlay-manifest.js.map +1 -1
- package/out/tools/overture-subvenue.d.ts +1 -1
- package/out/tools/postcode-triples.d.ts +36 -0
- package/out/tools/postcode-triples.d.ts.map +1 -1
- package/out/tools/postcode-triples.js +91 -12
- package/out/tools/postcode-triples.js.map +1 -1
- package/out/tools/slice/kryptonite.d.ts +32 -0
- package/out/tools/slice/kryptonite.d.ts.map +1 -0
- package/out/tools/slice/kryptonite.js +99 -0
- package/out/tools/slice/kryptonite.js.map +1 -0
- package/out/tools/slice/translit.d.ts +51 -0
- package/out/tools/slice/translit.d.ts.map +1 -0
- package/out/tools/slice/translit.js +166 -0
- package/out/tools/slice/translit.js.map +1 -0
- package/out/tools/sub/venue/harvest.d.ts +100 -0
- package/out/tools/sub/venue/harvest.d.ts.map +1 -0
- package/out/tools/sub/venue/harvest.js +168 -0
- package/out/tools/sub/venue/harvest.js.map +1 -0
- package/out/tools/sub/venue/head-nouns.d.ts +50 -0
- package/out/tools/sub/venue/head-nouns.d.ts.map +1 -0
- package/out/tools/sub/venue/head-nouns.js.map +1 -0
- package/out/tools/sub/venue/lexicon.d.ts +156 -0
- package/out/tools/sub/venue/lexicon.d.ts.map +1 -0
- package/out/tools/sub/venue/lexicon.js +283 -0
- package/out/tools/sub/venue/lexicon.js.map +1 -0
- package/out/tools/sub/venue/promotions.d.ts +94 -0
- package/out/tools/sub/venue/promotions.d.ts.map +1 -0
- package/out/tools/sub/venue/promotions.js +266 -0
- package/out/tools/sub/venue/promotions.js.map +1 -0
- package/out/tools/sub/venue/surfaces.d.ts +45 -0
- package/out/tools/sub/venue/surfaces.d.ts.map +1 -0
- package/out/tools/sub/venue/surfaces.js.map +1 -0
- package/out/tools/sub/venue/table.d.ts +229 -0
- package/out/tools/sub/venue/table.d.ts.map +1 -0
- package/out/tools/sub/venue/table.js.map +1 -0
- package/out/tools/sub/venue/wikidata.d.ts +26 -0
- package/out/tools/sub/venue/wikidata.d.ts.map +1 -0
- package/out/tools/sub/venue/wikidata.js +62 -0
- package/out/tools/sub/venue/wikidata.js.map +1 -0
- package/out/tw/tools/fetch/gcis.d.ts +23 -0
- package/out/tw/tools/fetch/gcis.d.ts.map +1 -0
- package/out/tw/tools/fetch/gcis.js +135 -0
- package/out/tw/tools/fetch/gcis.js.map +1 -0
- package/out/types.d.ts +1 -1
- package/out/types.d.ts.map +1 -1
- package/out/us/adapters/fcc-bdc/adapter.d.ts.map +1 -0
- package/out/us/adapters/fcc-bdc/adapter.js +142 -0
- package/out/us/adapters/fcc-bdc/adapter.js.map +1 -0
- package/out/us/adapters/state/hi-schools/adapter.d.ts.map +1 -0
- package/out/us/adapters/state/hi-schools/adapter.js +136 -0
- package/out/us/adapters/state/hi-schools/adapter.js.map +1 -0
- package/out/us/adapters/state/hi-schools/workbook.d.ts.map +1 -0
- package/out/us/adapters/state/hi-schools/workbook.js.map +1 -0
- package/out/us/adapters/state/ia-contractors/adapter.d.ts.map +1 -0
- package/out/us/adapters/state/ia-contractors/adapter.js +104 -0
- package/out/us/adapters/state/ia-contractors/adapter.js.map +1 -0
- package/out/us/adapters/state/ny-notaries/adapter.d.ts.map +1 -0
- package/out/us/adapters/state/ny-notaries/adapter.js +112 -0
- package/out/us/adapters/state/ny-notaries/adapter.js.map +1 -0
- package/out/us/adapters/state/tx-notaries/adapter.d.ts.map +1 -0
- package/out/us/adapters/state/tx-notaries/adapter.js +118 -0
- package/out/us/adapters/state/tx-notaries/adapter.js.map +1 -0
- package/out/us/adapters/tiger/adapter.d.ts +55 -0
- package/out/us/adapters/tiger/adapter.d.ts.map +1 -0
- package/out/us/adapters/tiger/adapter.js +197 -0
- package/out/us/adapters/tiger/adapter.js.map +1 -0
- package/out/us/adapters/tiger/street-decompose.d.ts.map +1 -0
- package/out/us/adapters/tiger/street-decompose.js.map +1 -0
- package/out/us/adapters/usgov/hrsa-fqhc/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/hrsa-fqhc/adapter.js +121 -0
- package/out/us/adapters/usgov/hrsa-fqhc/adapter.js.map +1 -0
- package/out/us/adapters/usgov/imls-pls/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/imls-pls/adapter.js +106 -0
- package/out/us/adapters/usgov/imls-pls/adapter.js.map +1 -0
- package/out/us/adapters/usgov/irs-bmf/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/irs-bmf/adapter.js +116 -0
- package/out/us/adapters/usgov/irs-bmf/adapter.js.map +1 -0
- package/out/us/adapters/usgov/nad/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/nad/adapter.js +239 -0
- package/out/us/adapters/usgov/nad/adapter.js.map +1 -0
- package/out/us/adapters/usgov/nppes/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/nppes/adapter.js +110 -0
- package/out/us/adapters/usgov/nppes/adapter.js.map +1 -0
- package/out/us/adapters/usgov/samhsa-treatment-locator/adapter.d.ts.map +1 -0
- package/out/us/adapters/usgov/samhsa-treatment-locator/adapter.js +143 -0
- package/out/us/adapters/usgov/samhsa-treatment-locator/adapter.js.map +1 -0
- package/out/us/fips-state.d.ts +41 -0
- package/out/us/fips-state.d.ts.map +1 -0
- package/out/us/fips-state.js +100 -0
- package/out/us/fips-state.js.map +1 -0
- package/out/us/tools/fetch/hrsa.d.ts +18 -0
- package/out/us/tools/fetch/hrsa.d.ts.map +1 -0
- package/out/us/tools/fetch/hrsa.js +46 -0
- package/out/us/tools/fetch/hrsa.js.map +1 -0
- package/out/us/tools/fetch/imls-pls.d.ts +25 -0
- package/out/us/tools/fetch/imls-pls.d.ts.map +1 -0
- package/out/us/tools/fetch/imls-pls.js +108 -0
- package/out/us/tools/fetch/imls-pls.js.map +1 -0
- package/out/us/tools/fetch/nad.d.ts +70 -0
- package/out/us/tools/fetch/nad.d.ts.map +1 -0
- package/out/us/tools/fetch/nad.js +234 -0
- package/out/us/tools/fetch/nad.js.map +1 -0
- package/out/us/tools/fetch/nppes.d.ts +26 -0
- package/out/us/tools/fetch/nppes.d.ts.map +1 -0
- package/out/us/tools/fetch/nppes.js +126 -0
- package/out/us/tools/fetch/nppes.js.map +1 -0
- package/out/us/tools/fetch/state/hi-schools.d.ts +26 -0
- package/out/us/tools/fetch/state/hi-schools.d.ts.map +1 -0
- package/out/us/tools/fetch/state/hi-schools.js +112 -0
- package/out/us/tools/fetch/state/hi-schools.js.map +1 -0
- package/out/us/tools/fetch/state/sources.d.ts +26 -0
- package/out/us/tools/fetch/state/sources.d.ts.map +1 -0
- package/out/us/tools/fetch/state/sources.js +111 -0
- package/out/us/tools/fetch/state/sources.js.map +1 -0
- package/out/us/tools/fetch/tiger-full.d.ts +22 -0
- package/out/us/tools/fetch/tiger-full.d.ts.map +1 -0
- package/out/us/tools/fetch/tiger-full.js +217 -0
- package/out/us/tools/fetch/tiger-full.js.map +1 -0
- package/out/utils/align.d.ts +1 -1
- package/out/utils/align.d.ts.map +1 -1
- package/out/utils/align.js.map +1 -1
- package/out/utils/golden.d.ts +7 -3
- package/out/utils/golden.d.ts.map +1 -1
- package/out/utils/golden.js +12 -8
- package/out/utils/golden.js.map +1 -1
- package/out/utils/parquet.d.ts.map +1 -1
- package/out/utils/split.js.map +1 -1
- package/out/utils/wof-json.d.ts.map +1 -1
- package/out/utils/wof-json.js +7 -12
- package/out/utils/wof-json.js.map +1 -1
- package/out/ve/recipes/reviewed-postcode-tail.d.ts.map +1 -0
- package/out/ve/recipes/reviewed-postcode-tail.js.map +1 -0
- package/package.json +196 -46
- package/lib/adapters/ban/adapter.ts +0 -190
- package/lib/adapters/fcc-bdc/adapter.ts +0 -174
- package/lib/adapters/geonames-postal/adapter.ts +0 -122
- package/lib/adapters/gnaf/adapter.ts +0 -149
- package/lib/adapters/gnaf/assemble.ts +0 -225
- package/lib/adapters/state-hi-schools/adapter.ts +0 -170
- package/lib/adapters/state-ia-contractors/adapter.ts +0 -144
- package/lib/adapters/state-ny-notaries/adapter.ts +0 -141
- package/lib/adapters/state-tx-notaries/adapter.ts +0 -157
- package/lib/adapters/tiger/adapter.ts +0 -252
- package/lib/adapters/usgov-hrsa-fqhc/adapter.ts +0 -167
- package/lib/adapters/usgov-imls-pls/adapter.ts +0 -143
- package/lib/adapters/usgov-irs-bmf/adapter.ts +0 -151
- package/lib/adapters/usgov-nad/adapter.ts +0 -334
- package/lib/adapters/usgov-nppes/adapter.ts +0 -151
- package/lib/adapters/usgov-samhsa-treatment-locator/adapter.ts +0 -193
- package/lib/adapters/wof-admin-json/adapter.ts +0 -231
- package/lib/adapters/wof-json-rows.ts +0 -129
- package/lib/adapters/wof-postalcode-json/adapter.ts +0 -176
- package/lib/name-prone-us-suffixes.ts +0 -12
- package/lib/recipes/bare-country.ts +0 -95
- package/lib/recipes/cz-pcfirst-preposition.ts +0 -111
- package/lib/recipes/fr-admin-split.ts +0 -242
- package/lib/recipes/fr-bare-street.ts +0 -170
- package/lib/recipes/fr-fragment.ts +0 -333
- package/lib/recipes/fr-lieudit.ts +0 -301
- package/lib/recipes/fr-order.ts +0 -245
- package/lib/recipes/german.ts +0 -359
- package/lib/recipes/locale.ts +0 -599
- package/lib/recipes/nl-postcode.ts +0 -115
- package/lib/recipes/no-fragment.ts +0 -219
- package/lib/recipes/no-street-led.ts +0 -141
- package/lib/recipes/no-street.ts +0 -90
- package/lib/recipes/po-box-cedex.ts +0 -976
- package/lib/recipes/po-box.ts +0 -123
- package/lib/recipes/si-bare-village.ts +0 -97
- package/lib/recipes/street-affix.ts +0 -804
- package/lib/recipes/street-bare.ts +0 -100
- package/lib/recipes/sub-venue-sources.ts +0 -877
- package/lib/recipes/sub-venue.ts +0 -997
- package/lib/synthesizers/german.ts +0 -260
- package/lib/tools/fetch/ban.ts +0 -289
- package/lib/tools/fetch/download.ts +0 -262
- package/lib/tools/fetch/geonames-dump.ts +0 -257
- package/lib/tools/fetch/geonames-postal.ts +0 -180
- package/lib/tools/fetch/hrsa.ts +0 -59
- package/lib/tools/fetch/imls-pls.ts +0 -149
- package/lib/tools/fetch/nad.ts +0 -341
- package/lib/tools/fetch/nppes.ts +0 -165
- package/lib/tools/fetch/state-hi-schools.ts +0 -161
- package/lib/tools/fetch/state-sources.ts +0 -146
- package/lib/tools/fetch/tiger-full.ts +0 -308
- package/lib/tools/golden-promote.ts +0 -337
- package/lib/tools/golden-relabel-street.ts +0 -683
- package/lib/tools/lint-slice-vocab.ts +0 -388
- package/lib/tools/sub-venue/harvest.ts +0 -234
- package/lib/tools/sub-venue/head-nouns.ts +0 -245
- package/lib/tools/sub-venue/surfaces.ts +0 -95
- package/lib/tools/sub-venue/table.ts +0 -281
- package/lib/tools/sub-venue/wikidata.ts +0 -85
- package/lib/tools/sub-venue-lexicon.ts +0 -429
- package/out/adapters/ban/adapter.d.ts.map +0 -1
- package/out/adapters/ban/adapter.js +0 -149
- package/out/adapters/ban/adapter.js.map +0 -1
- package/out/adapters/ban/street-decompose.d.ts.map +0 -1
- package/out/adapters/ban/street-decompose.js.map +0 -1
- package/out/adapters/fcc-bdc/adapter.d.ts.map +0 -1
- package/out/adapters/fcc-bdc/adapter.js +0 -144
- package/out/adapters/fcc-bdc/adapter.js.map +0 -1
- package/out/adapters/geonames-postal/adapter.d.ts.map +0 -1
- package/out/adapters/geonames-postal/adapter.js +0 -107
- package/out/adapters/geonames-postal/adapter.js.map +0 -1
- package/out/adapters/gnaf/adapter.d.ts.map +0 -1
- package/out/adapters/gnaf/adapter.js +0 -124
- package/out/adapters/gnaf/adapter.js.map +0 -1
- package/out/adapters/gnaf/assemble.d.ts +0 -65
- package/out/adapters/gnaf/assemble.d.ts.map +0 -1
- package/out/adapters/gnaf/assemble.js +0 -154
- package/out/adapters/gnaf/assemble.js.map +0 -1
- package/out/adapters/state-hi-schools/adapter.d.ts.map +0 -1
- package/out/adapters/state-hi-schools/adapter.js +0 -145
- package/out/adapters/state-hi-schools/adapter.js.map +0 -1
- package/out/adapters/state-hi-schools/workbook.d.ts.map +0 -1
- package/out/adapters/state-hi-schools/workbook.js.map +0 -1
- package/out/adapters/state-ia-contractors/adapter.d.ts.map +0 -1
- package/out/adapters/state-ia-contractors/adapter.js +0 -111
- package/out/adapters/state-ia-contractors/adapter.js.map +0 -1
- package/out/adapters/state-ny-notaries/adapter.d.ts.map +0 -1
- package/out/adapters/state-ny-notaries/adapter.js +0 -119
- package/out/adapters/state-ny-notaries/adapter.js.map +0 -1
- package/out/adapters/state-tx-notaries/adapter.d.ts.map +0 -1
- package/out/adapters/state-tx-notaries/adapter.js +0 -125
- package/out/adapters/state-tx-notaries/adapter.js.map +0 -1
- package/out/adapters/tiger/adapter.d.ts +0 -55
- package/out/adapters/tiger/adapter.d.ts.map +0 -1
- package/out/adapters/tiger/adapter.js +0 -201
- package/out/adapters/tiger/adapter.js.map +0 -1
- package/out/adapters/tiger/street-decompose.d.ts.map +0 -1
- package/out/adapters/tiger/street-decompose.js.map +0 -1
- package/out/adapters/usgov-hrsa-fqhc/adapter.d.ts.map +0 -1
- package/out/adapters/usgov-hrsa-fqhc/adapter.js +0 -132
- package/out/adapters/usgov-hrsa-fqhc/adapter.js.map +0 -1
- package/out/adapters/usgov-imls-pls/adapter.d.ts.map +0 -1
- package/out/adapters/usgov-imls-pls/adapter.js +0 -114
- package/out/adapters/usgov-imls-pls/adapter.js.map +0 -1
- package/out/adapters/usgov-irs-bmf/adapter.d.ts.map +0 -1
- package/out/adapters/usgov-irs-bmf/adapter.js +0 -120
- package/out/adapters/usgov-irs-bmf/adapter.js.map +0 -1
- package/out/adapters/usgov-nad/adapter.d.ts.map +0 -1
- package/out/adapters/usgov-nad/adapter.js +0 -249
- package/out/adapters/usgov-nad/adapter.js.map +0 -1
- package/out/adapters/usgov-nppes/adapter.d.ts.map +0 -1
- package/out/adapters/usgov-nppes/adapter.js +0 -118
- package/out/adapters/usgov-nppes/adapter.js.map +0 -1
- package/out/adapters/usgov-samhsa-treatment-locator/adapter.d.ts.map +0 -1
- package/out/adapters/usgov-samhsa-treatment-locator/adapter.js +0 -154
- package/out/adapters/usgov-samhsa-treatment-locator/adapter.js.map +0 -1
- package/out/adapters/wof-admin-jp/adapter.d.ts.map +0 -1
- package/out/adapters/wof-admin-jp/adapter.js.map +0 -1
- package/out/adapters/wof-admin-json/adapter.d.ts +0 -79
- package/out/adapters/wof-admin-json/adapter.d.ts.map +0 -1
- package/out/adapters/wof-admin-json/adapter.js +0 -197
- package/out/adapters/wof-admin-json/adapter.js.map +0 -1
- package/out/adapters/wof-json-rows.d.ts +0 -62
- package/out/adapters/wof-json-rows.d.ts.map +0 -1
- package/out/adapters/wof-json-rows.js +0 -83
- package/out/adapters/wof-json-rows.js.map +0 -1
- package/out/adapters/wof-postalcode-json/adapter.d.ts +0 -65
- package/out/adapters/wof-postalcode-json/adapter.d.ts.map +0 -1
- package/out/adapters/wof-postalcode-json/adapter.js +0 -151
- package/out/adapters/wof-postalcode-json/adapter.js.map +0 -1
- package/out/codex/us-fips-state.d.ts +0 -41
- package/out/codex/us-fips-state.d.ts.map +0 -1
- package/out/codex/us-fips-state.js +0 -100
- package/out/codex/us-fips-state.js.map +0 -1
- package/out/name-prone-us-suffixes.d.ts +0 -12
- package/out/name-prone-us-suffixes.d.ts.map +0 -1
- package/out/name-prone-us-suffixes.js +0 -12
- package/out/name-prone-us-suffixes.js.map +0 -1
- package/out/recipes/bare-country.d.ts +0 -25
- package/out/recipes/bare-country.d.ts.map +0 -1
- package/out/recipes/bare-country.js +0 -87
- package/out/recipes/bare-country.js.map +0 -1
- package/out/recipes/cn-organizational-units.d.ts +0 -36
- package/out/recipes/cn-organizational-units.d.ts.map +0 -1
- package/out/recipes/cn-organizational-units.js +0 -159
- package/out/recipes/cn-organizational-units.js.map +0 -1
- package/out/recipes/cz-pcfirst-preposition.d.ts +0 -22
- package/out/recipes/cz-pcfirst-preposition.d.ts.map +0 -1
- package/out/recipes/cz-pcfirst-preposition.js +0 -100
- package/out/recipes/cz-pcfirst-preposition.js.map +0 -1
- package/out/recipes/fr-admin-split.d.ts +0 -38
- package/out/recipes/fr-admin-split.d.ts.map +0 -1
- package/out/recipes/fr-admin-split.js +0 -192
- package/out/recipes/fr-admin-split.js.map +0 -1
- package/out/recipes/fr-bare-street.d.ts +0 -28
- package/out/recipes/fr-bare-street.d.ts.map +0 -1
- package/out/recipes/fr-bare-street.js +0 -143
- package/out/recipes/fr-bare-street.js.map +0 -1
- package/out/recipes/fr-fragment.d.ts +0 -77
- package/out/recipes/fr-fragment.d.ts.map +0 -1
- package/out/recipes/fr-fragment.js +0 -276
- package/out/recipes/fr-fragment.js.map +0 -1
- package/out/recipes/fr-lieudit.d.ts +0 -32
- package/out/recipes/fr-lieudit.d.ts.map +0 -1
- package/out/recipes/fr-lieudit.js +0 -227
- package/out/recipes/fr-lieudit.js.map +0 -1
- package/out/recipes/fr-order.d.ts +0 -38
- package/out/recipes/fr-order.d.ts.map +0 -1
- package/out/recipes/fr-order.js +0 -197
- package/out/recipes/fr-order.js.map +0 -1
- package/out/recipes/german.d.ts +0 -44
- package/out/recipes/german.d.ts.map +0 -1
- package/out/recipes/german.js +0 -288
- package/out/recipes/german.js.map +0 -1
- package/out/recipes/locale.d.ts +0 -136
- package/out/recipes/locale.d.ts.map +0 -1
- package/out/recipes/locale.js +0 -460
- package/out/recipes/locale.js.map +0 -1
- package/out/recipes/nl-postcode.d.ts +0 -26
- package/out/recipes/nl-postcode.d.ts.map +0 -1
- package/out/recipes/nl-postcode.js +0 -102
- package/out/recipes/nl-postcode.js.map +0 -1
- package/out/recipes/no-fragment.d.ts +0 -43
- package/out/recipes/no-fragment.d.ts.map +0 -1
- package/out/recipes/no-fragment.js +0 -182
- package/out/recipes/no-fragment.js.map +0 -1
- package/out/recipes/no-street-led.d.ts +0 -24
- package/out/recipes/no-street-led.d.ts.map +0 -1
- package/out/recipes/no-street-led.js +0 -113
- package/out/recipes/no-street-led.js.map +0 -1
- package/out/recipes/no-street.d.ts +0 -18
- package/out/recipes/no-street.d.ts.map +0 -1
- package/out/recipes/no-street.js +0 -71
- package/out/recipes/no-street.js.map +0 -1
- package/out/recipes/po-box-cedex.d.ts +0 -38
- package/out/recipes/po-box-cedex.d.ts.map +0 -1
- package/out/recipes/po-box-cedex.js +0 -767
- package/out/recipes/po-box-cedex.js.map +0 -1
- package/out/recipes/po-box.d.ts +0 -17
- package/out/recipes/po-box.d.ts.map +0 -1
- package/out/recipes/po-box.js +0 -100
- package/out/recipes/po-box.js.map +0 -1
- package/out/recipes/reviewed-postcode-tail.d.ts.map +0 -1
- package/out/recipes/reviewed-postcode-tail.js.map +0 -1
- package/out/recipes/si-bare-village.d.ts +0 -32
- package/out/recipes/si-bare-village.d.ts.map +0 -1
- package/out/recipes/si-bare-village.js +0 -88
- package/out/recipes/si-bare-village.js.map +0 -1
- package/out/recipes/street-affix.d.ts +0 -89
- package/out/recipes/street-affix.d.ts.map +0 -1
- package/out/recipes/street-affix.js +0 -563
- package/out/recipes/street-affix.js.map +0 -1
- package/out/recipes/street-bare.d.ts +0 -25
- package/out/recipes/street-bare.d.ts.map +0 -1
- package/out/recipes/street-bare.js +0 -86
- package/out/recipes/street-bare.js.map +0 -1
- package/out/recipes/sub-venue-sources.d.ts +0 -229
- package/out/recipes/sub-venue-sources.d.ts.map +0 -1
- package/out/recipes/sub-venue-sources.js +0 -653
- package/out/recipes/sub-venue-sources.js.map +0 -1
- package/out/recipes/sub-venue.d.ts +0 -269
- package/out/recipes/sub-venue.d.ts.map +0 -1
- package/out/recipes/sub-venue.js +0 -725
- package/out/recipes/sub-venue.js.map +0 -1
- package/out/synthesizers/german.d.ts +0 -115
- package/out/synthesizers/german.d.ts.map +0 -1
- package/out/synthesizers/german.js +0 -149
- package/out/synthesizers/german.js.map +0 -1
- package/out/tools/fetch/ban.d.ts +0 -31
- package/out/tools/fetch/ban.d.ts.map +0 -1
- package/out/tools/fetch/ban.js +0 -239
- package/out/tools/fetch/ban.js.map +0 -1
- package/out/tools/fetch/download.d.ts +0 -117
- package/out/tools/fetch/download.d.ts.map +0 -1
- package/out/tools/fetch/download.js +0 -160
- package/out/tools/fetch/download.js.map +0 -1
- package/out/tools/fetch/geonames-dump.d.ts +0 -91
- package/out/tools/fetch/geonames-dump.d.ts.map +0 -1
- package/out/tools/fetch/geonames-dump.js +0 -171
- package/out/tools/fetch/geonames-dump.js.map +0 -1
- package/out/tools/fetch/geonames-postal.d.ts +0 -76
- package/out/tools/fetch/geonames-postal.d.ts.map +0 -1
- package/out/tools/fetch/geonames-postal.js +0 -126
- package/out/tools/fetch/geonames-postal.js.map +0 -1
- package/out/tools/fetch/hrsa.d.ts +0 -18
- package/out/tools/fetch/hrsa.d.ts.map +0 -1
- package/out/tools/fetch/hrsa.js +0 -46
- package/out/tools/fetch/hrsa.js.map +0 -1
- package/out/tools/fetch/imls-pls.d.ts +0 -25
- package/out/tools/fetch/imls-pls.d.ts.map +0 -1
- package/out/tools/fetch/imls-pls.js +0 -108
- package/out/tools/fetch/imls-pls.js.map +0 -1
- package/out/tools/fetch/nad.d.ts +0 -70
- package/out/tools/fetch/nad.d.ts.map +0 -1
- package/out/tools/fetch/nad.js +0 -234
- package/out/tools/fetch/nad.js.map +0 -1
- package/out/tools/fetch/nppes.d.ts +0 -26
- package/out/tools/fetch/nppes.d.ts.map +0 -1
- package/out/tools/fetch/nppes.js +0 -126
- package/out/tools/fetch/nppes.js.map +0 -1
- package/out/tools/fetch/state-hi-schools.d.ts +0 -26
- package/out/tools/fetch/state-hi-schools.d.ts.map +0 -1
- package/out/tools/fetch/state-hi-schools.js +0 -112
- package/out/tools/fetch/state-hi-schools.js.map +0 -1
- package/out/tools/fetch/state-sources.d.ts +0 -26
- package/out/tools/fetch/state-sources.d.ts.map +0 -1
- package/out/tools/fetch/state-sources.js +0 -111
- package/out/tools/fetch/state-sources.js.map +0 -1
- package/out/tools/fetch/tiger-full.d.ts +0 -22
- package/out/tools/fetch/tiger-full.d.ts.map +0 -1
- package/out/tools/fetch/tiger-full.js +0 -217
- package/out/tools/fetch/tiger-full.js.map +0 -1
- package/out/tools/golden-expand.d.ts +0 -90
- package/out/tools/golden-expand.d.ts.map +0 -1
- package/out/tools/golden-expand.js +0 -406
- package/out/tools/golden-expand.js.map +0 -1
- package/out/tools/golden-promote.d.ts +0 -72
- package/out/tools/golden-promote.d.ts.map +0 -1
- package/out/tools/golden-promote.js +0 -240
- package/out/tools/golden-promote.js.map +0 -1
- package/out/tools/golden-relabel-street.d.ts +0 -196
- package/out/tools/golden-relabel-street.d.ts.map +0 -1
- package/out/tools/golden-relabel-street.js +0 -440
- package/out/tools/golden-relabel-street.js.map +0 -1
- package/out/tools/lint-slice-vocab.d.ts +0 -90
- package/out/tools/lint-slice-vocab.d.ts.map +0 -1
- package/out/tools/lint-slice-vocab.js +0 -267
- package/out/tools/lint-slice-vocab.js.map +0 -1
- package/out/tools/lint-slice.d.ts +0 -93
- package/out/tools/lint-slice.d.ts.map +0 -1
- package/out/tools/lint-slice.js +0 -322
- package/out/tools/lint-slice.js.map +0 -1
- package/out/tools/slice-kryptonite.d.ts +0 -32
- package/out/tools/slice-kryptonite.d.ts.map +0 -1
- package/out/tools/slice-kryptonite.js +0 -99
- package/out/tools/slice-kryptonite.js.map +0 -1
- package/out/tools/slice-translit.d.ts +0 -51
- package/out/tools/slice-translit.d.ts.map +0 -1
- package/out/tools/slice-translit.js +0 -166
- package/out/tools/slice-translit.js.map +0 -1
- package/out/tools/sub-venue/harvest.d.ts +0 -100
- package/out/tools/sub-venue/harvest.d.ts.map +0 -1
- package/out/tools/sub-venue/harvest.js +0 -168
- package/out/tools/sub-venue/harvest.js.map +0 -1
- package/out/tools/sub-venue/head-nouns.d.ts +0 -50
- package/out/tools/sub-venue/head-nouns.d.ts.map +0 -1
- package/out/tools/sub-venue/head-nouns.js.map +0 -1
- package/out/tools/sub-venue/surfaces.d.ts +0 -45
- package/out/tools/sub-venue/surfaces.d.ts.map +0 -1
- package/out/tools/sub-venue/surfaces.js.map +0 -1
- package/out/tools/sub-venue/table.d.ts +0 -229
- package/out/tools/sub-venue/table.d.ts.map +0 -1
- package/out/tools/sub-venue/table.js.map +0 -1
- package/out/tools/sub-venue/wikidata.d.ts +0 -26
- package/out/tools/sub-venue/wikidata.d.ts.map +0 -1
- package/out/tools/sub-venue/wikidata.js +0 -62
- package/out/tools/sub-venue/wikidata.js.map +0 -1
- package/out/tools/sub-venue-lexicon.d.ts +0 -156
- package/out/tools/sub-venue-lexicon.d.ts.map +0 -1
- package/out/tools/sub-venue-lexicon.js +0 -283
- package/out/tools/sub-venue-lexicon.js.map +0 -1
- package/out/tools/sub-venue-promotions.d.ts +0 -94
- package/out/tools/sub-venue-promotions.d.ts.map +0 -1
- package/out/tools/sub-venue-promotions.js +0 -266
- package/out/tools/sub-venue-promotions.js.map +0 -1
- /package/lib/{recipes/cn-organizational-units.ts → cn/recipes/organizational-units.ts} +0 -0
- /package/lib/{adapters → fr/adapters}/ban/street-decompose.ts +0 -0
- /package/lib/{adapters/wof-admin-jp → jp/adapters/wof-admin}/adapter.ts +0 -0
- /package/lib/tools/{golden-expand.ts → golden/expand.ts} +0 -0
- /package/lib/tools/{lint-slice.ts → lint/slice/index.ts} +0 -0
- /package/lib/tools/{slice-kryptonite.ts → slice/kryptonite.ts} +0 -0
- /package/lib/tools/{slice-translit.ts → slice/translit.ts} +0 -0
- /package/lib/tools/{sub-venue-promotions.ts → sub/venue/promotions.ts} +0 -0
- /package/lib/{adapters/state-hi-schools → us/adapters/state/hi-schools}/workbook.ts +0 -0
- /package/lib/{adapters → us/adapters}/tiger/street-decompose.ts +0 -0
- /package/lib/{codex/us-fips-state.ts → us/fips-state.ts} +0 -0
- /package/lib/{recipes → ve/recipes}/reviewed-postcode-tail.ts +0 -0
- /package/out/adapters/{geonames-postal → geonames/postal}/adapter.d.ts +0 -0
- /package/out/{adapters → au/adapters}/gnaf/adapter.d.ts +0 -0
- /package/out/{adapters → fr/adapters}/ban/adapter.d.ts +0 -0
- /package/out/{adapters → fr/adapters}/ban/street-decompose.d.ts +0 -0
- /package/out/{adapters → fr/adapters}/ban/street-decompose.js +0 -0
- /package/out/{adapters/wof-admin-jp → jp/adapters/wof-admin}/adapter.d.ts +0 -0
- /package/out/{adapters/wof-admin-jp → jp/adapters/wof-admin}/adapter.js +0 -0
- /package/out/tools/{sub-venue → sub/venue}/head-nouns.js +0 -0
- /package/out/tools/{sub-venue → sub/venue}/surfaces.js +0 -0
- /package/out/tools/{sub-venue → sub/venue}/table.js +0 -0
- /package/out/{adapters → us/adapters}/fcc-bdc/adapter.d.ts +0 -0
- /package/out/{adapters/state-hi-schools → us/adapters/state/hi-schools}/adapter.d.ts +0 -0
- /package/out/{adapters/state-hi-schools → us/adapters/state/hi-schools}/workbook.d.ts +0 -0
- /package/out/{adapters/state-hi-schools → us/adapters/state/hi-schools}/workbook.js +0 -0
- /package/out/{adapters/state-ia-contractors → us/adapters/state/ia-contractors}/adapter.d.ts +0 -0
- /package/out/{adapters/state-ny-notaries → us/adapters/state/ny-notaries}/adapter.d.ts +0 -0
- /package/out/{adapters/state-tx-notaries → us/adapters/state/tx-notaries}/adapter.d.ts +0 -0
- /package/out/{adapters → us/adapters}/tiger/street-decompose.d.ts +0 -0
- /package/out/{adapters → us/adapters}/tiger/street-decompose.js +0 -0
- /package/out/{adapters/usgov-hrsa-fqhc → us/adapters/usgov/hrsa-fqhc}/adapter.d.ts +0 -0
- /package/out/{adapters/usgov-imls-pls → us/adapters/usgov/imls-pls}/adapter.d.ts +0 -0
- /package/out/{adapters/usgov-irs-bmf → us/adapters/usgov/irs-bmf}/adapter.d.ts +0 -0
- /package/out/{adapters/usgov-nad → us/adapters/usgov/nad}/adapter.d.ts +0 -0
- /package/out/{adapters/usgov-nppes → us/adapters/usgov/nppes}/adapter.d.ts +0 -0
- /package/out/{adapters/usgov-samhsa-treatment-locator → us/adapters/usgov/samhsa-treatment-locator}/adapter.d.ts +0 -0
- /package/out/{recipes → ve/recipes}/reviewed-postcode-tail.d.ts +0 -0
- /package/out/{recipes → ve/recipes}/reviewed-postcode-tail.js +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
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
|
+
import { normalizeSurface } from "#tools/sub/venue/surfaces";
|
|
18
|
+
import { CONCEPT_QIDS } from "#tools/sub/venue/table";
|
|
19
|
+
/**
|
|
20
|
+
* Turn the Wikidata designator-label payload into surfaces.
|
|
21
|
+
*
|
|
22
|
+
* A row is dropped when its language tag is empty (an untagged literal, which Wikidata occasionally carries), when the
|
|
23
|
+
* QID maps to no designator in {@link CONCEPT_QIDS}, or when the normalized phrase is empty. Everything that survives
|
|
24
|
+
* lands `curated: false` — see the module docstring.
|
|
25
|
+
*/
|
|
26
|
+
export function surfacesFromWikidata(payload, conceptQIDs = CONCEPT_QIDS) {
|
|
27
|
+
const byQID = new Map(Object.entries(conceptQIDs).map(([id, qid]) => [qid, id]));
|
|
28
|
+
const envelope = payload;
|
|
29
|
+
const seen = new Set();
|
|
30
|
+
const out = [];
|
|
31
|
+
for (const binding of envelope.results?.bindings ?? []) {
|
|
32
|
+
const qid = binding.item?.value?.split("/").pop();
|
|
33
|
+
const recordID = qid ? byQID.get(qid) : undefined;
|
|
34
|
+
const lang = binding.lang?.value;
|
|
35
|
+
const raw = binding.label?.value;
|
|
36
|
+
if (!recordID || !lang || !raw)
|
|
37
|
+
continue;
|
|
38
|
+
const phrase = normalizeSurface(raw);
|
|
39
|
+
if (!phrase)
|
|
40
|
+
continue;
|
|
41
|
+
const source = binding.kind?.value === "alt" ? "wikidata:alt" : "wikidata:label";
|
|
42
|
+
// A concept can carry the same string as both a label and an alias, and across dialect subtags
|
|
43
|
+
// (`zh`, `zh-cn`, `zh-hans` all say 航站楼). Key the dedupe on the tuple that identifies a row.
|
|
44
|
+
const key = `${phrase}\0${recordID}\0${lang}\0${source}`;
|
|
45
|
+
if (seen.has(key))
|
|
46
|
+
continue;
|
|
47
|
+
seen.add(key);
|
|
48
|
+
out.push({
|
|
49
|
+
phrase,
|
|
50
|
+
recordID,
|
|
51
|
+
recordKind: "designator",
|
|
52
|
+
lang,
|
|
53
|
+
region: "",
|
|
54
|
+
source,
|
|
55
|
+
curated: false,
|
|
56
|
+
observations: 0,
|
|
57
|
+
context: {},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=wikidata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wikidata.js","sourceRoot":"","sources":["../../../../lib/tools/sub/venue/wikidata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAwB,MAAM,wBAAwB,CAAA;AAgB3E;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CACnC,OAAgB,EAChB,WAAW,GAAqC,YAAY;IAE5D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAChF,MAAM,QAAQ,GAAG,OAAyB,CAAA;IAC1C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAA;IAC9B,MAAM,GAAG,GAAsB,EAAE,CAAA;IAEjC,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,CAAC;QACxD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;QACjD,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;QACjD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,KAAK,CAAA;QAChC,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAA;QAEhC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,IAAI,CAAC,GAAG;YAAE,SAAQ;QAExC,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAA;QAEpC,IAAI,CAAC,MAAM;YAAE,SAAQ;QAErB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,gBAAgB,CAAA;QAChF,+FAA+F;QAC/F,6FAA6F;QAC7F,MAAM,GAAG,GAAG,GAAG,MAAM,KAAK,QAAQ,KAAK,IAAI,KAAK,MAAM,EAAE,CAAA;QAExD,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAQ;QAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAEb,GAAG,CAAC,IAAI,CAAC;YACR,MAAM;YACN,QAAQ;YACR,UAAU,EAAE,YAAY;YACxB,IAAI;YACJ,MAAM,EAAE,EAAE;YACV,MAAM;YACN,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,EAAE;SACX,CAAC,CAAA;IACH,CAAC;IAED,OAAO,GAAG,CAAA;AACX,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Fetch Taiwan's company and business registers (公司登記資料, 商業登記資料) from the Ministry of
|
|
7
|
+
* Economic Affairs' commerce open-data platform, data.gcis.nat.gov.tw. The platform publishes the
|
|
8
|
+
* full registers as CSV files split by region (the six special municipalities each on their own,
|
|
9
|
+
* the rest of the island in four bands) and by industry letter, 148 files in all, each row carrying
|
|
10
|
+
* the registered address (公司地址) and, for companies, the tax office's business address
|
|
11
|
+
* (營業地址) as free text. This is the NOISY source for Taiwanese addresses: a person typed these.
|
|
12
|
+
*
|
|
13
|
+
* License: 政府資料開放授權條款-第1版 (Open Government Data License, Taiwan, v1.0). The platform's
|
|
14
|
+
* own dialog states the condition that binds: attribution in the form it prescribes, or the grant is
|
|
15
|
+
* void from the start ("未盡顯名標示義務者,視為自始未取得開放資料之授權"). The manifest records the
|
|
16
|
+
* prescribed wording per file so the corpus build and the model card can carry it.
|
|
17
|
+
*
|
|
18
|
+
* Invoke via `mailwoman corpus fetch gcis-tw --out-root <path>`.
|
|
19
|
+
*/
|
|
20
|
+
import type { BaseFetchOptions, FetchSummary } from "#tools/fetch/download/index";
|
|
21
|
+
export type FetchGCISTWOptions = BaseFetchOptions;
|
|
22
|
+
export declare function fetchGCISTW(options: FetchGCISTWOptions, report?: (line: string) => void): Promise<FetchSummary>;
|
|
23
|
+
//# sourceMappingURL=gcis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcis.d.ts","sourceRoot":"","sources":["../../../../lib/tw/tools/fetch/gcis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,KAAK,EACX,gBAAgB,EAChB,YAAY,EAGZ,MAAM,6BAA6B,CAAA;AAgBpC,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAA;AA+CjD,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,CAoFrH"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Fetch Taiwan's company and business registers (公司登記資料, 商業登記資料) from the Ministry of
|
|
7
|
+
* Economic Affairs' commerce open-data platform, data.gcis.nat.gov.tw. The platform publishes the
|
|
8
|
+
* full registers as CSV files split by region (the six special municipalities each on their own,
|
|
9
|
+
* the rest of the island in four bands) and by industry letter, 148 files in all, each row carrying
|
|
10
|
+
* the registered address (公司地址) and, for companies, the tax office's business address
|
|
11
|
+
* (營業地址) as free text. This is the NOISY source for Taiwanese addresses: a person typed these.
|
|
12
|
+
*
|
|
13
|
+
* License: 政府資料開放授權條款-第1版 (Open Government Data License, Taiwan, v1.0). The platform's
|
|
14
|
+
* own dialog states the condition that binds: attribution in the form it prescribes, or the grant is
|
|
15
|
+
* void from the start ("未盡顯名標示義務者,視為自始未取得開放資料之授權"). The manifest records the
|
|
16
|
+
* prescribed wording per file so the corpus build and the model card can carry it.
|
|
17
|
+
*
|
|
18
|
+
* Invoke via `mailwoman corpus fetch gcis-tw --out-root <path>`.
|
|
19
|
+
*/
|
|
20
|
+
import { BYTES_PER_KIB } from "@mailwoman/core/fs/formatters";
|
|
21
|
+
import { pathExists } from "@mailwoman/core/fs/readers";
|
|
22
|
+
import { makeDirectories } from "@mailwoman/core/fs/writers";
|
|
23
|
+
import { sha256File } from "@mailwoman/core/hash";
|
|
24
|
+
import { sleep } from "@mailwoman/core/utils/sleep";
|
|
25
|
+
import { join } from "path-ts";
|
|
26
|
+
import { loadCollectionFiles, streamBodyToFile, withRetries, writeManifest } from "#tools/fetch/download/index";
|
|
27
|
+
const SLUG = "gcis-tw";
|
|
28
|
+
const PORTAL = "https://data.gcis.nat.gov.tw";
|
|
29
|
+
const CATALOG_URL = `${PORTAL}/od/datacategory`;
|
|
30
|
+
const LICENSE = "政府資料開放授權條款-第1版 (Open Government Data License, Taiwan, v1.0) — http://data.gov.tw/license";
|
|
31
|
+
const ATTRIBUTION = "提供機關/經濟部商業發展署 [<dataset title>] — the 顯名聲明 each file's dialog prescribes";
|
|
32
|
+
const PACE_MS = 300;
|
|
33
|
+
/**
|
|
34
|
+
* The bulk register files: `<region><register>資料-<industry letter><industry>`. The per-industry API datasets and the
|
|
35
|
+
* monthly new-registration lists share the catalog and are not these.
|
|
36
|
+
*/
|
|
37
|
+
const BULK_TITLE = /(公司登記資料|商業登記資料)-[A-Z]/;
|
|
38
|
+
/**
|
|
39
|
+
* A file name a shell and a manifest can carry: the title with its punctuation folded to underscores.
|
|
40
|
+
*/
|
|
41
|
+
function filenameFor(title) {
|
|
42
|
+
return `${title
|
|
43
|
+
.replaceAll(/[()()、,/\\\s]+/g, "_")
|
|
44
|
+
.replaceAll(/_+/g, "_")
|
|
45
|
+
.replaceAll(/^_|_$/g, "")}.csv`;
|
|
46
|
+
}
|
|
47
|
+
async function listBulkDatasets() {
|
|
48
|
+
const res = await fetch(CATALOG_URL, { headers: { accept: "text/html" } });
|
|
49
|
+
if (!res.ok)
|
|
50
|
+
throw new Error(`gcis-tw: the catalog answered HTTP ${res.status}`);
|
|
51
|
+
const html = await res.text();
|
|
52
|
+
const datasets = [];
|
|
53
|
+
for (const [, path, rawTitle] of html.matchAll(/<a[^>]*href="(\/od\/detail[^"]*)"[^>]*>([^<]+)<\/a>/g)) {
|
|
54
|
+
const title = rawTitle?.trim();
|
|
55
|
+
if (!path || !title || !BULK_TITLE.test(title))
|
|
56
|
+
continue;
|
|
57
|
+
datasets.push({ title, detailPath: path.replace(/;jsessionid=[^?]*/, "") });
|
|
58
|
+
}
|
|
59
|
+
return datasets;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The `/od/file?oid=…` link a dataset's detail page hands its download dialog.
|
|
63
|
+
*/
|
|
64
|
+
async function fileURLFor(dataset) {
|
|
65
|
+
const res = await fetch(`${PORTAL}${dataset.detailPath}`, { headers: { accept: "text/html" } });
|
|
66
|
+
if (!res.ok)
|
|
67
|
+
return undefined;
|
|
68
|
+
const html = await res.text();
|
|
69
|
+
const path = /showDialog\('(\/od\/file\?oid=[^']+)'\)/.exec(html)?.[1];
|
|
70
|
+
return path ? `${PORTAL}${path}` : undefined;
|
|
71
|
+
}
|
|
72
|
+
export async function fetchGCISTW(options, report) {
|
|
73
|
+
const destDir = join(options.outRoot, SLUG);
|
|
74
|
+
await makeDirectories(destDir);
|
|
75
|
+
const manifestPath = join(destDir, "MANIFEST.json");
|
|
76
|
+
const datasets = await listBulkDatasets();
|
|
77
|
+
report?.(`=== ${SLUG}: ${datasets.length} bulk register files in the catalog`);
|
|
78
|
+
const previous = await loadCollectionFiles(manifestPath);
|
|
79
|
+
const files = new Map();
|
|
80
|
+
let fetched = 0;
|
|
81
|
+
let skipped = 0;
|
|
82
|
+
const failedCodes = [];
|
|
83
|
+
for (const dataset of datasets) {
|
|
84
|
+
const filename = filenameFor(dataset.title);
|
|
85
|
+
const dest = join(destDir, filename);
|
|
86
|
+
const before = previous.get(filename);
|
|
87
|
+
if (before && (await pathExists(dest))) {
|
|
88
|
+
files.set(filename, before);
|
|
89
|
+
skipped++;
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
await sleep(PACE_MS);
|
|
93
|
+
const url = await fileURLFor(dataset);
|
|
94
|
+
if (!url) {
|
|
95
|
+
report?.(` ✗ no file link on the detail page for ${dataset.title}`);
|
|
96
|
+
failedCodes.push(dataset.title);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
report?.(`--- ${dataset.title}`);
|
|
100
|
+
let bytes;
|
|
101
|
+
try {
|
|
102
|
+
bytes = await withRetries(async () => {
|
|
103
|
+
const res = await fetch(url, { headers: { accept: "*/*" }, signal: AbortSignal.timeout(1_800_000) });
|
|
104
|
+
if (!res.ok)
|
|
105
|
+
throw new Error(`HTTP ${res.status} for ${dataset.title}`);
|
|
106
|
+
return streamBodyToFile(res, dest);
|
|
107
|
+
}, { report, label: dataset.title });
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
report?.(` ✗ ${error.message}`);
|
|
111
|
+
failedCodes.push(dataset.title);
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
if (bytes < BYTES_PER_KIB) {
|
|
115
|
+
report?.(` ✗ ${bytes} bytes — an error page, not the register`);
|
|
116
|
+
failedCodes.push(dataset.title);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const sha = await sha256File(dest);
|
|
120
|
+
files.set(filename, { source_url: url, downloaded_at: new Date().toISOString(), filename, sha256: sha, bytes });
|
|
121
|
+
fetched++;
|
|
122
|
+
report?.(` ✓ ${(bytes / 1024 / 1024).toFixed(1)} MB sha256=${sha}`);
|
|
123
|
+
const manifest = {
|
|
124
|
+
source: SLUG,
|
|
125
|
+
source_url: CATALOG_URL,
|
|
126
|
+
license: LICENSE,
|
|
127
|
+
attribution: ATTRIBUTION,
|
|
128
|
+
downloaded_at: new Date().toISOString(),
|
|
129
|
+
files: [...files.values()],
|
|
130
|
+
};
|
|
131
|
+
await writeManifest(manifestPath, manifest);
|
|
132
|
+
}
|
|
133
|
+
return { fetched, skipped, failed: failedCodes.length, failedCodes };
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=gcis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcis.js","sourceRoot":"","sources":["../../../../lib/tw/tools/fetch/gcis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACnD,OAAO,EAAE,IAA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,KAAK,CAAC,MAAM,EAAE,CAAC;SAC1B,CAAA;QAED,MAAM,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAA;IAC5C,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE,CAAA;AACrE,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* `CorpusAdapter` is the contract every data source implements; `AdapterOptions` is the
|
|
16
16
|
* per-invocation knob set (input path, optional country filter, row cap, abort signal).
|
|
17
17
|
*/
|
|
18
|
-
import type { BIOLabel, ComponentTag } from "@mailwoman/
|
|
18
|
+
import type { BIOLabel, ComponentTag } from "@mailwoman/codex/component";
|
|
19
19
|
/**
|
|
20
20
|
* Provenance + augmentation metadata that travels with every corpus row.
|
|
21
21
|
*
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAExE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAA;IAEtB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;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AE,MAAM,CAAA;IAEnB;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAE/B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAE5B;;;;;;;;;;;;;;;OAeG;IACH,IAAI,CAAC,IAAI,EAAE,cAAc,GAAG,aAAa,CAAC,YAAY,CAAC,CAAA;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../lib/us/adapters/fcc-bdc/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAOH,OAAO,KAAK,EAAgC,aAAa,EAAE,MAAM,QAAQ,CAAA;AAGzE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,YAAY,CAAA;AAC3C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,kBAAkB,CAAA;AActD;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAWxE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAwEnD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,eAAwB,CAAA"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `fcc-bdc`: FCC Broadband Data Collection (BDC) — Fabric-derived location consumer.
|
|
7
|
+
*
|
|
8
|
+
* The first member of Phase 1.6's "adversarial sources" class. BDC ships the public-domain US
|
|
9
|
+
* broadband-serviceable-location (BSL) fabric: ~120M addresses keyed by stable `location_id`,
|
|
10
|
+
* carrying `address_primary` + `city` + `state` + `zip` + `zip_suffix`. Compared to the clean
|
|
11
|
+
* gazetteer rows from WOF / TIGER / BAN, BDC carries the chaos of address data that has passed
|
|
12
|
+
* through several layers of human entry + automated geocoding + revision: abbreviation drift,
|
|
13
|
+
* inconsistent unit designators, "RR" / "HC" / "PSC" rural-route shapes, embedded apartment /
|
|
14
|
+
* suite numbers that did not survive the address parser cleanly. This is the highest-signal,
|
|
15
|
+
* hardest-to-normalize address corpus in the federal public-domain catalog.
|
|
16
|
+
*
|
|
17
|
+
* Following the `tiger` / `wof-admin` pattern, this adapter consumes a SQLite database the operator
|
|
18
|
+
* pre-builds via the isp-nexus BDC ETL (`/srv/isp-nexus/sync/fcc/bdc/`) or any equivalent
|
|
19
|
+
* host-side pipeline. The mailwoman side does not download or parse the raw CSV/ZIP distribution
|
|
20
|
+
* directly — that keeps the adapter narrow and the BDC ingest pluggable.
|
|
21
|
+
*
|
|
22
|
+
* The SQLite schema is documented in README.md and modeled after `NTIARecord`
|
|
23
|
+
* (`isp-nexus/fcc/bdc/data-collection.ts`): one row per `location_id`. The adapter splits
|
|
24
|
+
* `address_primary` into `house_number` (leading numeric prefix, if any) + `street` (everything
|
|
25
|
+
* after), and combines `zip` + `zip_suffix` into the canonical USPS `postcode` slot.
|
|
26
|
+
*
|
|
27
|
+
* One CanonicalRow per fabric record. Unlike `tiger` (multiple postcode variants per segment) or
|
|
28
|
+
* `wof-admin` (multiple hierarchy variants per place), BDC records already represent fully
|
|
29
|
+
* specified addresses; no fan-out is warranted. Adversarial composition (Phase 1.6 §2.1) is the
|
|
30
|
+
* mechanism for deriving multiple training rows per BDC record.
|
|
31
|
+
*
|
|
32
|
+
* License: stamped `"Public Domain"` per the BDC fabric's US federal-government distribution terms.
|
|
33
|
+
* The CostQuest Fabric source data has its own license; consumers who substitute that path should
|
|
34
|
+
* re-stamp accordingly.
|
|
35
|
+
*/
|
|
36
|
+
import { formatAddressRow } from "@mailwoman/codex/address-format";
|
|
37
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
38
|
+
import { splitStreetLine } from "#adapters/utils";
|
|
39
|
+
import { lookupStateAbbreviation } from "#us/fips-state";
|
|
40
|
+
/**
|
|
41
|
+
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
42
|
+
* it came from.
|
|
43
|
+
*/
|
|
44
|
+
export const FCC_BDC_ADAPTER_ID = "fcc-bdc";
|
|
45
|
+
/**
|
|
46
|
+
* License carried by this source (Public Domain), attached to each row so downstream consumers inherit the terms rather
|
|
47
|
+
* than having to look them up.
|
|
48
|
+
*/
|
|
49
|
+
export const FCC_BDC_DEFAULT_LICENSE = "Public Domain";
|
|
50
|
+
/**
|
|
51
|
+
* Combine `zip` + optional `zip_suffix` into the canonical USPS postcode surface form.
|
|
52
|
+
*
|
|
53
|
+
* NTIARecord doc is ambiguous about whether `zip_suffix` is the 4-digit extension alone or the full ZIP+4 string. This
|
|
54
|
+
* handles both:
|
|
55
|
+
*
|
|
56
|
+
* - Bare 4-digit extension (`zip="94103"`, `zip_suffix="1234"`) → `"94103-1234"`
|
|
57
|
+
* - Already-joined form (`zip_suffix="94103-1234"`) → returned as-is
|
|
58
|
+
* - No suffix → bare `zip`
|
|
59
|
+
*
|
|
60
|
+
* Empty / whitespace-only suffix is treated as missing.
|
|
61
|
+
*/
|
|
62
|
+
export function buildPostcode(zip, suffix) {
|
|
63
|
+
const z = zip.trim();
|
|
64
|
+
if (!z)
|
|
65
|
+
return "";
|
|
66
|
+
const s = suffix?.trim() ?? "";
|
|
67
|
+
if (!s)
|
|
68
|
+
return z;
|
|
69
|
+
if (s.includes("-"))
|
|
70
|
+
return s;
|
|
71
|
+
return `${z}-${s}`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Build a BDC adapter. Pure factory so multiple instances can be created in tests.
|
|
75
|
+
*/
|
|
76
|
+
export function createFccBdcAdapter() {
|
|
77
|
+
return {
|
|
78
|
+
id: FCC_BDC_ADAPTER_ID,
|
|
79
|
+
defaultLicense: FCC_BDC_DEFAULT_LICENSE,
|
|
80
|
+
description: "FCC Broadband Data Collection — Fabric-derived BSL addresses (public-domain); SQLite DB the operator builds via the isp-nexus BDC ETL.",
|
|
81
|
+
async *rows(opts) {
|
|
82
|
+
if (opts.country && opts.country !== "US") {
|
|
83
|
+
throw new Error(`fcc-bdc adapter: only US supported, got country=${opts.country}`);
|
|
84
|
+
}
|
|
85
|
+
const db = new DatabaseClient(opts.inputPath, { readOnly: true });
|
|
86
|
+
let emitted = 0;
|
|
87
|
+
try {
|
|
88
|
+
const stmt = db.prepare(`SELECT location_id, address_primary, city, state, zip, zip_suffix
|
|
89
|
+
FROM bdc_locations
|
|
90
|
+
ORDER BY location_id`);
|
|
91
|
+
for (const row of stmt.iterate()) {
|
|
92
|
+
if (opts.signal?.aborted)
|
|
93
|
+
return;
|
|
94
|
+
if (opts.limit !== undefined && emitted >= opts.limit)
|
|
95
|
+
return;
|
|
96
|
+
const split = splitStreetLine(row.address_primary ?? "");
|
|
97
|
+
if (!split)
|
|
98
|
+
continue;
|
|
99
|
+
const state = lookupStateAbbreviation(row.state);
|
|
100
|
+
if (!state)
|
|
101
|
+
continue;
|
|
102
|
+
const locality = row.city?.trim();
|
|
103
|
+
if (!locality)
|
|
104
|
+
continue;
|
|
105
|
+
const postcode = buildPostcode(row.zip ?? "", row.zip_suffix ?? null);
|
|
106
|
+
if (!postcode)
|
|
107
|
+
continue;
|
|
108
|
+
const components = {
|
|
109
|
+
...(split.house_number ? { house_number: split.house_number } : {}),
|
|
110
|
+
street: split.street,
|
|
111
|
+
locality,
|
|
112
|
+
region: state.abbreviation,
|
|
113
|
+
postcode,
|
|
114
|
+
};
|
|
115
|
+
const rendered = formatAddressRow(components, "US", { singleLine: true });
|
|
116
|
+
if (!rendered)
|
|
117
|
+
continue;
|
|
118
|
+
const { raw, components: aligned } = rendered;
|
|
119
|
+
yield {
|
|
120
|
+
raw,
|
|
121
|
+
components: aligned,
|
|
122
|
+
country: "US",
|
|
123
|
+
locale: "en-US",
|
|
124
|
+
source: FCC_BDC_ADAPTER_ID,
|
|
125
|
+
source_id: `${FCC_BDC_ADAPTER_ID}-${row.location_id}`,
|
|
126
|
+
corpus_version: "",
|
|
127
|
+
license: FCC_BDC_DEFAULT_LICENSE,
|
|
128
|
+
};
|
|
129
|
+
emitted++;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
await db.destroy();
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The configured adapter instance registered with the corpus builder.
|
|
140
|
+
*/
|
|
141
|
+
export const fccBdcAdapter = createFccBdcAdapter();
|
|
142
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../lib/us/adapters/fcc-bdc/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAExD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAA;AAC3C;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAA;AActD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW,EAAE,MAAqB;IAC/D,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAA;IAEpB,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAA;IACjB,MAAM,CAAC,GAAG,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAE9B,IAAI,CAAC,CAAC;QAAE,OAAO,CAAC,CAAA;IAEhB,IAAI,CA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/us/adapters/state/hi-schools/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH,OAAO,KAAK,EAAgC,aAAa,EAAE,MAAM,QAAQ,CAAA;AAIzE;;;GAGG;AACH,eAAO,MAAM,2BAA2B,qBAAqB,CAAA;AAC7D;;;GAGG;AACH,eAAO,MAAM,gCAAgC,kBAAkB,CAAA;AAkC/D,wBAAgB,2BAA2B,IAAI,aAAa,CAyE3D;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAAgC,CAAA"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* `state-hi-schools`: Hawaii DOE public + charter school workbook consumer.
|
|
7
|
+
*
|
|
8
|
+
* The Hawaii State Department of Education publishes a directory of all HIDOE schools and public
|
|
9
|
+
* charter schools (PCS) as an XLSX workbook (`SchoolList.xlsx`) with two sheets: `HIDOE` (~258
|
|
10
|
+
* rows) and `PCS` (~38 rows). Total ~296 rows statewide. Each row carries a school name,
|
|
11
|
+
* single-line street address, city, ZIP, a numeric `code`, and HI-specific administrative columns
|
|
12
|
+
* (complex, complex_area, district, island, charter).
|
|
13
|
+
*
|
|
14
|
+
* The adapter consumes the original XLSX retained by the fetcher and reads both worksheets directly.
|
|
15
|
+
* Legacy flat CSV artifacts remain accepted so existing source caches do not need conversion.
|
|
16
|
+
*
|
|
17
|
+
* Address parsing notes: Hawaii's residential numbering is hyphenated on Oahu (`47-470 Hui Aeko
|
|
18
|
+
* Place`), Kauai (`2-4035 Kaumualii Hwy`), and elsewhere. The shared HOUSE_NUMBER_PREFIX regex
|
|
19
|
+
* covers this via its optional `(?:-\d+)?` group.
|
|
20
|
+
*
|
|
21
|
+
* The `island` and `district` columns are HIDOE administrative labels (Honolulu, Central, Leeward,
|
|
22
|
+
* Windward, Hilo, Hawaii, Maui, Kauai) — they are NOT US counties and intentionally are not
|
|
23
|
+
* surfaced as `subregion`.
|
|
24
|
+
*
|
|
25
|
+
* Output: one row per school with `venue` (school name), `(house_number?, street, locality,
|
|
26
|
+
* region=HI, postcode)`, and a stable `source_id` derived from the school `code`.
|
|
27
|
+
*
|
|
28
|
+
* License: stamped `"Public Domain"` per Hawaii state government open-data terms.
|
|
29
|
+
*/
|
|
30
|
+
import { formatAddressRow } from "@mailwoman/codex/address-format";
|
|
31
|
+
import { CSVSpliterator, XLSXSpliterator } from "spliterator";
|
|
32
|
+
import { splitStreetLine, stableSourceID } from "#adapters/utils";
|
|
33
|
+
import { schoolCellText, STATE_HI_SCHOOL_SHEETS } from "#us/adapters/state/hi-schools/workbook";
|
|
34
|
+
import { lookupStateAbbreviation } from "#us/fips-state";
|
|
35
|
+
/**
|
|
36
|
+
* Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
|
|
37
|
+
* it came from.
|
|
38
|
+
*/
|
|
39
|
+
export const STATE_HI_SCHOOLS_ADAPTER_ID = "state-hi-schools";
|
|
40
|
+
/**
|
|
41
|
+
* License carried by this source (Public Domain), attached to each row so downstream consumers inherit the terms rather
|
|
42
|
+
* than having to look them up.
|
|
43
|
+
*/
|
|
44
|
+
export const STATE_HI_SCHOOLS_DEFAULT_LICENSE = "Public Domain";
|
|
45
|
+
const HI_STATE_ABBR = "HI";
|
|
46
|
+
function normalizeZip(raw) {
|
|
47
|
+
const trimmed = schoolCellText(raw);
|
|
48
|
+
if (!trimmed)
|
|
49
|
+
return "";
|
|
50
|
+
// XLSX → CSV conversion may emit numeric ZIPs without leading zeros. HI ZIPs all begin
|
|
51
|
+
// with 96, so a 4-digit value indicates a leading-zero stripped during numeric coercion
|
|
52
|
+
// (defensive — has not been observed in the published file as of 2026-05).
|
|
53
|
+
if (/^\d{4}$/.test(trimmed))
|
|
54
|
+
return `0${trimmed}`;
|
|
55
|
+
return trimmed;
|
|
56
|
+
}
|
|
57
|
+
async function* readSchoolRows(inputPath) {
|
|
58
|
+
if (inputPath.toLowerCase().endsWith(".xlsx")) {
|
|
59
|
+
for (const sheet of STATE_HI_SCHOOL_SHEETS) {
|
|
60
|
+
yield* XLSXSpliterator.fromAsync(inputPath, {
|
|
61
|
+
sheet,
|
|
62
|
+
normalizeKeys: false,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
yield* CSVSpliterator.fromAsync(inputPath, {
|
|
68
|
+
normalizeKeys: false,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export function createStateHiSchoolsAdapter() {
|
|
72
|
+
return {
|
|
73
|
+
id: STATE_HI_SCHOOLS_ADAPTER_ID,
|
|
74
|
+
defaultLicense: STATE_HI_SCHOOLS_DEFAULT_LICENSE,
|
|
75
|
+
description: "Hawaii DOE School Directory — ~300 K-12 public + charter schools with venue+address (public-domain).",
|
|
76
|
+
async *rows(opts) {
|
|
77
|
+
if (opts.country && opts.country !== "US") {
|
|
78
|
+
throw new Error(`state-hi-schools adapter: only US supported, got country=${opts.country}`);
|
|
79
|
+
}
|
|
80
|
+
const state = lookupStateAbbreviation(HI_STATE_ABBR);
|
|
81
|
+
if (!state) {
|
|
82
|
+
throw new Error(`state-hi-schools adapter: HI not found in state codex (corpus bug)`);
|
|
83
|
+
}
|
|
84
|
+
let emitted = 0;
|
|
85
|
+
for await (const record of readSchoolRows(opts.inputPath)) {
|
|
86
|
+
if (opts.signal?.aborted)
|
|
87
|
+
break;
|
|
88
|
+
if (opts.limit !== undefined && emitted >= opts.limit)
|
|
89
|
+
break;
|
|
90
|
+
const name = schoolCellText(record.name);
|
|
91
|
+
const address = schoolCellText(record.address);
|
|
92
|
+
const city = schoolCellText(record.city);
|
|
93
|
+
const zip = normalizeZip(record.zip);
|
|
94
|
+
if (!name || !address || !city || !zip)
|
|
95
|
+
continue;
|
|
96
|
+
const split = splitStreetLine(address);
|
|
97
|
+
if (!split)
|
|
98
|
+
continue;
|
|
99
|
+
const components = {
|
|
100
|
+
venue: name,
|
|
101
|
+
...(split.house_number ? { house_number: split.house_number } : {}),
|
|
102
|
+
street: split.street,
|
|
103
|
+
locality: city,
|
|
104
|
+
region: state.abbreviation,
|
|
105
|
+
postcode: zip,
|
|
106
|
+
};
|
|
107
|
+
const rendered = formatAddressRow(components, "US", { singleLine: true });
|
|
108
|
+
if (!rendered)
|
|
109
|
+
continue;
|
|
110
|
+
const { raw, components: aligned } = rendered;
|
|
111
|
+
if (Object.keys(aligned).length <= 2)
|
|
112
|
+
continue;
|
|
113
|
+
const code = schoolCellText(record.code);
|
|
114
|
+
const sourceID = code
|
|
115
|
+
? `${STATE_HI_SCHOOLS_ADAPTER_ID}-${code}`
|
|
116
|
+
: stableSourceID(STATE_HI_SCHOOLS_ADAPTER_ID, aligned);
|
|
117
|
+
yield {
|
|
118
|
+
raw,
|
|
119
|
+
components: aligned,
|
|
120
|
+
country: "US",
|
|
121
|
+
locale: "en-US",
|
|
122
|
+
source: STATE_HI_SCHOOLS_ADAPTER_ID,
|
|
123
|
+
source_id: sourceID,
|
|
124
|
+
corpus_version: "",
|
|
125
|
+
license: STATE_HI_SCHOOLS_DEFAULT_LICENSE,
|
|
126
|
+
};
|
|
127
|
+
emitted++;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The configured adapter instance registered with the corpus builder.
|
|
134
|
+
*/
|
|
135
|
+
export const stateHiSchoolsAdapter = createStateHiSchoolsAdapter();
|
|
136
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../../lib/us/adapters/state/hi-schools/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;A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workbook.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,sBAAsB,YAAI,OAAO,EAAE,KAAK,CAAU,CAAA;AAE/D;;GAEG;AACH,eAAO,MAAM,gCAAgC,YAAI,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAU,CAAA;AAEnG;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,aAAa,GAAG,SAAS,CAAA;IAC/B,IAAI,EAAE,aAAa,GAAG,SAAS,CAAA;IAC/B,OAAO,EAAE,aAAa,GAAG,SAAS,CAAA;IAClC,IAAI,EAAE,aAAa,GAAG,SAAS,CAAA;IAC/B,GAAG,EAAE,aAAa,GAAG,SAAS,CAAA;CAC9B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,CAEvE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workbook.js","sourceRoot":"","sources":["../../../../../lib/us/adapters/state/hi-schools/workbook.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,KAAK,CAAU,CAAA;AAE/D;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAU,CAAA;AAanG;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAgC;IAC9D,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAA;AACzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../lib/us/adapters/state/ia-contractors/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,KAAK,EAAgC,aAAa,EAAE,MAAM,QAAQ,CAAA;AAGzE;;;GAGG;AACH,eAAO,MAAM,+BAA+B,yBAAyB,CAAA;AACrE;;;GAGG;AACH,eAAO,MAAM,oCAAoC,kBAAkB,CAAA;AAcnE,wBAAgB,+BAA+B,IAAI,aAAa,CAiF/D;AAED;;GAEG;AACH,eAAO,MAAM,yBAAyB,eAAoC,CAAA"}
|