@mailwoman/resolver-wof-sqlite 9.2.0 → 9.3.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 -19
- package/lib/address/index.ts +9 -0
- package/{address-point-interpolation.ts → lib/address/point-interpolation.ts} +24 -22
- package/{address-point-schema.ts → lib/address/point-schema.ts} +18 -4
- package/{address-point.ts → lib/address/point.ts} +89 -27
- package/{ancestry-backfill.ts → lib/ancestry/backfill.ts} +14 -19
- package/{ancestry.ts → lib/ancestry/index.ts} +5 -3
- package/{build-candidate.ts → lib/build-candidate.ts} +84 -77
- package/{build-slim.ts → lib/build-slim.ts} +150 -165
- package/{candidate → lib/candidate}/alias-bags.ts +8 -6
- package/{candidate → lib/candidate}/ancestors-sidecar.ts +13 -15
- package/{candidate → lib/candidate}/country-display-names.ts +2 -2
- package/{candidate/shard-fold.ts → lib/candidate/extract-fold.ts} +26 -25
- package/{candidate → lib/candidate}/name-roles.ts +17 -16
- package/{candidate → lib/candidate}/own-name.ts +1 -1
- package/{candidate → lib/candidate}/place-attrs.ts +3 -3
- package/{candidate-ancestors-schema.ts → lib/candidate-ancestors-schema.ts} +4 -4
- package/{candidate-fts.ts → lib/candidate-fts.ts} +3 -3
- package/{candidate-importance.ts → lib/candidate-importance.ts} +53 -57
- package/{candidate-lookup.ts → lib/candidate-lookup.ts} +76 -73
- package/{candidate-schema.ts → lib/candidate-schema.ts} +5 -5
- package/{candidate-scoring.ts → lib/candidate-scoring.ts} +15 -22
- package/{capital-schema.ts → lib/capital-schema.ts} +5 -6
- package/{capitals.ts → lib/capitals.ts} +2 -2
- package/{coincident-roles.ts → lib/coincident-roles.ts} +8 -11
- package/{convention.ts → lib/convention/index.ts} +3 -3
- package/{convention-schema.ts → lib/convention/schema.ts} +2 -2
- package/{coverage-manifest-schema.ts → lib/coverage-manifest-schema.ts} +9 -10
- package/{currency-backfill.ts → lib/currency-backfill.ts} +126 -41
- package/lib/env.ts +50 -0
- package/{exact-match.ts → lib/exact-match.ts} +23 -14
- package/{sharding.ts → lib/extracts.ts} +61 -58
- package/{fst-autocomplete.ts → lib/fst/autocomplete.ts} +4 -4
- package/{fst-builder.ts → lib/fst/builder.ts} +17 -16
- package/{fst-deserialize-web.ts → lib/fst/deserialize-web.ts} +27 -87
- package/lib/fst/format.ts +106 -0
- package/{fst-freshness.ts → lib/fst/freshness.ts} +41 -74
- package/lib/fst/index.ts +14 -0
- package/{fst-matcher.ts → lib/fst/matcher.ts} +1 -1
- package/{fst-serialize.ts → lib/fst/serialize.ts} +37 -115
- package/{fst-types.ts → lib/fst/types.ts} +4 -2
- package/{fts.ts → lib/fts/index.ts} +24 -19
- package/{fts-query.ts → lib/fts/query.ts} +1 -1
- package/{geonames-aliases.ts → lib/geonames/aliases.ts} +13 -13
- package/lib/geonames/index.ts +8 -0
- package/{geonames-postal.ts → lib/geonames/postal.ts} +14 -13
- package/{index.ts → lib/index.ts} +37 -37
- package/{interpolation.ts → lib/interpolation.ts} +27 -25
- package/{lookup.ts → lib/lookup.ts} +129 -141
- package/lib/nsul/index.ts +8 -0
- package/lib/nsul/lookup.ts +144 -0
- package/lib/nsul/schema.ts +130 -0
- package/{place-importance-schema.ts → lib/place-importance-schema.ts} +7 -8
- package/lib/poi/index.ts +8 -0
- package/{poi-lookup.ts → lib/poi/lookup.ts} +22 -28
- package/{poi-schema.ts → lib/poi/schema.ts} +3 -4
- package/{postal-city-alias-lookup.ts → lib/postal/city-alias-lookup.ts} +14 -20
- package/{postal-city-candidate-schema.ts → lib/postal/city-candidate-schema.ts} +2 -2
- package/lib/postal/index.ts +9 -0
- package/{postcode-point-lookup.ts → lib/postcode-point-lookup.ts} +17 -15
- package/{primary-preference.ts → lib/primary-preference.ts} +29 -10
- package/{proximity-rerank.ts → lib/proximity-rerank.ts} +2 -2
- package/{ranking-weights.ts → lib/ranking-weights.ts} +30 -4
- package/{region-keys.ts → lib/region-keys.ts} +9 -9
- package/{reverse.ts → lib/reverse.ts} +34 -46
- package/{schema.ts → lib/schema.ts} +10 -0
- package/{search-fetch.ts → lib/search-fetch.ts} +29 -28
- package/{sqlite-convention-source.ts → lib/sqlite-convention-source.ts} +9 -10
- package/{sqlite-utils.ts → lib/sqlite-utils.ts} +14 -18
- package/{street-centroid-schema.ts → lib/street/centroid-schema.ts} +5 -5
- package/{street-centroid.ts → lib/street/centroid.ts} +14 -21
- package/lib/street/index.ts +13 -0
- package/{street-morphology-fst-builder.ts → lib/street/morphology-fst-builder.ts} +24 -14
- package/{street-morphology-fst-loader.ts → lib/street/morphology-fst-loader.ts} +14 -12
- package/{street-name-lookup.ts → lib/street/name-lookup.ts} +14 -30
- package/{street-normalize.ts → lib/street/normalize.ts} +44 -19
- package/{street-segment-schema.ts → lib/street/segment-schema.ts} +7 -7
- package/{types.ts → lib/types.ts} +18 -12
- package/{unified-schema.ts → lib/unified-schema.ts} +20 -24
- package/lib/uprn/existence.ts +84 -0
- package/lib/uprn/index.ts +9 -0
- package/{uprn-lookup.ts → lib/uprn/lookup.ts} +14 -18
- package/{uprn-schema.ts → lib/uprn/schema.ts} +3 -3
- package/lib/weights-overlay-linker.ts +878 -0
- package/out/address/index.d.ts +9 -0
- package/out/address/index.d.ts.map +1 -0
- package/out/address/index.js +9 -0
- package/out/address/index.js.map +1 -0
- package/out/{address-point-interpolation.d.ts → address/point-interpolation.d.ts} +11 -10
- package/out/address/point-interpolation.d.ts.map +1 -0
- package/out/{address-point-interpolation.js → address/point-interpolation.js} +18 -18
- package/out/address/point-interpolation.js.map +1 -0
- package/out/{address-point-schema.d.ts → address/point-schema.d.ts} +16 -6
- package/out/address/point-schema.d.ts.map +1 -0
- package/out/{address-point-schema.js → address/point-schema.js} +7 -3
- package/out/address/point-schema.js.map +1 -0
- package/out/{address-point.d.ts → address/point.d.ts} +16 -8
- package/out/address/point.d.ts.map +1 -0
- package/out/{address-point.js → address/point.js} +71 -20
- package/out/address/point.js.map +1 -0
- package/out/{ancestry-backfill.d.ts → ancestry/backfill.d.ts} +7 -5
- package/out/ancestry/backfill.d.ts.map +1 -0
- package/out/{ancestry-backfill.js → ancestry/backfill.js} +12 -16
- package/out/ancestry/backfill.js.map +1 -0
- package/out/{ancestry.d.ts → ancestry/index.d.ts} +4 -3
- package/out/ancestry/index.d.ts.map +1 -0
- package/out/{ancestry.js → ancestry/index.js} +3 -2
- package/out/ancestry/index.js.map +1 -0
- package/out/build-candidate.d.ts +30 -24
- package/out/build-candidate.d.ts.map +1 -1
- package/out/build-candidate.js +50 -52
- package/out/build-candidate.js.map +1 -1
- package/out/build-slim.d.ts +4 -4
- package/out/build-slim.d.ts.map +1 -1
- package/out/build-slim.js +124 -139
- package/out/build-slim.js.map +1 -1
- package/out/candidate/alias-bags.d.ts +5 -3
- package/out/candidate/alias-bags.d.ts.map +1 -1
- package/out/candidate/alias-bags.js +2 -2
- package/out/candidate/alias-bags.js.map +1 -1
- package/out/candidate/ancestors-sidecar.d.ts +9 -10
- package/out/candidate/ancestors-sidecar.d.ts.map +1 -1
- package/out/candidate/ancestors-sidecar.js +7 -7
- package/out/candidate/ancestors-sidecar.js.map +1 -1
- package/out/candidate/country-display-names.d.ts +1 -1
- package/out/candidate/country-display-names.d.ts.map +1 -1
- package/out/candidate/country-display-names.js +1 -1
- package/out/candidate/country-display-names.js.map +1 -1
- package/out/candidate/extract-fold.d.ts +32 -0
- package/out/candidate/extract-fold.d.ts.map +1 -0
- package/out/candidate/{shard-fold.js → extract-fold.js} +20 -20
- package/out/candidate/extract-fold.js.map +1 -0
- package/out/candidate/name-roles.d.ts +13 -11
- package/out/candidate/name-roles.d.ts.map +1 -1
- package/out/candidate/name-roles.js +11 -10
- package/out/candidate/name-roles.js.map +1 -1
- package/out/candidate/own-name.d.ts +1 -1
- package/out/candidate/own-name.d.ts.map +1 -1
- package/out/candidate/own-name.js +1 -1
- package/out/candidate/own-name.js.map +1 -1
- package/out/candidate/place-attrs.d.ts +3 -3
- package/out/candidate/place-attrs.d.ts.map +1 -1
- package/out/candidate/place-attrs.js +1 -1
- package/out/candidate/place-attrs.js.map +1 -1
- package/out/candidate-ancestors-schema.d.ts +4 -4
- package/out/candidate-ancestors-schema.d.ts.map +1 -1
- package/out/candidate-ancestors-schema.js +2 -2
- package/out/candidate-ancestors-schema.js.map +1 -1
- package/out/candidate-fts.d.ts +3 -3
- package/out/candidate-fts.d.ts.map +1 -1
- package/out/candidate-fts.js +1 -1
- package/out/candidate-fts.js.map +1 -1
- package/out/candidate-importance.d.ts +16 -16
- package/out/candidate-importance.d.ts.map +1 -1
- package/out/candidate-importance.js +46 -51
- package/out/candidate-importance.js.map +1 -1
- package/out/candidate-lookup.d.ts +11 -9
- package/out/candidate-lookup.d.ts.map +1 -1
- package/out/candidate-lookup.js +61 -58
- package/out/candidate-lookup.js.map +1 -1
- package/out/candidate-schema.d.ts +5 -5
- package/out/candidate-schema.d.ts.map +1 -1
- package/out/candidate-schema.js.map +1 -1
- package/out/candidate-scoring.d.ts +7 -7
- package/out/candidate-scoring.d.ts.map +1 -1
- package/out/candidate-scoring.js +10 -14
- package/out/candidate-scoring.js.map +1 -1
- package/out/capital-schema.d.ts +3 -3
- package/out/capital-schema.d.ts.map +1 -1
- package/out/capital-schema.js +2 -2
- package/out/capital-schema.js.map +1 -1
- package/out/capitals.d.ts +1 -1
- package/out/capitals.d.ts.map +1 -1
- package/out/capitals.js +2 -2
- package/out/capitals.js.map +1 -1
- package/out/coincident-roles.d.ts +6 -5
- package/out/coincident-roles.d.ts.map +1 -1
- package/out/coincident-roles.js +2 -4
- package/out/coincident-roles.js.map +1 -1
- package/out/{convention.d.ts → convention/index.d.ts} +4 -4
- package/out/convention/index.d.ts.map +1 -0
- package/out/{convention.js → convention/index.js} +2 -2
- package/out/convention/index.js.map +1 -0
- package/out/{convention-schema.d.ts → convention/schema.d.ts} +2 -2
- package/out/convention/schema.d.ts.map +1 -0
- package/out/{convention-schema.js → convention/schema.js} +3 -3
- package/out/convention/schema.js.map +1 -0
- package/out/coverage-manifest-schema.d.ts +8 -8
- package/out/coverage-manifest-schema.d.ts.map +1 -1
- package/out/coverage-manifest-schema.js +4 -4
- package/out/coverage-manifest-schema.js.map +1 -1
- package/out/currency-backfill.d.ts +51 -7
- package/out/currency-backfill.d.ts.map +1 -1
- package/out/currency-backfill.js +65 -49
- package/out/currency-backfill.js.map +1 -1
- package/out/env.d.ts +43 -0
- package/out/env.d.ts.map +1 -0
- package/out/env.js +48 -0
- package/out/env.js.map +1 -0
- package/out/exact-match.d.ts +5 -5
- package/out/exact-match.d.ts.map +1 -1
- package/out/exact-match.js +10 -11
- package/out/exact-match.js.map +1 -1
- package/out/extracts.d.ts +114 -0
- package/out/extracts.d.ts.map +1 -0
- package/out/{sharding.js → extracts.js} +38 -38
- package/out/extracts.js.map +1 -0
- package/out/{fst-autocomplete.d.ts → fst/autocomplete.d.ts} +2 -2
- package/out/fst/autocomplete.d.ts.map +1 -0
- package/out/{fst-autocomplete.js → fst/autocomplete.js} +3 -3
- package/out/fst/autocomplete.js.map +1 -0
- package/out/{fst-builder.d.ts → fst/builder.d.ts} +5 -5
- package/out/fst/builder.d.ts.map +1 -0
- package/out/{fst-builder.js → fst/builder.js} +14 -13
- package/out/fst/builder.js.map +1 -0
- package/out/{fst-deserialize-web.d.ts → fst/deserialize-web.d.ts} +3 -3
- package/out/fst/deserialize-web.d.ts.map +1 -0
- package/out/{fst-deserialize-web.js → fst/deserialize-web.js} +10 -74
- package/out/fst/deserialize-web.js.map +1 -0
- package/out/fst/format.d.ts +80 -0
- package/out/fst/format.d.ts.map +1 -0
- package/out/fst/format.js +91 -0
- package/out/fst/format.js.map +1 -0
- package/out/{fst-freshness.d.ts → fst/freshness.d.ts} +10 -13
- package/out/fst/freshness.d.ts.map +1 -0
- package/out/{fst-freshness.js → fst/freshness.js} +41 -73
- package/out/fst/freshness.js.map +1 -0
- package/out/fst/index.d.ts +14 -0
- package/out/fst/index.d.ts.map +1 -0
- package/out/fst/index.js +14 -0
- package/out/fst/index.js.map +1 -0
- package/out/{fst-matcher.d.ts → fst/matcher.d.ts} +2 -2
- package/out/fst/matcher.d.ts.map +1 -0
- package/out/{fst-matcher.js → fst/matcher.js} +1 -1
- package/out/fst/matcher.js.map +1 -0
- package/out/{fst-serialize.d.ts → fst/serialize.d.ts} +5 -10
- package/out/fst/serialize.d.ts.map +1 -0
- package/out/{fst-serialize.js → fst/serialize.js} +18 -98
- package/out/fst/serialize.js.map +1 -0
- package/out/{fst-types.d.ts → fst/types.d.ts} +4 -3
- package/out/fst/types.d.ts.map +1 -0
- package/out/{fst-types.js → fst/types.js} +1 -1
- package/out/fst/types.js.map +1 -0
- package/out/{fts.d.ts → fts/index.d.ts} +16 -9
- package/out/fts/index.d.ts.map +1 -0
- package/out/{fts.js → fts/index.js} +16 -11
- package/out/fts/index.js.map +1 -0
- package/out/{fts-query.d.ts → fts/query.d.ts} +2 -2
- package/out/fts/query.d.ts.map +1 -0
- package/out/{fts-query.js → fts/query.js} +1 -1
- package/out/fts/query.js.map +1 -0
- package/out/{geonames-aliases.d.ts → geonames/aliases.d.ts} +8 -6
- package/out/geonames/aliases.d.ts.map +1 -0
- package/out/{geonames-aliases.js → geonames/aliases.js} +7 -7
- package/out/geonames/aliases.js.map +1 -0
- package/out/geonames/index.d.ts +8 -0
- package/out/geonames/index.d.ts.map +1 -0
- package/out/geonames/index.js +8 -0
- package/out/geonames/index.js.map +1 -0
- package/out/{geonames-postal.d.ts → geonames/postal.d.ts} +10 -8
- package/out/geonames/postal.d.ts.map +1 -0
- package/out/{geonames-postal.js → geonames/postal.js} +9 -9
- package/out/geonames/postal.js.map +1 -0
- package/out/index.d.ts +32 -32
- package/out/index.d.ts.map +1 -1
- package/out/index.js +24 -24
- package/out/index.js.map +1 -1
- package/out/interpolation.d.ts +10 -9
- package/out/interpolation.d.ts.map +1 -1
- package/out/interpolation.js +20 -20
- package/out/interpolation.js.map +1 -1
- package/out/lookup.d.ts +21 -20
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +102 -112
- package/out/lookup.js.map +1 -1
- package/out/name-score.d.ts.map +1 -1
- package/out/name-score.js.map +1 -1
- package/out/nsul/index.d.ts +8 -0
- package/out/nsul/index.d.ts.map +1 -0
- package/out/nsul/index.js +8 -0
- package/out/nsul/index.js.map +1 -0
- package/out/nsul/lookup.d.ts +83 -0
- package/out/nsul/lookup.d.ts.map +1 -0
- package/out/nsul/lookup.js +80 -0
- package/out/nsul/lookup.js.map +1 -0
- package/out/nsul/schema.d.ts +100 -0
- package/out/nsul/schema.d.ts.map +1 -0
- package/out/nsul/schema.js +78 -0
- package/out/nsul/schema.js.map +1 -0
- package/out/place-importance-schema.d.ts +5 -5
- package/out/place-importance-schema.d.ts.map +1 -1
- package/out/place-importance-schema.js +3 -3
- package/out/place-importance-schema.js.map +1 -1
- package/out/poi/index.d.ts +8 -0
- package/out/poi/index.d.ts.map +1 -0
- package/out/poi/index.js +8 -0
- package/out/poi/index.js.map +1 -0
- package/out/{poi-lookup.d.ts → poi/lookup.d.ts} +8 -10
- package/out/poi/lookup.d.ts.map +1 -0
- package/out/{poi-lookup.js → poi/lookup.js} +14 -18
- package/out/poi/lookup.js.map +1 -0
- package/out/{poi-schema.d.ts → poi/schema.d.ts} +4 -4
- package/out/poi/schema.d.ts.map +1 -0
- package/out/{poi-schema.js → poi/schema.js} +1 -1
- package/out/poi/schema.js.map +1 -0
- package/out/polygon-schema.d.ts.map +1 -1
- package/out/polygon-schema.js.map +1 -1
- package/out/{postal-city-alias-lookup.d.ts → postal/city-alias-lookup.d.ts} +6 -5
- package/out/postal/city-alias-lookup.d.ts.map +1 -0
- package/out/{postal-city-alias-lookup.js → postal/city-alias-lookup.js} +11 -15
- package/out/postal/city-alias-lookup.js.map +1 -0
- package/out/{postal-city-alias-schema.d.ts → postal/city-alias-schema.d.ts} +1 -1
- package/out/{postal-city-alias-schema.d.ts.map → postal/city-alias-schema.d.ts.map} +1 -1
- package/out/{postal-city-alias-schema.js → postal/city-alias-schema.js} +1 -1
- package/out/{postal-city-alias-schema.js.map → postal/city-alias-schema.js.map} +1 -1
- package/out/{postal-city-candidate-schema.d.ts → postal/city-candidate-schema.d.ts} +3 -3
- package/out/{postal-city-candidate-schema.d.ts.map → postal/city-candidate-schema.d.ts.map} +1 -1
- package/out/{postal-city-candidate-schema.js → postal/city-candidate-schema.js} +2 -2
- package/out/{postal-city-candidate-schema.js.map → postal/city-candidate-schema.js.map} +1 -1
- package/out/postal/index.d.ts +9 -0
- package/out/postal/index.d.ts.map +1 -0
- package/out/postal/index.js +9 -0
- package/out/postal/index.js.map +1 -0
- package/out/postcode-point-lookup.d.ts +10 -10
- package/out/postcode-point-lookup.d.ts.map +1 -1
- package/out/postcode-point-lookup.js +13 -13
- package/out/postcode-point-lookup.js.map +1 -1
- package/out/primary-preference.d.ts +13 -5
- package/out/primary-preference.d.ts.map +1 -1
- package/out/primary-preference.js +16 -8
- package/out/primary-preference.js.map +1 -1
- package/out/proximity-rerank.d.ts +2 -2
- package/out/proximity-rerank.d.ts.map +1 -1
- package/out/proximity-rerank.js +2 -2
- package/out/proximity-rerank.js.map +1 -1
- package/out/ranking-weights.d.ts +15 -3
- package/out/ranking-weights.d.ts.map +1 -1
- package/out/ranking-weights.js +21 -3
- package/out/ranking-weights.js.map +1 -1
- package/out/region-keys.d.ts +8 -8
- package/out/region-keys.d.ts.map +1 -1
- package/out/region-keys.js +9 -9
- package/out/region-keys.js.map +1 -1
- package/out/reverse.d.ts +6 -6
- package/out/reverse.d.ts.map +1 -1
- package/out/reverse.js +20 -29
- package/out/reverse.js.map +1 -1
- package/out/schema.d.ts +9 -0
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js.map +1 -1
- package/out/search-fetch.d.ts +12 -10
- package/out/search-fetch.d.ts.map +1 -1
- package/out/search-fetch.js +21 -20
- package/out/search-fetch.js.map +1 -1
- package/out/sqlite-convention-source.d.ts +7 -7
- package/out/sqlite-convention-source.d.ts.map +1 -1
- package/out/sqlite-convention-source.js +5 -5
- package/out/sqlite-convention-source.js.map +1 -1
- package/out/sqlite-utils.d.ts +8 -8
- package/out/sqlite-utils.d.ts.map +1 -1
- package/out/sqlite-utils.js +7 -8
- package/out/sqlite-utils.js.map +1 -1
- package/out/{street-centroid-schema.d.ts → street/centroid-schema.d.ts} +6 -6
- package/out/{street-centroid-schema.d.ts.map → street/centroid-schema.d.ts.map} +1 -1
- package/out/{street-centroid-schema.js → street/centroid-schema.js} +5 -5
- package/out/{street-centroid-schema.js.map → street/centroid-schema.js.map} +1 -1
- package/out/{street-centroid.d.ts → street/centroid.d.ts} +6 -6
- package/out/street/centroid.d.ts.map +1 -0
- package/out/{street-centroid.js → street/centroid.js} +13 -19
- package/out/street/centroid.js.map +1 -0
- package/out/street/index.d.ts +13 -0
- package/out/street/index.d.ts.map +1 -0
- package/out/street/index.js +13 -0
- package/out/street/index.js.map +1 -0
- package/out/{street-morphology-fst-builder.d.ts → street/morphology-fst-builder.d.ts} +4 -4
- package/out/street/morphology-fst-builder.d.ts.map +1 -0
- package/out/{street-morphology-fst-builder.js → street/morphology-fst-builder.js} +18 -13
- package/out/street/morphology-fst-builder.js.map +1 -0
- package/out/{street-morphology-fst-loader.d.ts → street/morphology-fst-loader.d.ts} +5 -5
- package/out/street/morphology-fst-loader.d.ts.map +1 -0
- package/out/{street-morphology-fst-loader.js → street/morphology-fst-loader.js} +11 -10
- package/out/street/morphology-fst-loader.js.map +1 -0
- package/out/{street-name-lookup.d.ts → street/name-lookup.d.ts} +4 -7
- package/out/street/name-lookup.d.ts.map +1 -0
- package/out/{street-name-lookup.js → street/name-lookup.js} +9 -23
- package/out/street/name-lookup.js.map +1 -0
- package/out/{street-normalize.d.ts → street/normalize.d.ts} +25 -14
- package/out/street/normalize.d.ts.map +1 -0
- package/out/{street-normalize.js → street/normalize.js} +36 -17
- package/out/street/normalize.js.map +1 -0
- package/out/{street-segment-schema.d.ts → street/segment-schema.d.ts} +8 -8
- package/out/{street-segment-schema.d.ts.map → street/segment-schema.d.ts.map} +1 -1
- package/out/{street-segment-schema.js → street/segment-schema.js} +4 -4
- package/out/{street-segment-schema.js.map → street/segment-schema.js.map} +1 -1
- package/out/types.d.ts +18 -12
- package/out/types.d.ts.map +1 -1
- package/out/types.js.map +1 -1
- package/out/unified-schema.d.ts +5 -4
- package/out/unified-schema.d.ts.map +1 -1
- package/out/unified-schema.js +15 -18
- package/out/unified-schema.js.map +1 -1
- package/out/uprn/existence.d.ts +53 -0
- package/out/uprn/existence.d.ts.map +1 -0
- package/out/uprn/existence.js +61 -0
- package/out/uprn/existence.js.map +1 -0
- package/out/uprn/index.d.ts +9 -0
- package/out/uprn/index.d.ts.map +1 -0
- package/out/uprn/index.js +9 -0
- package/out/uprn/index.js.map +1 -0
- package/out/{uprn-lookup.d.ts → uprn/lookup.d.ts} +4 -4
- package/out/uprn/lookup.d.ts.map +1 -0
- package/out/{uprn-lookup.js → uprn/lookup.js} +11 -14
- package/out/uprn/lookup.js.map +1 -0
- package/out/{uprn-schema.d.ts → uprn/schema.d.ts} +4 -4
- package/out/uprn/schema.d.ts.map +1 -0
- package/out/{uprn-schema.js → uprn/schema.js} +4 -4
- package/out/uprn/schema.js.map +1 -0
- package/out/weights-overlay-linker.d.ts +184 -26
- package/out/weights-overlay-linker.d.ts.map +1 -1
- package/out/weights-overlay-linker.js +338 -86
- package/out/weights-overlay-linker.js.map +1 -1
- package/package.json +465 -269
- package/out/address-point-interpolation.d.ts.map +0 -1
- package/out/address-point-interpolation.js.map +0 -1
- package/out/address-point-schema.d.ts.map +0 -1
- package/out/address-point-schema.js.map +0 -1
- package/out/address-point.d.ts.map +0 -1
- package/out/address-point.js.map +0 -1
- package/out/ancestry-backfill.d.ts.map +0 -1
- package/out/ancestry-backfill.js.map +0 -1
- package/out/ancestry.d.ts.map +0 -1
- package/out/ancestry.js.map +0 -1
- package/out/candidate/shard-fold.d.ts +0 -31
- package/out/candidate/shard-fold.d.ts.map +0 -1
- package/out/candidate/shard-fold.js.map +0 -1
- package/out/convention-schema.d.ts.map +0 -1
- package/out/convention-schema.js.map +0 -1
- package/out/convention.d.ts.map +0 -1
- package/out/convention.js.map +0 -1
- package/out/fst-autocomplete.d.ts.map +0 -1
- package/out/fst-autocomplete.js.map +0 -1
- package/out/fst-builder.d.ts.map +0 -1
- package/out/fst-builder.js.map +0 -1
- package/out/fst-deserialize-web.d.ts.map +0 -1
- package/out/fst-deserialize-web.js.map +0 -1
- package/out/fst-freshness.d.ts.map +0 -1
- package/out/fst-freshness.js.map +0 -1
- package/out/fst-matcher.d.ts.map +0 -1
- package/out/fst-matcher.js.map +0 -1
- package/out/fst-serialize.d.ts.map +0 -1
- package/out/fst-serialize.js.map +0 -1
- package/out/fst-types.d.ts.map +0 -1
- package/out/fst-types.js.map +0 -1
- package/out/fts-query.d.ts.map +0 -1
- package/out/fts-query.js.map +0 -1
- package/out/fts.d.ts.map +0 -1
- package/out/fts.js.map +0 -1
- package/out/geonames-aliases.d.ts.map +0 -1
- package/out/geonames-aliases.js.map +0 -1
- package/out/geonames-postal.d.ts.map +0 -1
- package/out/geonames-postal.js.map +0 -1
- package/out/poi-lookup.d.ts.map +0 -1
- package/out/poi-lookup.js.map +0 -1
- package/out/poi-schema.d.ts.map +0 -1
- package/out/poi-schema.js.map +0 -1
- package/out/postal-city-alias-lookup.d.ts.map +0 -1
- package/out/postal-city-alias-lookup.js.map +0 -1
- package/out/sharding.d.ts +0 -114
- package/out/sharding.d.ts.map +0 -1
- package/out/sharding.js.map +0 -1
- package/out/street-centroid.d.ts.map +0 -1
- package/out/street-centroid.js.map +0 -1
- package/out/street-morphology-fst-builder.d.ts.map +0 -1
- package/out/street-morphology-fst-builder.js.map +0 -1
- package/out/street-morphology-fst-loader.d.ts.map +0 -1
- package/out/street-morphology-fst-loader.js.map +0 -1
- package/out/street-name-lookup.d.ts.map +0 -1
- package/out/street-name-lookup.js.map +0 -1
- package/out/street-normalize.d.ts.map +0 -1
- package/out/street-normalize.js.map +0 -1
- package/out/uprn-lookup.d.ts.map +0 -1
- package/out/uprn-lookup.js.map +0 -1
- package/out/uprn-schema.d.ts.map +0 -1
- package/out/uprn-schema.js.map +0 -1
- package/weights-overlay-linker.ts +0 -377
- /package/{name-score.ts → lib/name-score.ts} +0 -0
- /package/{polygon-schema.ts → lib/polygon-schema.ts} +0 -0
- /package/{postal-city-alias-schema.ts → lib/postal/city-alias-schema.ts} +0 -0
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* updated at gazetteer REBUILD, not by a hand-edited code PR after someone remembers:
|
|
9
9
|
*
|
|
10
10
|
* - `country_coverage`: the hard-country-filter coverage record (#743/#194) — per-country
|
|
11
|
-
*
|
|
11
|
+
* promotion-eval verdicts + the measured hard-resolve rates that used to live in a code comment on
|
|
12
12
|
* `HARD_PLACE_COUNTRY_SAFELIST`. Presence = measured; `hard_filter_safe = 0` = measured and
|
|
13
|
-
* FAILED the
|
|
13
|
+
* FAILED the check (FI 69.5%, PL 77.8%) — distinguishable from a country never measured at all
|
|
14
14
|
* (the meaning-of-zero rule, `docs/engineering/reference/layer-contract.mdx`).
|
|
15
15
|
* - `country_bbox`: the coarse guard-B plausibility boxes that used to live in
|
|
16
16
|
* `resolver/plausibility.ts`'s `COUNTRY_BBOX`. An absent row fails open (never trips the guard),
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
* calls {@link readGazetteerCoverageManifest} in its constructor); an artifact that predates the
|
|
23
23
|
* manifest returns `undefined` and every consumer falls back to the code constants byte-identically.
|
|
24
24
|
*/
|
|
25
|
-
import type { DatabaseSync } from "node:sqlite";
|
|
26
25
|
import { type CountryBBoxFact, type CountryCoverageFact, type GazetteerArtifactCoverage } from "@mailwoman/core/resolver";
|
|
26
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
27
27
|
import { type Kysely } from "kysely";
|
|
28
28
|
/**
|
|
29
29
|
* One country's hard-filter coverage measurement — the storage form of {@link CountryCoverageFact}.
|
|
@@ -34,7 +34,7 @@ export interface CountryCoverageTable {
|
|
|
34
34
|
*/
|
|
35
35
|
country: string;
|
|
36
36
|
/**
|
|
37
|
-
* 0/1 — the
|
|
37
|
+
* 0/1 — the promotion-eval verdict (a verdict column, NOT re-derived from the rate; see the fact type's docstring).
|
|
38
38
|
*/
|
|
39
39
|
hard_filter_safe: number;
|
|
40
40
|
/**
|
|
@@ -46,11 +46,11 @@ export interface CountryCoverageTable {
|
|
|
46
46
|
*/
|
|
47
47
|
sample_size: number | null;
|
|
48
48
|
/**
|
|
49
|
-
* ISO-8601 date of the measurement / promote
|
|
49
|
+
* ISO-8601 date of the measurement / promote eval.
|
|
50
50
|
*/
|
|
51
51
|
measured_at: string;
|
|
52
52
|
/**
|
|
53
|
-
* The receipt: which panel/
|
|
53
|
+
* The receipt: which panel/check produced this row.
|
|
54
54
|
*/
|
|
55
55
|
source: string;
|
|
56
56
|
}
|
|
@@ -79,7 +79,7 @@ export interface GazetteerCoverageDatabase {
|
|
|
79
79
|
country_bbox: CountryBBoxTable;
|
|
80
80
|
}
|
|
81
81
|
/**
|
|
82
|
-
* Table names the lookup probes (existence-
|
|
82
|
+
* Table names the lookup probes (existence-restricted, so a candidate.db built before the manifest is byte-stable).
|
|
83
83
|
*/
|
|
84
84
|
export declare const COUNTRY_COVERAGE_TABLE = "country_coverage";
|
|
85
85
|
/**
|
|
@@ -108,5 +108,5 @@ export declare function writeGazetteerCoverageManifest(db: Kysely<GazetteerCover
|
|
|
108
108
|
* purpose: this runs inside {@link WOFCandidateTableLookup}'s synchronous constructor (the sync-reader carve-out in
|
|
109
109
|
* `AGENTS.md`), and the tables are a few dozen rows read once per open.
|
|
110
110
|
*/
|
|
111
|
-
export declare function readGazetteerCoverageManifest(db:
|
|
111
|
+
export declare function readGazetteerCoverageManifest<DB>(db: DatabaseClient<DB>): GazetteerArtifactCoverage | undefined;
|
|
112
112
|
//# sourceMappingURL=coverage-manifest-schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-manifest-schema.d.ts","sourceRoot":"","sources":["../coverage-manifest-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"coverage-manifest-schema.d.ts","sourceRoot":"","sources":["../lib/coverage-manifest-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAO,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;AAIzC;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC;;OAEG;IACH,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,gBAAgB,EAAE,oBAAoB,CAAA;IACtC,YAAY,EAAE,gBAAgB,CAAA;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,qBAAqB,CAAA;AACxD;;GAEG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAA;AAEhD;;GAEG;AACH,wBAAsB,0BAA0B,CAAC,EAAE,EAAE,MAAM,CAAC,yBAAyB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAarG;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,EAAE,EAAE,MAAM,CAAC,yBAAyB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAYjG;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CACnD,EAAE,EAAE,MAAM,CAAC,yBAAyB,CAAC,EACrC,KAAK,EAAE;IAAE,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,GACrF,OAAO,CAAC,IAAI,CAAC,CAmCf;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,GAAG,yBAAyB,GAAG,SAAS,CAuD/G"}
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* updated at gazetteer REBUILD, not by a hand-edited code PR after someone remembers:
|
|
9
9
|
*
|
|
10
10
|
* - `country_coverage`: the hard-country-filter coverage record (#743/#194) — per-country
|
|
11
|
-
*
|
|
11
|
+
* promotion-eval verdicts + the measured hard-resolve rates that used to live in a code comment on
|
|
12
12
|
* `HARD_PLACE_COUNTRY_SAFELIST`. Presence = measured; `hard_filter_safe = 0` = measured and
|
|
13
|
-
* FAILED the
|
|
13
|
+
* FAILED the check (FI 69.5%, PL 77.8%) — distinguishable from a country never measured at all
|
|
14
14
|
* (the meaning-of-zero rule, `docs/engineering/reference/layer-contract.mdx`).
|
|
15
15
|
* - `country_bbox`: the coarse guard-B plausibility boxes that used to live in
|
|
16
16
|
* `resolver/plausibility.ts`'s `COUNTRY_BBOX`. An absent row fails open (never trips the guard),
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import { hardCountrySafelistFromCoverage, } from "@mailwoman/core/resolver";
|
|
26
26
|
import { sql } from "kysely";
|
|
27
|
-
import { allRows, hasTable } from "
|
|
27
|
+
import { allRows, hasTable } from "#sqlite-utils";
|
|
28
28
|
/**
|
|
29
|
-
* Table names the lookup probes (existence-
|
|
29
|
+
* Table names the lookup probes (existence-restricted, so a candidate.db built before the manifest is byte-stable).
|
|
30
30
|
*/
|
|
31
31
|
export const COUNTRY_COVERAGE_TABLE = "country_coverage";
|
|
32
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverage-manifest-schema.js","sourceRoot":"","sources":["../coverage-manifest-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"coverage-manifest-schema.js","sourceRoot":"","sources":["../lib/coverage-manifest-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACN,+BAA+B,GAI/B,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAe,MAAM,QAAQ,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AA0DjD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,kBAAkB,CAAA;AACxD;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,cAAc,CAAA;AAEhD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAAC,EAAqC;IACrF,MAAM,EAAE,CAAC,MAAM;SACb,WAAW,CAAC,sBAAsB,CAAC;SACnC,WAAW,EAAE;SACb,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;SACnD,SAAS,CAAC,kBAAkB,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC5D,SAAS,CAAC,mBAAmB,EAAE,MAAM,CAAC;SACt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AAE,CAAC,OAAO,CAAC,mEAAmE,kBAAkB,EAAE,CAAC,CACnG,CAAA;QAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAA;YAEjD,aAAa,CAAC,GAAG,CAAC,OAAO,EAAE;gBAC1B,OAAO;gBACP,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;gBAC3B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;gBAC3B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;gBAC3B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;gBAC3B,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC;aAC1B,CAAC,CAAA;QACH,CAAC;IACF,CAAC;IAED,OAAO;QACN,eAAe;QACf,aAAa;QACb,mBAAmB,EAAE,+BAA+B,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC;KAC9E,CAAA;AACF,CAAC"}
|
|
@@ -4,20 +4,22 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* Pass 1c of the candidate build (#1737): resurrect deprecated-with-no-successor WOF localities that a second
|
|
7
|
-
* source independently attests. Extracted from `build-candidate.ts` as a cohesive unit — the
|
|
7
|
+
* source independently attests. Extracted from `build-candidate.ts` as a cohesive unit — the checks, their measured
|
|
8
8
|
* constants, and the GeoNames dump reader live together here; the build calls {@link resurrectCurrencyHoles} once,
|
|
9
9
|
* between the primaries pass and the alias pass.
|
|
10
10
|
*/
|
|
11
|
-
import type {
|
|
12
|
-
import type { loadImportanceIndex } from "
|
|
13
|
-
import type {
|
|
11
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
12
|
+
import type { loadImportanceIndex } from "#candidate-importance";
|
|
13
|
+
import type { CandidateDatabase } from "#candidate-schema";
|
|
14
|
+
import type { PlaceAttrs, StageRow } from "#candidate/place-attrs";
|
|
15
|
+
import type { WOFDatabase } from "#schema";
|
|
14
16
|
/**
|
|
15
17
|
* Pass 1c (#1737): resurrect deprecated-with-no-successor localities that a second source independently attests.
|
|
16
18
|
*
|
|
17
19
|
* WOF deprecations WITH a successor need nothing — the successor indexes. A deprecation with `is_superseded = 0` on a
|
|
18
20
|
* populated place is the shape of an upstream mistake (Rochester Kent, Aldershot, Telford; 120 GB localities alone),
|
|
19
21
|
* and it is indistinguishable from a correct pruning at this layer without outside evidence. So every resurrection
|
|
20
|
-
* requires all three
|
|
22
|
+
* requires all three conditions, positive evidence only:
|
|
21
23
|
*
|
|
22
24
|
* 1. NO live same-name spr row of any placetype within {@link CURRENCY_BACKFILL_RADIUS_KM} of the dead record — a live row
|
|
23
25
|
* means the place is alive (possibly under another placetype) and there is no hole. A DISTANT same-name row is a
|
|
@@ -30,9 +32,39 @@ import type { PlaceAttrs, StageRow } from "./candidate/place-attrs.ts";
|
|
|
30
32
|
* lets the row stand in prominence races (the dead record's own population is absent). Each name is judged once per
|
|
31
33
|
* country; the resurrected place joins `attrs`, so the alias pass explodes its alt names like any primary's.
|
|
32
34
|
*/
|
|
35
|
+
export interface CurrencyBackfillOutcomes {
|
|
36
|
+
judged: number;
|
|
37
|
+
blocked: number;
|
|
38
|
+
unattested: number;
|
|
39
|
+
floored: number;
|
|
40
|
+
resurrected: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One country's read of the check — every dead name judged, by outcome and by the dead row's placetype — so a census
|
|
44
|
+
* can say what a wider dead-row query admits before a build carries it.
|
|
45
|
+
*/
|
|
46
|
+
export interface CurrencyBackfillCountryReport extends CurrencyBackfillOutcomes {
|
|
47
|
+
country: string;
|
|
48
|
+
deadPlacetypes: readonly string[];
|
|
49
|
+
dumpPresent: boolean;
|
|
50
|
+
byDeadPlacetype: Record<string, CurrencyBackfillOutcomes>;
|
|
51
|
+
/**
|
|
52
|
+
* The first resurrected names, `placetype:name`, so a census reads what a wider query admits — capped, because the
|
|
53
|
+
* report is a receipt and not the table.
|
|
54
|
+
*/
|
|
55
|
+
sample: string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The placetypes a dead row may carry to be judged at all. `locality` is the shipped default; `localadmin` is the
|
|
59
|
+
* second cause #1746 named (one GB row of seventeen) and is admitted through this option once its census is read.
|
|
60
|
+
*/
|
|
61
|
+
export declare const DEFAULT_DEAD_PLACETYPES: readonly string[];
|
|
33
62
|
export declare function resurrectCurrencyHoles(ctx: {
|
|
34
|
-
src:
|
|
35
|
-
|
|
63
|
+
src: DatabaseClient<WOFDatabase>;
|
|
64
|
+
/**
|
|
65
|
+
* The candidate build's transaction. Required unless `dryRun` — a dry run judges every row and stages nothing.
|
|
66
|
+
*/
|
|
67
|
+
tx?: DatabaseClient<CandidateDatabase>;
|
|
36
68
|
geonamesDir: string;
|
|
37
69
|
countries: readonly string[];
|
|
38
70
|
attrs: Map<number, PlaceAttrs>;
|
|
@@ -42,5 +74,17 @@ export declare function resurrectCurrencyHoles(ctx: {
|
|
|
42
74
|
importance: ReturnType<typeof loadImportanceIndex> | undefined;
|
|
43
75
|
stageRow: StageRow;
|
|
44
76
|
progress: (phase: string, message: string) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Which dead placetypes are judged. Default {@link DEFAULT_DEAD_PLACETYPES}.
|
|
79
|
+
*/
|
|
80
|
+
deadPlacetypes?: readonly string[];
|
|
81
|
+
/**
|
|
82
|
+
* Judge and count, stage nothing — the census mode. No transaction is opened.
|
|
83
|
+
*/
|
|
84
|
+
dryRun?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Receives one report per country judged (a country with no dump or no dead rows reports zero outcomes).
|
|
87
|
+
*/
|
|
88
|
+
onCountry?: (report: CurrencyBackfillCountryReport) => void;
|
|
45
89
|
}): Promise<number>;
|
|
46
90
|
//# sourceMappingURL=currency-backfill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency-backfill.d.ts","sourceRoot":"","sources":["../currency-backfill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"currency-backfill.d.ts","sourceRoot":"","sources":["../lib/currency-backfill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAI9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAmB1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,wBAAwB;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB;IAC9E,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;IACjC,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAA;IACzD;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAA;CAChB;AAID;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAAiB,CAAA;AAMtE,wBAAsB,sBAAsB,CAAC,GAAG,EAAE;IACjD,GAAG,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;IAChC;;OAEG;IACH,EAAE,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC9B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;IACrC,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,UAAU,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,GAAG,SAAS,CAAA;IAC9D,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAClD;;OAEG;IACH,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAA;CAC3D,GAAG,OAAO,CAAC,MAAM,CAAC,CAmNlB"}
|
package/out/currency-backfill.js
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
6
|
* Pass 1c of the candidate build (#1737): resurrect deprecated-with-no-successor WOF localities that a second
|
|
7
|
-
* source independently attests. Extracted from `build-candidate.ts` as a cohesive unit — the
|
|
7
|
+
* source independently attests. Extracted from `build-candidate.ts` as a cohesive unit — the checks, their measured
|
|
8
8
|
* constants, and the GeoNames dump reader live together here; the build calls {@link resurrectCurrencyHoles} once,
|
|
9
9
|
* between the primaries pass and the alias pass.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
12
|
-
import { resolve } from "node:path";
|
|
11
|
+
import { pathExists } from "@mailwoman/core/fs/readers";
|
|
13
12
|
import { isStrictlyFiner } from "@mailwoman/core/resources/whosonfirst";
|
|
14
13
|
import { haversineKm } from "@mailwoman/spatial";
|
|
14
|
+
import { resolvePath } from "path-ts";
|
|
15
15
|
import { TSVSpliterator } from "spliterator";
|
|
16
|
-
import { normalizeLocalityForKey } from "
|
|
16
|
+
import { normalizeLocalityForKey } from "#street/normalize";
|
|
17
17
|
/**
|
|
18
18
|
* Corroboration radius for the currency backfill (#1737), km — both for the live-near blocker and the GeoNames
|
|
19
19
|
* attestation. Measured basis (2026-08-19 prototype, GB locality slice): at 10 km, 20 of 108 dead names resurrect —
|
|
@@ -28,45 +28,50 @@ const CURRENCY_BACKFILL_RADIUS_KM = 10;
|
|
|
28
28
|
* answering the measured defect (real settlements) rather than re-importing the tail WOF chose to prune.
|
|
29
29
|
*/
|
|
30
30
|
const CURRENCY_BACKFILL_POP_FLOOR = 1000;
|
|
31
|
+
const REPORT_SAMPLE_SIZE = 25;
|
|
31
32
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* WOF deprecations WITH a successor need nothing — the successor indexes. A deprecation with `is_superseded = 0` on a
|
|
35
|
-
* populated place is the shape of an upstream mistake (Rochester Kent, Aldershot, Telford; 120 GB localities alone),
|
|
36
|
-
* and it is indistinguishable from a correct pruning at this layer without outside evidence. So every resurrection
|
|
37
|
-
* requires all three gates, positive evidence only:
|
|
38
|
-
*
|
|
39
|
-
* 1. NO live same-name spr row of any placetype within {@link CURRENCY_BACKFILL_RADIUS_KM} of the dead record — a live row
|
|
40
|
-
* means the place is alive (possibly under another placetype) and there is no hole. A DISTANT same-name row is a
|
|
41
|
-
* namesake and does not block.
|
|
42
|
-
* 2. A GeoNames feature-class-P attestation of the same folded name within the radius.
|
|
43
|
-
* 3. The attestor at or above {@link CURRENCY_BACKFILL_POP_FLOOR}.
|
|
44
|
-
*
|
|
45
|
-
* The staged row keeps the WOF identity — id, name, centroid, bbox, region ancestry — because the dead record's own
|
|
46
|
-
* data is not what is wrong with it. GeoNames contributes exactly two things: the attestation, and the population that
|
|
47
|
-
* lets the row stand in prominence races (the dead record's own population is absent). Each name is judged once per
|
|
48
|
-
* country; the resurrected place joins `attrs`, so the alias pass explodes its alt names like any primary's.
|
|
33
|
+
* The placetypes a dead row may carry to be judged at all. `locality` is the shipped default; `localadmin` is the
|
|
34
|
+
* second cause #1746 named (one GB row of seventeen) and is admitted through this option once its census is read.
|
|
49
35
|
*/
|
|
36
|
+
export const DEFAULT_DEAD_PLACETYPES = ["locality"];
|
|
37
|
+
function emptyOutcomes() {
|
|
38
|
+
return { judged: 0, blocked: 0, unattested: 0, floored: 0, resurrected: 0 };
|
|
39
|
+
}
|
|
50
40
|
export async function resurrectCurrencyHoles(ctx) {
|
|
41
|
+
const deadPlacetypes = ctx.deadPlacetypes ?? DEFAULT_DEAD_PLACETYPES;
|
|
42
|
+
const dryRun = ctx.dryRun === true;
|
|
43
|
+
if (!dryRun && !ctx.tx) {
|
|
44
|
+
throw new Error("resurrectCurrencyHoles: a build run needs the candidate transaction (tx); pass dryRun to judge only");
|
|
45
|
+
}
|
|
51
46
|
const deadStmt = ctx.src.prepare(`SELECT id, name, placetype, latitude, longitude, min_latitude, min_longitude, max_latitude, max_longitude
|
|
52
47
|
FROM spr
|
|
53
|
-
WHERE country = ? AND placetype
|
|
48
|
+
WHERE country = ? AND placetype IN (${deadPlacetypes.map(() => "?").join(", ")})
|
|
54
49
|
AND is_current = 0 AND is_deprecated = 1 AND is_superseded = 0`);
|
|
55
50
|
const liveStmt = ctx.src.prepare(`SELECT latitude, longitude, placetype FROM spr WHERE country = ? AND name = ? AND is_current != 0`);
|
|
56
51
|
let total = 0;
|
|
57
52
|
for (const country of ctx.countries) {
|
|
58
53
|
const cc = country.toUpperCase();
|
|
59
|
-
const dumpPath =
|
|
60
|
-
|
|
54
|
+
const dumpPath = resolvePath(ctx.geonamesDir, `${cc}.txt`);
|
|
55
|
+
const report = {
|
|
56
|
+
country: cc,
|
|
57
|
+
deadPlacetypes,
|
|
58
|
+
dumpPresent: await pathExists(dumpPath),
|
|
59
|
+
...emptyOutcomes(),
|
|
60
|
+
byDeadPlacetype: {},
|
|
61
|
+
sample: [],
|
|
62
|
+
};
|
|
63
|
+
if (!report.dumpPresent) {
|
|
61
64
|
ctx.progress("currency-backfill", `${cc}: no GeoNames dump at ${dumpPath} — holes stay dead`);
|
|
65
|
+
ctx.onCountry?.(report);
|
|
62
66
|
continue;
|
|
63
67
|
}
|
|
64
68
|
// Dead rows FIRST: a country with no deprecated-no-successor localities needs no attestors at all, and
|
|
65
69
|
// loading a national dump to judge zero rows is pure heap pressure on a build already near its ceiling
|
|
66
70
|
// (the first live run OOM'd in a later pass with JP/KR dumps loaded for 0 dead names each).
|
|
67
|
-
const dead = deadStmt.all(cc);
|
|
71
|
+
const dead = deadStmt.all(cc, ...deadPlacetypes);
|
|
68
72
|
if (!dead.length) {
|
|
69
73
|
ctx.progress("currency-backfill", `${cc}: 0 dead names — dump not loaded`);
|
|
74
|
+
ctx.onCountry?.(report);
|
|
70
75
|
continue;
|
|
71
76
|
}
|
|
72
77
|
// Only the dead names' own folded keys can ever be probed, so only those keys are worth holding —
|
|
@@ -98,62 +103,70 @@ export async function resurrectCurrencyHoles(ctx) {
|
|
|
98
103
|
}
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
|
-
let judged = 0;
|
|
102
|
-
let blocked = 0;
|
|
103
|
-
let unattested = 0;
|
|
104
|
-
let floored = 0;
|
|
105
|
-
let resurrected = 0;
|
|
106
106
|
const seen = new Set();
|
|
107
|
-
|
|
107
|
+
const count = (deadPlacetype, outcome) => {
|
|
108
|
+
report[outcome] += 1;
|
|
109
|
+
const bucket = (report.byDeadPlacetype[deadPlacetype] ??= emptyOutcomes());
|
|
110
|
+
bucket[outcome] += 1;
|
|
111
|
+
};
|
|
112
|
+
if (!dryRun) {
|
|
113
|
+
ctx.tx.exec("BEGIN");
|
|
114
|
+
}
|
|
108
115
|
for (const d of dead) {
|
|
109
116
|
const name = String(d.name ?? "");
|
|
110
117
|
const pkey = normalizeLocalityForKey(name);
|
|
111
118
|
if (!pkey || seen.has(pkey))
|
|
112
119
|
continue;
|
|
113
120
|
seen.add(pkey);
|
|
114
|
-
|
|
121
|
+
// Read from the row: the query admits whatever `deadPlacetypes` names, and the rank comparison below must
|
|
122
|
+
// judge each candidate against ITS dead rung, never a hardcoded one.
|
|
123
|
+
const deadPlacetype = String(d.placetype ?? "locality");
|
|
124
|
+
count(deadPlacetype, "judged");
|
|
115
125
|
const dLat = Number(d.latitude);
|
|
116
126
|
const dLon = Number(d.longitude);
|
|
117
|
-
//
|
|
118
|
-
// cannot silently start comparing every candidate against a hardcoded rung.
|
|
119
|
-
const deadPlacetype = String(d.placetype ?? "locality");
|
|
120
|
-
// A live row blocks only when it is AT LEAST AS COARSE as the dead one. The original gate compared name and
|
|
127
|
+
// A live row blocks only when it is AT LEAST AS COARSE as the dead one. The original check compared name and
|
|
121
128
|
// distance alone, on the premise that a nearby same-name row means "the place is alive under another
|
|
122
129
|
// placetype" — true for a place recorded twice, false for a placetype DEMOTION, which is the shape that
|
|
123
130
|
// actually occurs: WOF retired `Gillingham` the locality (pop 101,187) and kept `Gillingham` the
|
|
124
|
-
// neighbourhood 3.2 km away, and the
|
|
131
|
+
// neighbourhood 3.2 km away, and the check read the surviving CHILD as covering its own dead parent.
|
|
125
132
|
// Sixteen of seventeen GB refusals had exactly that shape (#1746).
|
|
126
133
|
//
|
|
127
|
-
// An UNRANKED placetype blocks, which is the conservative direction: this
|
|
134
|
+
// An UNRANKED placetype blocks, which is the conservative direction: this check's failure mode is inventing
|
|
128
135
|
// a place, so a row we cannot rank is treated as covering rather than waved through.
|
|
129
136
|
const liveNear = liveStmt.all(cc, name).some((row) => {
|
|
130
137
|
if (haversineKm(dLat, dLon, Number(row.latitude), Number(row.longitude)) > CURRENCY_BACKFILL_RADIUS_KM) {
|
|
131
138
|
return false;
|
|
132
139
|
}
|
|
133
140
|
// Blocks UNLESS the live row is strictly finer. The equal rung must still block — a live `locality`
|
|
134
|
-
// covers a dead `locality` — and an unranked placetype blocks too, since this
|
|
141
|
+
// covers a dead `locality` — and an unranked placetype blocks too, since this check's failure mode
|
|
135
142
|
// is inventing a place.
|
|
136
143
|
return isStrictlyFiner(String(row.placetype ?? ""), deadPlacetype) !== true;
|
|
137
144
|
});
|
|
138
145
|
if (liveNear) {
|
|
139
|
-
blocked
|
|
146
|
+
count(deadPlacetype, "blocked");
|
|
140
147
|
continue;
|
|
141
148
|
}
|
|
142
149
|
const near = (attestors.get(pkey) ?? []).filter((g) => haversineKm(dLat, dLon, g.lat, g.lon) <= CURRENCY_BACKFILL_RADIUS_KM);
|
|
143
150
|
if (!near.length) {
|
|
144
|
-
unattested
|
|
151
|
+
count(deadPlacetype, "unattested");
|
|
145
152
|
continue;
|
|
146
153
|
}
|
|
147
154
|
const pop = Math.max(...near.map((g) => g.pop));
|
|
148
155
|
if (pop < CURRENCY_BACKFILL_POP_FLOOR) {
|
|
149
|
-
floored
|
|
156
|
+
count(deadPlacetype, "floored");
|
|
150
157
|
continue;
|
|
151
158
|
}
|
|
159
|
+
count(deadPlacetype, "resurrected");
|
|
160
|
+
if (report.sample.length < REPORT_SAMPLE_SIZE) {
|
|
161
|
+
report.sample.push(`${deadPlacetype}:${name}`);
|
|
162
|
+
}
|
|
163
|
+
if (dryRun)
|
|
164
|
+
continue;
|
|
152
165
|
const sid = Number(d.id);
|
|
153
166
|
const a = {
|
|
154
167
|
cid: ctx.ccID(cc),
|
|
155
168
|
rid: ctx.regionOf.get(sid) ?? 0,
|
|
156
|
-
ptid: ctx.ptID(
|
|
169
|
+
ptid: ctx.ptID(deadPlacetype),
|
|
157
170
|
name,
|
|
158
171
|
lat: dLat,
|
|
159
172
|
lon: dLon,
|
|
@@ -164,16 +177,19 @@ export async function resurrectCurrencyHoles(ctx) {
|
|
|
164
177
|
pop,
|
|
165
178
|
neg: -Math.log10(pop + 1),
|
|
166
179
|
pkey,
|
|
167
|
-
imp: ctx.importance?.find(name, cc,
|
|
180
|
+
imp: ctx.importance?.find(name, cc, deadPlacetype, dLat, dLon) ?? null,
|
|
168
181
|
};
|
|
169
182
|
ctx.attrs.set(sid, a);
|
|
170
183
|
ctx.stageRow(pkey, a, sid, 1);
|
|
171
|
-
resurrected++;
|
|
172
184
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
185
|
+
if (!dryRun) {
|
|
186
|
+
ctx.tx.exec("COMMIT");
|
|
187
|
+
}
|
|
188
|
+
ctx.progress("currency-backfill", `${cc}: ${report.resurrected} resurrected of ${report.judged} dead names ` +
|
|
189
|
+
`(${report.blocked} blocked by a live near row, ${report.unattested} unattested, ` +
|
|
190
|
+
`${report.floored} under the population floor)${dryRun ? " — dry run, nothing staged" : ""}`);
|
|
191
|
+
ctx.onCountry?.(report);
|
|
192
|
+
total += report.resurrected;
|
|
177
193
|
}
|
|
178
194
|
return total;
|
|
179
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency-backfill.js","sourceRoot":"","sources":["../currency-backfill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"currency-backfill.js","sourceRoot":"","sources":["../lib/currency-backfill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAM5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAG,EAAE,CAAA;AAEt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AAC,4BAA4B,CAAC,CAAC,CAAC,EAAE,EAAE,CAC7F,CAAA;QAED,GAAG,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,CAAA;QACvB,KAAK,IAAI,MAAM,CAAC,WAAW,CAAA;IAC5B,CAAC;IAED,OAAO,KAAK,CAAA;AACb,CAAC"}
|
package/out/env.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Environment variables naming the WOF SQLite artifacts this resolver opens, and the development weights the overlay
|
|
7
|
+
* linker materializes. CLI flags (`--resolve-db`, …) override these at the call site.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
/**
|
|
11
|
+
* Gazetteer and resolver database paths, plus the development weights overlay.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PublicWOFSQLiteEnvSchema: z.ZodObject<{
|
|
14
|
+
MAILWOMAN_WOF_DB: z.ZodOptional<z.ZodString>;
|
|
15
|
+
MAILWOMAN_WOF_ADMIN_DB: z.ZodOptional<z.ZodString>;
|
|
16
|
+
MAILWOMAN_WOF_POLYGONS_DB: z.ZodOptional<z.ZodString>;
|
|
17
|
+
MAILWOMAN_CANDIDATE_DB: z.ZodOptional<z.ZodString>;
|
|
18
|
+
MAILWOMAN_POSTAL_CITY_ALIAS_DB: z.ZodOptional<z.ZodString>;
|
|
19
|
+
MAILWOMAN_DEV_MODEL: z.ZodOptional<z.ZodString>;
|
|
20
|
+
MAILWOMAN_DEV_TOKENIZER: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
/**
|
|
23
|
+
* Live resolver settings over core's, sharing core's getters and cached values.
|
|
24
|
+
*/
|
|
25
|
+
export declare const $public: Record<never, never> & {
|
|
26
|
+
MAILWOMAN_DATA_ROOT: string;
|
|
27
|
+
MAILWOMAN_CONFIG_ROOT: string;
|
|
28
|
+
MAILWOMAN_CACHE_ROOT: string;
|
|
29
|
+
MAILWOMAN_TEMP_ROOT: string;
|
|
30
|
+
MAILWOMAN_DOCS_URL?: string | undefined;
|
|
31
|
+
MAILWOMAN_LICENSE_KEY?: string | undefined;
|
|
32
|
+
MAILWOMAN_LICENSE_URL?: string | undefined;
|
|
33
|
+
MAILWOMAN_COARSE_PLACER_DIR?: string | undefined;
|
|
34
|
+
} & {
|
|
35
|
+
MAILWOMAN_WOF_DB?: string | undefined;
|
|
36
|
+
MAILWOMAN_WOF_ADMIN_DB?: string | undefined;
|
|
37
|
+
MAILWOMAN_WOF_POLYGONS_DB?: string | undefined;
|
|
38
|
+
MAILWOMAN_CANDIDATE_DB?: string | undefined;
|
|
39
|
+
MAILWOMAN_POSTAL_CITY_ALIAS_DB?: string | undefined;
|
|
40
|
+
MAILWOMAN_DEV_MODEL?: string | undefined;
|
|
41
|
+
MAILWOMAN_DEV_TOKENIZER?: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=env.d.ts.map
|
package/out/env.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../lib/env.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;iBA6BnC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;CAAgD,CAAA"}
|
package/out/env.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Environment variables naming the WOF SQLite artifacts this resolver opens, and the development weights the overlay
|
|
7
|
+
* linker materializes. CLI flags (`--resolve-db`, …) override these at the call site.
|
|
8
|
+
*/
|
|
9
|
+
import { $public as corePublic, liveEnv } from "@mailwoman/core/env";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
/**
|
|
12
|
+
* Gazetteer and resolver database paths, plus the development weights overlay.
|
|
13
|
+
*/
|
|
14
|
+
export const PublicWOFSQLiteEnvSchema = z.object({
|
|
15
|
+
MAILWOMAN_WOF_DB: z.string().optional().meta({
|
|
16
|
+
title: "Who's On First database",
|
|
17
|
+
description: "Path to a full Who's On First SQLite distribution used by the search resolver backend.",
|
|
18
|
+
}),
|
|
19
|
+
MAILWOMAN_WOF_ADMIN_DB: z.string().optional().meta({
|
|
20
|
+
title: "Who's On First admin database",
|
|
21
|
+
description: "Path to the full Who's On First distribution used for reverse geocoding.",
|
|
22
|
+
}),
|
|
23
|
+
MAILWOMAN_WOF_POLYGONS_DB: z.string().optional().meta({
|
|
24
|
+
title: "Who's On First polygon database",
|
|
25
|
+
description: "Path to the polygon sidecar used for exact reverse-geocode containment.",
|
|
26
|
+
}),
|
|
27
|
+
MAILWOMAN_CANDIDATE_DB: z.string().optional().meta({
|
|
28
|
+
title: "Candidate database",
|
|
29
|
+
description: "Path to candidate.db; set to `none` to pin the full-distribution search backend.",
|
|
30
|
+
}),
|
|
31
|
+
MAILWOMAN_POSTAL_CITY_ALIAS_DB: z.string().optional().meta({
|
|
32
|
+
title: "Postal city alias database",
|
|
33
|
+
description: "Path to postal-city alias data used for alias-aware resolution of U.S. mailing addresses.",
|
|
34
|
+
}),
|
|
35
|
+
MAILWOMAN_DEV_MODEL: z.string().optional().meta({
|
|
36
|
+
title: "Development model",
|
|
37
|
+
description: "Path to the model artifact linked for local neural-weights development.",
|
|
38
|
+
}),
|
|
39
|
+
MAILWOMAN_DEV_TOKENIZER: z.string().optional().meta({
|
|
40
|
+
title: "Development tokenizer",
|
|
41
|
+
description: "Path to the tokenizer artifact linked for local neural-weights development.",
|
|
42
|
+
}),
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Live resolver settings over core's, sharing core's getters and cached values.
|
|
46
|
+
*/
|
|
47
|
+
export const $public = liveEnv(PublicWOFSQLiteEnvSchema, corePublic);
|
|
48
|
+
//# sourceMappingURL=env.js.map
|
package/out/env.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../lib/env.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QAC5C,KAAK,EAAE,yBAAyB;QAChC,WAAW,EAAE,wFAAwF;KACrG,CAAC;IACF,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QAClD,KAAK,EAAE,+BAA+B;QACtC,WAAW,EAAE,0EAA0E;KACvF,CAAC;IACF,yBAAyB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QACrD,KAAK,EAAE,iCAAiC;QACxC,WAAW,EAAE,yEAAyE;KACtF,CAAC;IACF,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QAClD,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,kFAAkF;KAC/F,CAAC;IACF,8BAA8B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QAC1D,KAAK,EAAE,4BAA4B;QACnC,WAAW,EAAE,2FAA2F;KACxG,CAAC;IACF,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QAC/C,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,yEAAyE;KACtF,CAAC;IACF,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC;QACnD,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,6EAA6E;KAC1F,CAAC;CACF,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,wBAAwB,EAAE,UAAU,CAAC,CAAA"}
|
package/out/exact-match.d.ts
CHANGED
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
* The exact-match tier's name probes — the two case-folded equality lookups that decide whether a
|
|
7
7
|
* candidate holds the query text as its own name, an alias, or an official name.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
10
10
|
/**
|
|
11
11
|
* Among `ids`, return the subset whose name OR any alias equals `text` case-insensitively — the exact-match tier for
|
|
12
|
-
* ranking. One indexed query over `<schema>.names`. When the
|
|
13
|
-
* `dropNames`, or a postcode-only
|
|
12
|
+
* ranking. One indexed query over `<schema>.names`. When the extract has no `names` table (a slim DB built with
|
|
13
|
+
* `dropNames`, or a postcode-only extract), fall back to the self-contained `place_search` FTS content: its `alt_names`
|
|
14
14
|
* column is the same alias set joined on the boundary-preserving `ALIAS_SEPARATOR` (#523), so `aliasBagExactMatch`
|
|
15
15
|
* recovers the exact alias tier ("New York City" → New York) that the dropped `names` table used to provide.
|
|
16
16
|
*/
|
|
17
|
-
export declare function exactMatchIDs(db:
|
|
17
|
+
export declare function exactMatchIDs<DB>(db: DatabaseClient<DB>, schemaName: string, ids: number[], text: string): Set<number>;
|
|
18
18
|
/**
|
|
19
19
|
* Among `ids` (already known exact matches), the subset holding `text` as an OFFICIAL name (`names.official = 1`, the
|
|
20
20
|
* #940 ingest bit). Same COLLATE NOCASE semantics as {@link WOFSQLitePlaceLookup.#exactMatchIDs} so the two probes
|
|
21
21
|
* agree on what "equals the query" means. Fails soft on gazetteers built before #940 (no `official` column) — the
|
|
22
22
|
* sub-tier then behaves exactly as if `officialNameExact` were off.
|
|
23
23
|
*/
|
|
24
|
-
export declare function officialNameIDs(db:
|
|
24
|
+
export declare function officialNameIDs<DB>(db: DatabaseClient<DB>, schemaName: string, ids: number[], text: string): Set<number>;
|
|
25
25
|
//# sourceMappingURL=exact-match.d.ts.map
|
package/out/exact-match.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exact-match.d.ts","sourceRoot":"","sources":["../exact-match.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"exact-match.d.ts","sourceRoot":"","sources":["../lib/exact-match.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAI9D;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAC/B,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EACtB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EAAE,EACb,IAAI,EAAE,MAAM,GACV,GAAG,CAAC,MAAM,CAAC,CAoDb;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,EACjC,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EACtB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,MAAM,EAAE,EACb,IAAI,EAAE,MAAM,GACV,GAAG,CAAC,MAAM,CAAC,CAsBb"}
|