@mailwoman/corpus 8.0.0 → 8.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/out/src/adapter.d.ts +15 -5
- package/out/src/adapter.d.ts.map +1 -1
- package/out/src/adapter.js +11 -9
- package/out/src/adapter.js.map +1 -1
- package/out/src/adapters/ban/adapter.d.ts +7 -0
- package/out/src/adapters/ban/adapter.d.ts.map +1 -1
- package/out/src/adapters/ban/adapter.js +9 -2
- package/out/src/adapters/ban/adapter.js.map +1 -1
- package/out/src/adapters/ban/street-decompose.d.ts.map +1 -1
- package/out/src/adapters/ban/street-decompose.js +5 -1
- package/out/src/adapters/ban/street-decompose.js.map +1 -1
- package/out/src/adapters/fcc-bdc/adapter.d.ts +14 -1
- package/out/src/adapters/fcc-bdc/adapter.d.ts.map +1 -1
- package/out/src/adapters/fcc-bdc/adapter.js +15 -2
- package/out/src/adapters/fcc-bdc/adapter.js.map +1 -1
- package/out/src/adapters/geonames/adapter.d.ts +11 -0
- package/out/src/adapters/geonames/adapter.d.ts.map +1 -1
- package/out/src/adapters/geonames/adapter.js +24 -5
- package/out/src/adapters/geonames/adapter.js.map +1 -1
- package/out/src/adapters/geonames-postal/adapter.d.ts +11 -0
- package/out/src/adapters/geonames-postal/adapter.d.ts.map +1 -1
- package/out/src/adapters/geonames-postal/adapter.js +14 -1
- package/out/src/adapters/geonames-postal/adapter.js.map +1 -1
- package/out/src/adapters/gnaf/adapter.d.ts +10 -1
- package/out/src/adapters/gnaf/adapter.d.ts.map +1 -1
- package/out/src/adapters/gnaf/adapter.js +11 -2
- package/out/src/adapters/gnaf/adapter.js.map +1 -1
- package/out/src/adapters/gnaf/assemble.d.ts +18 -6
- package/out/src/adapters/gnaf/assemble.d.ts.map +1 -1
- package/out/src/adapters/gnaf/assemble.js +16 -6
- package/out/src/adapters/gnaf/assemble.js.map +1 -1
- package/out/src/adapters/index.d.ts.map +1 -1
- package/out/src/adapters/index.js.map +1 -1
- package/out/src/adapters/openaddresses/adapter.d.ts +11 -0
- package/out/src/adapters/openaddresses/adapter.d.ts.map +1 -1
- package/out/src/adapters/openaddresses/adapter.js +18 -3
- package/out/src/adapters/openaddresses/adapter.js.map +1 -1
- package/out/src/adapters/overture/adapter.d.ts +11 -0
- package/out/src/adapters/overture/adapter.d.ts.map +1 -1
- package/out/src/adapters/overture/adapter.js +12 -1
- package/out/src/adapters/overture/adapter.js.map +1 -1
- package/out/src/adapters/state-hi-schools/adapter.d.ts +11 -0
- package/out/src/adapters/state-hi-schools/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-hi-schools/adapter.js +11 -0
- package/out/src/adapters/state-hi-schools/adapter.js.map +1 -1
- package/out/src/adapters/state-ia-contractors/adapter.d.ts +11 -0
- package/out/src/adapters/state-ia-contractors/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-ia-contractors/adapter.js +11 -0
- package/out/src/adapters/state-ia-contractors/adapter.js.map +1 -1
- package/out/src/adapters/state-ny-notaries/adapter.d.ts +11 -0
- package/out/src/adapters/state-ny-notaries/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-ny-notaries/adapter.js +11 -0
- package/out/src/adapters/state-ny-notaries/adapter.js.map +1 -1
- package/out/src/adapters/state-tx-notaries/adapter.d.ts +11 -0
- package/out/src/adapters/state-tx-notaries/adapter.d.ts.map +1 -1
- package/out/src/adapters/state-tx-notaries/adapter.js +15 -2
- package/out/src/adapters/state-tx-notaries/adapter.js.map +1 -1
- package/out/src/adapters/synth-po-box/adapter.d.ts +11 -0
- package/out/src/adapters/synth-po-box/adapter.d.ts.map +1 -1
- package/out/src/adapters/synth-po-box/adapter.js +13 -2
- package/out/src/adapters/synth-po-box/adapter.js.map +1 -1
- package/out/src/adapters/tiger/adapter.d.ts +14 -1
- package/out/src/adapters/tiger/adapter.d.ts.map +1 -1
- package/out/src/adapters/tiger/adapter.js +19 -4
- package/out/src/adapters/tiger/adapter.js.map +1 -1
- package/out/src/adapters/tiger/street-decompose.d.ts.map +1 -1
- package/out/src/adapters/tiger/street-decompose.js.map +1 -1
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts +11 -0
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.js +12 -1
- package/out/src/adapters/usgov-hrsa-fqhc/adapter.js.map +1 -1
- package/out/src/adapters/usgov-imls-pls/adapter.d.ts +11 -0
- package/out/src/adapters/usgov-imls-pls/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-imls-pls/adapter.js +11 -0
- package/out/src/adapters/usgov-imls-pls/adapter.js.map +1 -1
- package/out/src/adapters/usgov-irs-bmf/adapter.d.ts +11 -0
- package/out/src/adapters/usgov-irs-bmf/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-irs-bmf/adapter.js +17 -2
- package/out/src/adapters/usgov-irs-bmf/adapter.js.map +1 -1
- package/out/src/adapters/usgov-nad/adapter.d.ts +11 -0
- package/out/src/adapters/usgov-nad/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-nad/adapter.js +12 -1
- package/out/src/adapters/usgov-nad/adapter.js.map +1 -1
- package/out/src/adapters/usgov-nppes/adapter.d.ts +11 -0
- package/out/src/adapters/usgov-nppes/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-nppes/adapter.js +11 -0
- package/out/src/adapters/usgov-nppes/adapter.js.map +1 -1
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.d.ts +11 -0
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.d.ts.map +1 -1
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.js +15 -2
- package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.js.map +1 -1
- package/out/src/adapters/wof-admin-jp/adapter.d.ts +7 -0
- package/out/src/adapters/wof-admin-jp/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-admin-jp/adapter.js +18 -3
- package/out/src/adapters/wof-admin-jp/adapter.js.map +1 -1
- package/out/src/adapters/wof-admin-json/adapter.d.ts +13 -3
- package/out/src/adapters/wof-admin-json/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-admin-json/adapter.js +15 -5
- package/out/src/adapters/wof-admin-json/adapter.js.map +1 -1
- package/out/src/adapters/wof-postalcode-json/adapter.d.ts +7 -0
- package/out/src/adapters/wof-postalcode-json/adapter.d.ts.map +1 -1
- package/out/src/adapters/wof-postalcode-json/adapter.js +9 -2
- package/out/src/adapters/wof-postalcode-json/adapter.js.map +1 -1
- package/out/src/align.d.ts +12 -4
- package/out/src/align.d.ts.map +1 -1
- package/out/src/align.js +9 -5
- package/out/src/align.js.map +1 -1
- package/out/src/build.d.ts +24 -8
- package/out/src/build.d.ts.map +1 -1
- package/out/src/build.js +3 -3
- package/out/src/build.js.map +1 -1
- package/out/src/codex/us-fips-state.d.ts +6 -2
- package/out/src/codex/us-fips-state.d.ts.map +1 -1
- package/out/src/codex/us-fips-state.js +3 -1
- package/out/src/codex/us-fips-state.js.map +1 -1
- package/out/src/golden.d.ts +21 -7
- package/out/src/golden.d.ts.map +1 -1
- package/out/src/golden.js +18 -10
- package/out/src/golden.js.map +1 -1
- package/out/src/license.d.ts +3 -1
- package/out/src/license.d.ts.map +1 -1
- package/out/src/license.js +4 -2
- package/out/src/license.js.map +1 -1
- package/out/src/parquet-wrapper/reader.d.ts +4 -2
- package/out/src/parquet-wrapper/reader.d.ts.map +1 -1
- package/out/src/parquet-wrapper/reader.js +5 -4
- package/out/src/parquet-wrapper/reader.js.map +1 -1
- package/out/src/parquet-wrapper/schema.d.ts +14 -10
- package/out/src/parquet-wrapper/schema.d.ts.map +1 -1
- package/out/src/parquet-wrapper/schema.js +6 -2
- package/out/src/parquet-wrapper/schema.js.map +1 -1
- package/out/src/parquet-wrapper/writer.d.ts +12 -4
- package/out/src/parquet-wrapper/writer.d.ts.map +1 -1
- package/out/src/parquet-wrapper/writer.js +12 -4
- package/out/src/parquet-wrapper/writer.js.map +1 -1
- package/out/src/parquet.d.ts +21 -7
- package/out/src/parquet.d.ts.map +1 -1
- package/out/src/parquet.js +15 -4
- package/out/src/parquet.js.map +1 -1
- package/out/src/runner.d.ts +39 -13
- package/out/src/runner.d.ts.map +1 -1
- package/out/src/runner.js +7 -3
- package/out/src/runner.js.map +1 -1
- package/out/src/shard-recipes/anchor-absorption.d.ts +4 -0
- package/out/src/shard-recipes/anchor-absorption.d.ts.map +1 -1
- package/out/src/shard-recipes/anchor-absorption.js +14 -5
- package/out/src/shard-recipes/anchor-absorption.js.map +1 -1
- package/out/src/shard-recipes/boundary-stress.d.ts +4 -0
- package/out/src/shard-recipes/boundary-stress.d.ts.map +1 -1
- package/out/src/shard-recipes/boundary-stress.js +13 -7
- package/out/src/shard-recipes/boundary-stress.js.map +1 -1
- package/out/src/shard-recipes/country-balanced.d.ts +4 -0
- package/out/src/shard-recipes/country-balanced.d.ts.map +1 -1
- package/out/src/shard-recipes/country-balanced.js +39 -11
- package/out/src/shard-recipes/country-balanced.js.map +1 -1
- package/out/src/shard-recipes/cz-pcfirst-preposition.d.ts +4 -0
- package/out/src/shard-recipes/cz-pcfirst-preposition.d.ts.map +1 -1
- package/out/src/shard-recipes/cz-pcfirst-preposition.js +4 -0
- package/out/src/shard-recipes/cz-pcfirst-preposition.js.map +1 -1
- package/out/src/shard-recipes/fr-admin-split.d.ts +4 -0
- package/out/src/shard-recipes/fr-admin-split.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-admin-split.js +14 -3
- package/out/src/shard-recipes/fr-admin-split.js.map +1 -1
- package/out/src/shard-recipes/fr-bare-street.d.ts +4 -0
- package/out/src/shard-recipes/fr-bare-street.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-bare-street.js +4 -0
- package/out/src/shard-recipes/fr-bare-street.js.map +1 -1
- package/out/src/shard-recipes/fr-fragment.d.ts +4 -0
- package/out/src/shard-recipes/fr-fragment.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-fragment.js +25 -8
- package/out/src/shard-recipes/fr-fragment.js.map +1 -1
- package/out/src/shard-recipes/fr-lieudit.d.ts +4 -0
- package/out/src/shard-recipes/fr-lieudit.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-lieudit.js +21 -8
- package/out/src/shard-recipes/fr-lieudit.js.map +1 -1
- package/out/src/shard-recipes/fr-order.d.ts +4 -0
- package/out/src/shard-recipes/fr-order.d.ts.map +1 -1
- package/out/src/shard-recipes/fr-order.js +27 -8
- package/out/src/shard-recipes/fr-order.js.map +1 -1
- package/out/src/shard-recipes/german.d.ts +4 -0
- package/out/src/shard-recipes/german.d.ts.map +1 -1
- package/out/src/shard-recipes/german.js +16 -6
- package/out/src/shard-recipes/german.js.map +1 -1
- package/out/src/shard-recipes/house-venue.d.ts +4 -0
- package/out/src/shard-recipes/house-venue.d.ts.map +1 -1
- package/out/src/shard-recipes/house-venue.js +4 -0
- package/out/src/shard-recipes/house-venue.js.map +1 -1
- package/out/src/shard-recipes/index.d.ts +9 -3
- package/out/src/shard-recipes/index.d.ts.map +1 -1
- package/out/src/shard-recipes/index.js +12 -4
- package/out/src/shard-recipes/index.js.map +1 -1
- package/out/src/shard-recipes/intersection.d.ts +4 -0
- package/out/src/shard-recipes/intersection.d.ts.map +1 -1
- package/out/src/shard-recipes/intersection.js +27 -13
- package/out/src/shard-recipes/intersection.js.map +1 -1
- package/out/src/shard-recipes/locale.d.ts +4 -0
- package/out/src/shard-recipes/locale.d.ts.map +1 -1
- package/out/src/shard-recipes/locale.js +9 -4
- package/out/src/shard-recipes/locale.js.map +1 -1
- package/out/src/shard-recipes/nl-postcode.d.ts +4 -0
- package/out/src/shard-recipes/nl-postcode.d.ts.map +1 -1
- package/out/src/shard-recipes/nl-postcode.js +8 -2
- package/out/src/shard-recipes/nl-postcode.js.map +1 -1
- package/out/src/shard-recipes/no-fragment.d.ts +4 -0
- package/out/src/shard-recipes/no-fragment.d.ts.map +1 -1
- package/out/src/shard-recipes/no-fragment.js +8 -2
- package/out/src/shard-recipes/no-fragment.js.map +1 -1
- package/out/src/shard-recipes/no-street-led.d.ts +4 -0
- package/out/src/shard-recipes/no-street-led.d.ts.map +1 -1
- package/out/src/shard-recipes/no-street-led.js +5 -1
- package/out/src/shard-recipes/no-street-led.js.map +1 -1
- package/out/src/shard-recipes/no-street.d.ts +4 -0
- package/out/src/shard-recipes/no-street.d.ts.map +1 -1
- package/out/src/shard-recipes/no-street.js +4 -0
- package/out/src/shard-recipes/no-street.js.map +1 -1
- package/out/src/shard-recipes/po-box-cedex.d.ts +4 -0
- package/out/src/shard-recipes/po-box-cedex.d.ts.map +1 -1
- package/out/src/shard-recipes/po-box-cedex.js +99 -43
- package/out/src/shard-recipes/po-box-cedex.js.map +1 -1
- package/out/src/shard-recipes/po-box.d.ts +4 -0
- package/out/src/shard-recipes/po-box.d.ts.map +1 -1
- package/out/src/shard-recipes/po-box.js +4 -0
- package/out/src/shard-recipes/po-box.js.map +1 -1
- package/out/src/shard-recipes/scaffold.d.ts +48 -16
- package/out/src/shard-recipes/scaffold.d.ts.map +1 -1
- package/out/src/shard-recipes/scaffold.js +10 -6
- package/out/src/shard-recipes/scaffold.js.map +1 -1
- package/out/src/shard-recipes/si-bare-village.d.ts +4 -0
- package/out/src/shard-recipes/si-bare-village.d.ts.map +1 -1
- package/out/src/shard-recipes/si-bare-village.js +4 -0
- package/out/src/shard-recipes/si-bare-village.js.map +1 -1
- package/out/src/shard-recipes/street-affix.d.ts +4 -0
- package/out/src/shard-recipes/street-affix.d.ts.map +1 -1
- package/out/src/shard-recipes/street-affix.js +29 -10
- package/out/src/shard-recipes/street-affix.js.map +1 -1
- package/out/src/shard-recipes/street-bare.d.ts +4 -0
- package/out/src/shard-recipes/street-bare.d.ts.map +1 -1
- package/out/src/shard-recipes/street-bare.js +4 -0
- package/out/src/shard-recipes/street-bare.js.map +1 -1
- package/out/src/shard-recipes/street.d.ts +4 -0
- package/out/src/shard-recipes/street.d.ts.map +1 -1
- package/out/src/shard-recipes/street.js +4 -0
- package/out/src/shard-recipes/street.js.map +1 -1
- package/out/src/shard-recipes/unit.d.ts +4 -0
- package/out/src/shard-recipes/unit.d.ts.map +1 -1
- package/out/src/shard-recipes/unit.js +45 -14
- package/out/src/shard-recipes/unit.js.map +1 -1
- package/out/src/split.d.ts +18 -6
- package/out/src/split.d.ts.map +1 -1
- package/out/src/split.js +4 -2
- package/out/src/split.js.map +1 -1
- package/out/src/synthesize-anchor-absorption.d.ts +7 -1
- package/out/src/synthesize-anchor-absorption.d.ts.map +1 -1
- package/out/src/synthesize-anchor-absorption.js +28 -14
- package/out/src/synthesize-anchor-absorption.js.map +1 -1
- package/out/src/synthesize-boundary-stress.d.ts +3 -1
- package/out/src/synthesize-boundary-stress.d.ts.map +1 -1
- package/out/src/synthesize-boundary-stress.js +35 -28
- package/out/src/synthesize-boundary-stress.js.map +1 -1
- package/out/src/synthesize-german.d.ts +15 -5
- package/out/src/synthesize-german.d.ts.map +1 -1
- package/out/src/synthesize-german.js +9 -3
- package/out/src/synthesize-german.js.map +1 -1
- package/out/src/synthesize-house-venue.d.ts.map +1 -1
- package/out/src/synthesize-house-venue.js +15 -15
- package/out/src/synthesize-house-venue.js.map +1 -1
- package/out/src/synthesize-intersection.d.ts +9 -3
- package/out/src/synthesize-intersection.d.ts.map +1 -1
- package/out/src/synthesize-intersection.js +25 -6
- package/out/src/synthesize-intersection.js.map +1 -1
- package/out/src/synthesize-no-street.d.ts +3 -1
- package/out/src/synthesize-no-street.d.ts.map +1 -1
- package/out/src/synthesize-no-street.js +5 -6
- package/out/src/synthesize-no-street.js.map +1 -1
- package/out/src/synthesize-po-box.d.ts +15 -5
- package/out/src/synthesize-po-box.d.ts.map +1 -1
- package/out/src/synthesize-po-box.js +21 -7
- package/out/src/synthesize-po-box.js.map +1 -1
- package/out/src/synthesize-street.d.ts +3 -1
- package/out/src/synthesize-street.d.ts.map +1 -1
- package/out/src/synthesize-street.js +6 -1
- package/out/src/synthesize-street.js.map +1 -1
- package/out/src/synthesize.d.ts +39 -13
- package/out/src/synthesize.d.ts.map +1 -1
- package/out/src/synthesize.js +66 -36
- package/out/src/synthesize.js.map +1 -1
- package/out/src/tokenize.d.ts +15 -5
- package/out/src/tokenize.d.ts.map +1 -1
- package/out/src/tokenize.js.map +1 -1
- package/out/src/tools/align-shard.d.ts.map +1 -1
- package/out/src/tools/align-shard.js +3 -1
- package/out/src/tools/align-shard.js.map +1 -1
- package/out/src/tools/audit.d.ts.map +1 -1
- package/out/src/tools/audit.js +20 -8
- package/out/src/tools/audit.js.map +1 -1
- package/out/src/tools/corpus-stats.d.ts.map +1 -1
- package/out/src/tools/corpus-stats.js.map +1 -1
- package/out/src/tools/fetch/ban.d.ts.map +1 -1
- package/out/src/tools/fetch/ban.js +17 -10
- package/out/src/tools/fetch/ban.js.map +1 -1
- package/out/src/tools/fetch/download.d.ts +30 -10
- package/out/src/tools/fetch/download.d.ts.map +1 -1
- package/out/src/tools/fetch/download.js +26 -6
- package/out/src/tools/fetch/download.js.map +1 -1
- package/out/src/tools/fetch/hrsa.d.ts.map +1 -1
- package/out/src/tools/fetch/hrsa.js.map +1 -1
- package/out/src/tools/fetch/imls-pls.d.ts.map +1 -1
- package/out/src/tools/fetch/imls-pls.js +18 -18
- package/out/src/tools/fetch/imls-pls.js.map +1 -1
- package/out/src/tools/fetch/index.d.ts +3 -1
- package/out/src/tools/fetch/index.d.ts.map +1 -1
- package/out/src/tools/fetch/index.js +3 -1
- package/out/src/tools/fetch/index.js.map +1 -1
- package/out/src/tools/fetch/nad.d.ts +21 -7
- package/out/src/tools/fetch/nad.d.ts.map +1 -1
- package/out/src/tools/fetch/nad.js +5 -5
- 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 +9 -15
- package/out/src/tools/fetch/nppes.js.map +1 -1
- package/out/src/tools/fetch/openaddresses.d.ts +3 -1
- package/out/src/tools/fetch/openaddresses.d.ts.map +1 -1
- package/out/src/tools/fetch/openaddresses.js +32 -23
- package/out/src/tools/fetch/openaddresses.js.map +1 -1
- package/out/src/tools/fetch/ppd.d.ts +3 -1
- package/out/src/tools/fetch/ppd.d.ts.map +1 -1
- package/out/src/tools/fetch/ppd.js +14 -3
- 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 +13 -6
- package/out/src/tools/fetch/state-hi-schools.js.map +1 -1
- package/out/src/tools/fetch/state-sources.d.ts.map +1 -1
- package/out/src/tools/fetch/state-sources.js +8 -3
- package/out/src/tools/fetch/state-sources.js.map +1 -1
- package/out/src/tools/fetch/tiger-full.d.ts +9 -3
- package/out/src/tools/fetch/tiger-full.d.ts.map +1 -1
- package/out/src/tools/fetch/tiger-full.js +35 -20
- package/out/src/tools/fetch/tiger-full.js.map +1 -1
- package/out/src/tools/gb-title-case.d.ts.map +1 -1
- package/out/src/tools/gb-title-case.js.map +1 -1
- package/out/src/tools/golden-expand.d.ts +24 -8
- package/out/src/tools/golden-expand.d.ts.map +1 -1
- package/out/src/tools/golden-expand.js +20 -12
- package/out/src/tools/golden-expand.js.map +1 -1
- package/out/src/tools/golden-promote.d.ts +18 -6
- package/out/src/tools/golden-promote.d.ts.map +1 -1
- package/out/src/tools/golden-promote.js +22 -7
- package/out/src/tools/golden-promote.js.map +1 -1
- package/out/src/tools/ingest-csv.d.ts +3 -1
- package/out/src/tools/ingest-csv.d.ts.map +1 -1
- package/out/src/tools/ingest-csv.js +17 -19
- package/out/src/tools/ingest-csv.js.map +1 -1
- package/out/src/tools/jsonl-to-parquet.d.ts +18 -6
- package/out/src/tools/jsonl-to-parquet.d.ts.map +1 -1
- package/out/src/tools/jsonl-to-parquet.js +11 -5
- package/out/src/tools/jsonl-to-parquet.js.map +1 -1
- package/out/src/tools/lint-shard-vocab.d.ts +36 -12
- package/out/src/tools/lint-shard-vocab.d.ts.map +1 -1
- package/out/src/tools/lint-shard-vocab.js +25 -11
- package/out/src/tools/lint-shard-vocab.js.map +1 -1
- package/out/src/tools/lint-shard.d.ts +30 -10
- package/out/src/tools/lint-shard.d.ts.map +1 -1
- package/out/src/tools/lint-shard.js +33 -20
- package/out/src/tools/lint-shard.js.map +1 -1
- package/out/src/tools/overlay-manifest.d.ts.map +1 -1
- package/out/src/tools/overlay-manifest.js +6 -4
- package/out/src/tools/overlay-manifest.js.map +1 -1
- package/out/src/tools/shard-kryptonite.d.ts +6 -2
- package/out/src/tools/shard-kryptonite.d.ts.map +1 -1
- package/out/src/tools/shard-kryptonite.js +1 -1
- package/out/src/tools/shard-kryptonite.js.map +1 -1
- package/out/src/tools/shard-translit.d.ts +9 -3
- package/out/src/tools/shard-translit.d.ts.map +1 -1
- package/out/src/tools/shard-translit.js +2 -2
- package/out/src/tools/shard-translit.js.map +1 -1
- package/out/src/types.d.ts +51 -17
- package/out/src/types.d.ts.map +1 -1
- package/out/src/wof-json.d.ts +9 -3
- package/out/src/wof-json.d.ts.map +1 -1
- package/out/src/wof-json.js +6 -4
- package/out/src/wof-json.js.map +1 -1
- package/package.json +7 -6
- package/src/adapter.ts +24 -13
- package/src/adapters/ban/adapter.ts +12 -2
- package/src/adapters/ban/street-decompose.ts +7 -1
- package/src/adapters/fcc-bdc/adapter.ts +19 -3
- package/src/adapters/geonames/adapter.ts +28 -5
- package/src/adapters/geonames-postal/adapter.ts +17 -1
- package/src/adapters/gnaf/adapter.ts +15 -2
- package/src/adapters/gnaf/assemble.ts +40 -10
- package/src/adapters/index.ts +13 -0
- package/src/adapters/openaddresses/adapter.ts +22 -3
- package/src/adapters/overture/adapter.ts +18 -2
- package/src/adapters/state-hi-schools/adapter.ts +15 -0
- package/src/adapters/state-ia-contractors/adapter.ts +15 -0
- package/src/adapters/state-ny-notaries/adapter.ts +15 -0
- package/src/adapters/state-tx-notaries/adapter.ts +18 -2
- package/src/adapters/synth-po-box/adapter.ts +19 -2
- package/src/adapters/tiger/adapter.ts +23 -4
- package/src/adapters/tiger/street-decompose.ts +1 -0
- package/src/adapters/usgov-hrsa-fqhc/adapter.ts +18 -2
- package/src/adapters/usgov-imls-pls/adapter.ts +15 -0
- package/src/adapters/usgov-irs-bmf/adapter.ts +19 -2
- package/src/adapters/usgov-nad/adapter.ts +14 -1
- package/src/adapters/usgov-nppes/adapter.ts +13 -0
- package/src/adapters/usgov-samhsa-treatment-locator/adapter.ts +21 -3
- package/src/adapters/wof-admin-jp/adapter.ts +20 -3
- package/src/adapters/wof-admin-json/adapter.ts +22 -7
- package/src/adapters/wof-postalcode-json/adapter.ts +10 -2
- package/src/align.ts +21 -8
- package/src/build.ts +48 -11
- package/src/codex/us-fips-state.ts +6 -2
- package/src/golden.ts +28 -13
- package/src/license.ts +4 -2
- package/src/parquet-wrapper/reader.ts +6 -4
- package/src/parquet-wrapper/schema.ts +14 -10
- package/src/parquet-wrapper/writer.ts +12 -4
- package/src/parquet.ts +39 -8
- package/src/runner.ts +49 -15
- package/src/shard-recipes/anchor-absorption.ts +21 -5
- package/src/shard-recipes/boundary-stress.ts +20 -7
- package/src/shard-recipes/country-balanced.ts +78 -13
- package/src/shard-recipes/cz-pcfirst-preposition.ts +9 -0
- package/src/shard-recipes/fr-admin-split.ts +30 -5
- package/src/shard-recipes/fr-bare-street.ts +10 -0
- package/src/shard-recipes/fr-fragment.ts +33 -8
- package/src/shard-recipes/fr-lieudit.ts +35 -9
- package/src/shard-recipes/fr-order.ts +47 -9
- package/src/shard-recipes/german.ts +32 -6
- package/src/shard-recipes/house-venue.ts +7 -0
- package/src/shard-recipes/index.ts +12 -4
- package/src/shard-recipes/intersection.ts +63 -14
- package/src/shard-recipes/locale.ts +37 -4
- package/src/shard-recipes/nl-postcode.ts +12 -2
- package/src/shard-recipes/no-fragment.ts +12 -2
- package/src/shard-recipes/no-street-led.ts +11 -1
- package/src/shard-recipes/no-street.ts +7 -0
- package/src/shard-recipes/po-box-cedex.ts +145 -45
- package/src/shard-recipes/po-box.ts +7 -0
- package/src/shard-recipes/scaffold.ts +52 -20
- package/src/shard-recipes/si-bare-village.ts +9 -0
- package/src/shard-recipes/street-affix.ts +88 -13
- package/src/shard-recipes/street-bare.ts +10 -0
- package/src/shard-recipes/street.ts +7 -0
- package/src/shard-recipes/unit.ts +79 -16
- package/src/split.ts +28 -7
- package/src/synthesize-anchor-absorption.ts +41 -14
- package/src/synthesize-boundary-stress.ts +57 -30
- package/src/synthesize-german.ts +30 -7
- package/src/synthesize-house-venue.ts +22 -16
- package/src/synthesize-intersection.ts +34 -7
- package/src/synthesize-no-street.ts +18 -10
- package/src/synthesize-po-box.ts +42 -10
- package/src/synthesize-street.ts +10 -2
- package/src/synthesize.ts +81 -38
- package/src/tokenize.ts +15 -5
- package/src/tools/align-shard.ts +6 -1
- package/src/tools/audit.ts +57 -11
- package/src/tools/corpus-stats.ts +9 -0
- package/src/tools/fetch/ban.ts +32 -10
- package/src/tools/fetch/download.ts +49 -12
- package/src/tools/fetch/hrsa.ts +3 -0
- package/src/tools/fetch/imls-pls.ts +28 -18
- package/src/tools/fetch/index.ts +3 -1
- package/src/tools/fetch/nad.ts +39 -12
- package/src/tools/fetch/nppes.ts +17 -15
- package/src/tools/fetch/openaddresses.ts +52 -24
- package/src/tools/fetch/ppd.ts +22 -3
- package/src/tools/fetch/state-hi-schools.ts +17 -6
- package/src/tools/fetch/state-sources.ts +16 -3
- package/src/tools/fetch/tiger-full.ts +66 -23
- package/src/tools/gb-title-case.ts +1 -0
- package/src/tools/golden-expand.ts +64 -20
- package/src/tools/golden-promote.ts +53 -13
- package/src/tools/ingest-csv.ts +41 -26
- package/src/tools/jsonl-to-parquet.ts +30 -10
- package/src/tools/lint-shard-vocab.ts +75 -24
- package/src/tools/lint-shard.ts +75 -31
- package/src/tools/overlay-manifest.ts +7 -4
- package/src/tools/shard-kryptonite.ts +11 -3
- package/src/tools/shard-translit.ts +20 -5
- package/src/types.ts +51 -17
- package/src/wof-json.ts +18 -7
package/src/parquet.ts
CHANGED
|
@@ -46,10 +46,14 @@ import { ParquetWriter, type ParquetSchemaDefinition } from "./parquet-wrapper/i
|
|
|
46
46
|
import type { SplitName } from "./split.ts"
|
|
47
47
|
import type { LabeledRow } from "./types.ts"
|
|
48
48
|
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Row groups flush at this many rows (parquetjs internal cadence within a shard).
|
|
51
|
+
*/
|
|
50
52
|
export const ROW_GROUP_SIZE = 50_000
|
|
51
53
|
|
|
52
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Snappy is the only zstd-equivalent codec available in @dsnp/parquetjs 1.7.0.
|
|
56
|
+
*/
|
|
53
57
|
export const SHARD_COMPRESSION = "SNAPPY" as const
|
|
54
58
|
|
|
55
59
|
/**
|
|
@@ -74,7 +78,9 @@ export interface ParquetRow {
|
|
|
74
78
|
[key: string]: unknown
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* Column names emitted into every shard. Matches `ParquetRow`.
|
|
83
|
+
*/
|
|
78
84
|
export const PARQUET_COLUMNS = [
|
|
79
85
|
"raw",
|
|
80
86
|
"tokens",
|
|
@@ -92,6 +98,10 @@ export const PARQUET_COLUMNS = [
|
|
|
92
98
|
"synth_base_id",
|
|
93
99
|
] as const
|
|
94
100
|
|
|
101
|
+
/* oxlint-disable unicorn/text-encoding-identifier-case -- `"UTF8"` below is a ParquetType enum member,
|
|
102
|
+
not a text-encoding identifier. Lowercasing it does not type-check against ParquetSchemaDefinition,
|
|
103
|
+
and the rule has no way to tell the two apart. */
|
|
104
|
+
|
|
95
105
|
/**
|
|
96
106
|
* Parquet schema for `LabeledRow` per #18 §4. Optional fields use `optional: true`; repeated UTF8 columns capture
|
|
97
107
|
* tokens/labels arrays. Compression is per-column SNAPPY.
|
|
@@ -116,7 +126,9 @@ export const LABELED_ROW_SCHEMA: ParquetSchemaDefinition<ParquetRow> = {
|
|
|
116
126
|
synth_base_id: { type: "UTF8", compression: SHARD_COMPRESSION, optional: true },
|
|
117
127
|
}
|
|
118
128
|
|
|
119
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* Per-shard metadata captured in `MANIFEST.json`.
|
|
131
|
+
*/
|
|
120
132
|
export interface ShardDescriptor {
|
|
121
133
|
split: SplitName
|
|
122
134
|
path: string
|
|
@@ -140,13 +152,19 @@ export interface ShardManifest {
|
|
|
140
152
|
}
|
|
141
153
|
|
|
142
154
|
export interface WriteShardsOptions {
|
|
143
|
-
/**
|
|
155
|
+
/**
|
|
156
|
+
* Root output directory; corpus version dir is created beneath.
|
|
157
|
+
*/
|
|
144
158
|
outputDir: string
|
|
145
159
|
|
|
146
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Corpus version stamped onto rows + into the output directory name.
|
|
162
|
+
*/
|
|
147
163
|
corpusVersion: string
|
|
148
164
|
|
|
149
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Max rows per `.parquet` shard. Default 1_000_000 per the Phase 1 plan.
|
|
167
|
+
*/
|
|
150
168
|
rowsPerShard?: number
|
|
151
169
|
}
|
|
152
170
|
|
|
@@ -274,9 +292,11 @@ export async function writeShards(perSplit: PerSplitRows, opts: WriteShardsOptio
|
|
|
274
292
|
const splitDir = join(corpusDir, split)
|
|
275
293
|
await mkdir(splitDir, { recursive: true })
|
|
276
294
|
path = join(splitDir, `part-${String(shardIndex).padStart(4, "0")}.parquet`)
|
|
295
|
+
|
|
277
296
|
writer = await ParquetWriter.openFile<ParquetRow>(LABELED_ROW_SCHEMA, path, {
|
|
278
297
|
rowGroupSize: ROW_GROUP_SIZE,
|
|
279
298
|
})
|
|
299
|
+
|
|
280
300
|
writer.setMetadata("mailwoman.corpus_version", opts.corpusVersion)
|
|
281
301
|
writer.setMetadata("mailwoman.split", split)
|
|
282
302
|
writer.setMetadata("mailwoman.shard_index", String(shardIndex))
|
|
@@ -292,6 +312,7 @@ export async function writeShards(perSplit: PerSplitRows, opts: WriteShardsOptio
|
|
|
292
312
|
if (shardRows > 0) {
|
|
293
313
|
const fileStat = await stat(path)
|
|
294
314
|
const sha256 = await hashFile(path)
|
|
315
|
+
|
|
295
316
|
shards.push({
|
|
296
317
|
split,
|
|
297
318
|
path,
|
|
@@ -304,6 +325,7 @@ export async function writeShards(perSplit: PerSplitRows, opts: WriteShardsOptio
|
|
|
304
325
|
last_source_id: lastSourceID,
|
|
305
326
|
})
|
|
306
327
|
}
|
|
328
|
+
|
|
307
329
|
writer = null
|
|
308
330
|
}
|
|
309
331
|
|
|
@@ -311,19 +333,25 @@ export async function writeShards(perSplit: PerSplitRows, opts: WriteShardsOptio
|
|
|
311
333
|
if (!writer) {
|
|
312
334
|
await openShard()
|
|
313
335
|
}
|
|
336
|
+
|
|
314
337
|
const pq = rowToParquet(row)
|
|
315
338
|
await writer!.appendRow(appendShape(pq) as unknown as ParquetRow)
|
|
316
339
|
|
|
317
340
|
if (shardRows === 0) {
|
|
318
341
|
firstSourceID = row.source_id
|
|
319
342
|
}
|
|
343
|
+
|
|
320
344
|
lastSourceID = row.source_id
|
|
345
|
+
|
|
321
346
|
shardRows++
|
|
347
|
+
|
|
322
348
|
counts[split]++
|
|
349
|
+
|
|
323
350
|
totalRows++
|
|
324
351
|
|
|
325
352
|
if (shardRows >= rowsPerShard) {
|
|
326
353
|
await closeShard()
|
|
354
|
+
|
|
327
355
|
shardIndex++
|
|
328
356
|
}
|
|
329
357
|
}
|
|
@@ -342,12 +370,15 @@ export async function writeShards(perSplit: PerSplitRows, opts: WriteShardsOptio
|
|
|
342
370
|
counts,
|
|
343
371
|
total_rows: totalRows,
|
|
344
372
|
}
|
|
373
|
+
|
|
345
374
|
await writeFile(join(corpusDir, "MANIFEST.json"), `${JSON.stringify(manifest, null, 2)}\n`, "utf8")
|
|
346
375
|
|
|
347
376
|
return manifest
|
|
348
377
|
}
|
|
349
378
|
|
|
350
|
-
/**
|
|
379
|
+
/**
|
|
380
|
+
* Single-pass SHA-256 over the file at `path`. Cheap relative to Parquet write throughput.
|
|
381
|
+
*/
|
|
351
382
|
async function hashFile(path: string): Promise<string> {
|
|
352
383
|
const hash = createHash("sha256")
|
|
353
384
|
const stream = createReadStream(path)
|
package/src/runner.ts
CHANGED
|
@@ -34,36 +34,58 @@ import { dirname, join } from "node:path"
|
|
|
34
34
|
import { canonicalDedupKey, streamingSha256, type AdapterRegistry, type StreamingHasher } from "./adapter.ts"
|
|
35
35
|
import type { AdapterOptions, CanonicalRow, CorpusAdapter } from "./types.ts"
|
|
36
36
|
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Snapshot of the runner's state, emitted on every progress tick.
|
|
39
|
+
*/
|
|
38
40
|
export interface RunnerProgress {
|
|
39
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Adapter being driven.
|
|
43
|
+
*/
|
|
40
44
|
adapterID: string
|
|
41
45
|
|
|
42
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Total rows the adapter has yielded (before dedup).
|
|
48
|
+
*/
|
|
43
49
|
yielded: number
|
|
44
50
|
|
|
45
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* Rows actually written to JSONL (after dedup).
|
|
53
|
+
*/
|
|
46
54
|
written: number
|
|
47
55
|
|
|
48
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* Bytes written to JSONL so far.
|
|
58
|
+
*/
|
|
49
59
|
bytes: number
|
|
50
60
|
|
|
51
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Wall-clock milliseconds since the run started.
|
|
63
|
+
*/
|
|
52
64
|
elapsed_ms: number
|
|
53
65
|
}
|
|
54
66
|
|
|
55
|
-
/**
|
|
67
|
+
/**
|
|
68
|
+
* Per-invocation options for `runAdapter`.
|
|
69
|
+
*/
|
|
56
70
|
export interface RunAdapterOptions {
|
|
57
|
-
/**
|
|
71
|
+
/**
|
|
72
|
+
* Adapter to drive.
|
|
73
|
+
*/
|
|
58
74
|
adapter: CorpusAdapter
|
|
59
75
|
|
|
60
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Options handed to the adapter (input path, country filter, limit, signal).
|
|
78
|
+
*/
|
|
61
79
|
adapterOptions: AdapterOptions
|
|
62
80
|
|
|
63
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* Root output directory; the runner creates `<outputDir>/<adapter.id>/` under it.
|
|
83
|
+
*/
|
|
64
84
|
outputDir: string
|
|
65
85
|
|
|
66
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* Corpus version stamped onto every row. Locked together with the tokenizer version.
|
|
88
|
+
*/
|
|
67
89
|
corpusVersion: string
|
|
68
90
|
|
|
69
91
|
/**
|
|
@@ -79,7 +101,9 @@ export interface RunAdapterOptions {
|
|
|
79
101
|
progressEvery?: number
|
|
80
102
|
}
|
|
81
103
|
|
|
82
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Return value of `runAdapter`: the same shape as `MANIFEST.json` on disk.
|
|
106
|
+
*/
|
|
83
107
|
export interface AdapterRunManifest {
|
|
84
108
|
adapter_id: string
|
|
85
109
|
corpus_version: string
|
|
@@ -105,7 +129,7 @@ export interface AdapterRunManifest {
|
|
|
105
129
|
*/
|
|
106
130
|
export async function runAdapter(opts: RunAdapterOptions): Promise<AdapterRunManifest> {
|
|
107
131
|
const { adapter, adapterOptions, outputDir, corpusVersion } = opts
|
|
108
|
-
const progressEvery = opts.progressEvery ??
|
|
132
|
+
const progressEvery = opts.progressEvery ?? 1000
|
|
109
133
|
|
|
110
134
|
const adapterDir = join(outputDir, adapter.id)
|
|
111
135
|
await mkdir(adapterDir, { recursive: true })
|
|
@@ -153,11 +177,13 @@ export async function runAdapter(opts: RunAdapterOptions): Promise<AdapterRunMan
|
|
|
153
177
|
if (yielded % progressEvery === 0) {
|
|
154
178
|
emitProgress()
|
|
155
179
|
}
|
|
180
|
+
|
|
156
181
|
continue
|
|
157
182
|
}
|
|
158
183
|
|
|
159
184
|
if (seen.size >= DEDUP_MAX_SIZE) {
|
|
160
185
|
dedupExhausted = true
|
|
186
|
+
|
|
161
187
|
process.stderr.write(
|
|
162
188
|
` runner: dedup set full at ${DEDUP_MAX_SIZE.toLocaleString()} — skipping dedup for remaining rows\n`
|
|
163
189
|
)
|
|
@@ -169,6 +195,7 @@ export async function runAdapter(opts: RunAdapterOptions): Promise<AdapterRunMan
|
|
|
169
195
|
const line = `${JSON.stringify(stamped)}\n`
|
|
170
196
|
hasher.update(line)
|
|
171
197
|
bytes += Buffer.byteLength(line, "utf8")
|
|
198
|
+
|
|
172
199
|
written++
|
|
173
200
|
|
|
174
201
|
if (!stream.write(line)) {
|
|
@@ -223,6 +250,7 @@ export async function runAllAdapters(
|
|
|
223
250
|
|
|
224
251
|
for (const adapter of registry.list()) {
|
|
225
252
|
const adapterOptions = common.adapterOptionsFor?.(adapter) ?? common.adapterOptions
|
|
253
|
+
|
|
226
254
|
out.push(
|
|
227
255
|
await runAdapter({
|
|
228
256
|
...common,
|
|
@@ -261,23 +289,29 @@ function assertEmittedRow(adapter: CorpusAdapter, row: CanonicalRow): void {
|
|
|
261
289
|
}
|
|
262
290
|
}
|
|
263
291
|
|
|
264
|
-
/**
|
|
292
|
+
/**
|
|
293
|
+
* Promise-ify a single event emission. Used to await `drain` / `close` on the write stream.
|
|
294
|
+
*/
|
|
265
295
|
function once(emitter: WriteStream, event: "drain" | "close"): Promise<void> {
|
|
266
296
|
return new Promise((resolve, reject) => {
|
|
267
297
|
const onEvent = (): void => {
|
|
268
298
|
emitter.off("error", onError)
|
|
269
299
|
resolve()
|
|
270
300
|
}
|
|
301
|
+
|
|
271
302
|
const onError = (err: Error): void => {
|
|
272
303
|
emitter.off(event, onEvent)
|
|
273
304
|
reject(err)
|
|
274
305
|
}
|
|
306
|
+
|
|
275
307
|
emitter.once(event, onEvent)
|
|
276
308
|
emitter.once("error", onError)
|
|
277
309
|
})
|
|
278
310
|
}
|
|
279
311
|
|
|
280
|
-
/**
|
|
312
|
+
/**
|
|
313
|
+
* Convenience: ensure the parent directory of `filePath` exists.
|
|
314
|
+
*/
|
|
281
315
|
export async function ensureParentDir(filePath: string): Promise<void> {
|
|
282
316
|
await mkdir(dirname(filePath), { recursive: true })
|
|
283
317
|
}
|
|
@@ -21,11 +21,15 @@ import { alignRow } from "../align.ts"
|
|
|
21
21
|
import { synthesizeAnchorAbsorptionRow } from "../synthesize-anchor-absorption.ts"
|
|
22
22
|
import { makeLcg, type ShardRecipe } from "./scaffold.ts"
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The leading-5-digit source: the real US ZIPs in the postcode anchor's pilot lookup. Resolved through the data-root
|
|
26
|
+
* helper (the lab default is `$MAILWOMAN_DATA_ROOT`), never re-hardcoded.
|
|
27
|
+
*/
|
|
26
28
|
const ANCHOR_LOOKUP = dataRootPath("anchor", "pilot-anchor-lookup.json")
|
|
27
29
|
|
|
28
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* The real US ZIPs in the anchor lookup (entries whose value is a `[{ US: … }]` candidate list).
|
|
32
|
+
*/
|
|
29
33
|
function loadRealUsZips(path: string): string[] {
|
|
30
34
|
const d = JSON.parse(readFileSync(path, "utf8")) as Record<string, unknown>
|
|
31
35
|
const zips: string[] = []
|
|
@@ -39,6 +43,10 @@ function loadRealUsZips(path: string): string[] {
|
|
|
39
43
|
return zips
|
|
40
44
|
}
|
|
41
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Shard recipe registered with the corpus builder — see the file header for the parse behaviour it exists to exercise,
|
|
48
|
+
* and `description` below for the surface form it generates.
|
|
49
|
+
*/
|
|
42
50
|
export const anchorAbsorptionRecipe: ShardRecipe = {
|
|
43
51
|
name: "anchor-absorption",
|
|
44
52
|
description: "Anchor-absorption counter-augmentation (#220/#723): 6-slice mix → synthesizeAnchorAbsorptionRow",
|
|
@@ -47,8 +55,9 @@ export const anchorAbsorptionRecipe: ShardRecipe = {
|
|
|
47
55
|
// Emit PRNG: the legacy build-anchor-absorption-shard.mjs seeded an LCG (lcg(opts.seed)).
|
|
48
56
|
const random = makeLcg(opts.seed)
|
|
49
57
|
const source = opts.sourceName ?? "synth-anchor-absorption"
|
|
50
|
-
const count = opts.count ??
|
|
58
|
+
const count = opts.count ?? 50_000
|
|
51
59
|
const realZips = loadRealUsZips(ANCHOR_LOOKUP)
|
|
60
|
+
|
|
52
61
|
console.error(`Loaded ${realZips.length} real US ZIPs from the anchor lookup (the leading-5-digit source).`)
|
|
53
62
|
|
|
54
63
|
let written = 0
|
|
@@ -57,7 +66,9 @@ export const anchorAbsorptionRecipe: ShardRecipe = {
|
|
|
57
66
|
|
|
58
67
|
for (let i = 0; i < count; i++) {
|
|
59
68
|
const synth = synthesizeAnchorAbsorptionRow({ random, realZips })
|
|
60
|
-
const country = synth.locale.split("-")[1]
|
|
69
|
+
const country = synth.locale.split("-")[1]
|
|
70
|
+
|
|
71
|
+
// "en-US" -> "US", "de-DE" -> "DE"
|
|
61
72
|
const canonical = {
|
|
62
73
|
raw: synth.raw,
|
|
63
74
|
components: synth.components,
|
|
@@ -66,18 +77,23 @@ export const anchorAbsorptionRecipe: ShardRecipe = {
|
|
|
66
77
|
source,
|
|
67
78
|
source_id: stableSourceID(source, `${i}` as unknown as Parameters<typeof stableSourceID>[1]),
|
|
68
79
|
}
|
|
80
|
+
|
|
69
81
|
const aligned = alignRow(canonical as Parameters<typeof alignRow>[0])
|
|
70
82
|
|
|
71
83
|
if (aligned.kind !== "labeled") {
|
|
72
84
|
quarantined++
|
|
85
|
+
|
|
73
86
|
continue
|
|
74
87
|
}
|
|
88
|
+
|
|
75
89
|
write(
|
|
76
90
|
JSON.stringify({ ...aligned.row, synth_method: "anchor-absorption", synth_template: synth.template }) + "\n"
|
|
77
91
|
)
|
|
92
|
+
|
|
78
93
|
written++
|
|
79
94
|
byTemplate[synth.template] = (byTemplate[synth.template] ?? 0) + 1
|
|
80
95
|
}
|
|
96
|
+
|
|
81
97
|
console.error(`\nwrote ${written} rows (${quarantined} quarantined)`)
|
|
82
98
|
console.error(" by slice:", JSON.stringify(byTemplate))
|
|
83
99
|
|
|
@@ -16,11 +16,13 @@ import { alignRow } from "../align.ts"
|
|
|
16
16
|
import { type BoundaryStressTemplate, synthesizeBoundaryStressRow } from "../synthesize-boundary-stress.ts"
|
|
17
17
|
import { makeMulberry32, type ShardRecipe, shardSourceID } from "./scaffold.ts"
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Revised composition (v1.7.0, DeepSeek-tuned 2026-06-18): `bare-locality` ~11% (recover the 84% locality drop on bare
|
|
21
|
+
* "City, STATE" rows WITHOUT becoming a locality-first majority), and house-number-before:after = 7:3 (FR's dominant
|
|
22
|
+
* order is number-BEFORE; 30% after breaks the order-bias shortcut without risking FR hn-before accuracy). The three
|
|
23
|
+
* original non-number shapes keep the bulk. Weights sum to 1.0. Key order is load-bearing — it drives the cumulative
|
|
24
|
+
* thresholds below.
|
|
25
|
+
*/
|
|
24
26
|
const WEIGHTS: Record<BoundaryStressTemplate, number> = {
|
|
25
27
|
"street-eats-affix": 0.22,
|
|
26
28
|
"comma-less-city-state": 0.22,
|
|
@@ -29,6 +31,7 @@ const WEIGHTS: Record<BoundaryStressTemplate, number> = {
|
|
|
29
31
|
"house-number-before-street": 0.189,
|
|
30
32
|
"house-number-after-street": 0.081,
|
|
31
33
|
}
|
|
34
|
+
|
|
32
35
|
const CUM: Array<[BoundaryStressTemplate, number]> = (() => {
|
|
33
36
|
let acc = 0
|
|
34
37
|
|
|
@@ -36,14 +39,19 @@ const CUM: Array<[BoundaryStressTemplate, number]> = (() => {
|
|
|
36
39
|
([t, w]) => [t, (acc += w)] as [BoundaryStressTemplate, number]
|
|
37
40
|
)
|
|
38
41
|
})()
|
|
42
|
+
|
|
39
43
|
function pickTemplate(r: () => number): BoundaryStressTemplate {
|
|
40
44
|
const x = r()
|
|
41
45
|
|
|
42
46
|
for (const [t, c] of CUM) if (x <= c) return t
|
|
43
47
|
|
|
44
|
-
return CUM
|
|
48
|
+
return CUM.at(-1)![0]
|
|
45
49
|
}
|
|
46
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Shard recipe registered with the corpus builder — see the file header for the parse behaviour it exists to exercise,
|
|
53
|
+
* and `description` below for the surface form it generates.
|
|
54
|
+
*/
|
|
47
55
|
export const boundaryStressRecipe: ShardRecipe = {
|
|
48
56
|
name: "boundary-stress",
|
|
49
57
|
description: "Boundary-instability rows (#375): weighted template mix → synthesizeBoundaryStressRow → aligned BIO",
|
|
@@ -51,7 +59,7 @@ export const boundaryStressRecipe: ShardRecipe = {
|
|
|
51
59
|
async run(opts, write) {
|
|
52
60
|
// Emit PRNG: the legacy build-boundary-stress-shard.mjs seeded mulberry32(opts.seed).
|
|
53
61
|
const random = makeMulberry32(opts.seed)
|
|
54
|
-
const count = opts.count ??
|
|
62
|
+
const count = opts.count ?? 20_000
|
|
55
63
|
let emitted = 0
|
|
56
64
|
let skipped = 0
|
|
57
65
|
|
|
@@ -59,6 +67,7 @@ export const boundaryStressRecipe: ShardRecipe = {
|
|
|
59
67
|
const row = synthesizeBoundaryStressRow(undefined, { random, forceTemplate: pickTemplate(random) })
|
|
60
68
|
const country = row.locale.split("-")[1] ?? "US"
|
|
61
69
|
const source_id = shardSourceID("synth-boundary-stress", { ...row.components, v: String(i) })
|
|
70
|
+
|
|
62
71
|
const canonical = {
|
|
63
72
|
raw: row.raw,
|
|
64
73
|
components: row.components,
|
|
@@ -69,16 +78,20 @@ export const boundaryStressRecipe: ShardRecipe = {
|
|
|
69
78
|
corpus_version: "0.6.0",
|
|
70
79
|
license: "Synthetic — boundary-stress; derived from public-domain locality/region tuples",
|
|
71
80
|
}
|
|
81
|
+
|
|
72
82
|
const aligned = alignRow(canonical as Parameters<typeof alignRow>[0])
|
|
73
83
|
|
|
74
84
|
if (aligned.kind !== "labeled") {
|
|
75
85
|
skipped++
|
|
86
|
+
|
|
76
87
|
continue
|
|
77
88
|
}
|
|
89
|
+
|
|
78
90
|
// Match the base corpus parquet schema: flat synth_method / synth_base_id, not a nested `synth`.
|
|
79
91
|
write(
|
|
80
92
|
JSON.stringify({ ...aligned.row, synth_method: `boundary-stress:${row.template}`, synth_base_id: null }) + "\n"
|
|
81
93
|
)
|
|
94
|
+
|
|
82
95
|
emitted++
|
|
83
96
|
}
|
|
84
97
|
|