@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
package/out/build-slim.js
CHANGED
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
* (both derive purely from `spr` + `names` — see `fts.ts`). That means `WOFSQLitePlaceLookup`
|
|
30
30
|
* opens the slim DB without any code change — it sees a smaller universe, nothing more.
|
|
31
31
|
*
|
|
32
|
-
* Multi-
|
|
33
|
-
* into the single output DB. The postcode
|
|
34
|
-
* everything else. Empty / missing input paths are skipped (callers pass `""` when a
|
|
32
|
+
* Multi-extract inputs (e.g. admin + postcode) are processed in sequence; selected rows accumulate
|
|
33
|
+
* into the single output DB. The postcode extract contributes only postcodes; admin contributes
|
|
34
|
+
* everything else. Empty / missing input paths are skipped (callers pass `""` when a extract, such
|
|
35
35
|
* as a custom postcode DB, isn't built yet).
|
|
36
36
|
*/
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import { sealDatabase } from "@mailwoman/
|
|
43
|
-
import {
|
|
44
|
-
import { buildPlaceSearchFTS, PLACE_BBOX_TABLE, PLACE_POPULATION_TABLE, PLACE_SEARCH_TABLE } from "
|
|
37
|
+
import { statPath, pathExists } from "@mailwoman/core/fs/readers";
|
|
38
|
+
import { temporaryDirectory } from "@mailwoman/core/fs/temporary";
|
|
39
|
+
import { copyFileTo, removePath } from "@mailwoman/core/fs/writers";
|
|
40
|
+
import { countRows } from "@mailwoman/sqlite";
|
|
41
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
42
|
+
import { sealDatabase } from "@mailwoman/sqlite/sealed-db";
|
|
43
|
+
import { sql } from "kysely";
|
|
44
|
+
import { buildPlaceSearchFTS, PLACE_BBOX_TABLE, PLACE_POPULATION_TABLE, PLACE_SEARCH_TABLE } from "#fts/index";
|
|
45
45
|
/**
|
|
46
46
|
* Placetypes that we always keep so the ancestor chain a selected locality reports stays valid.
|
|
47
47
|
*/
|
|
@@ -58,58 +58,52 @@ export async function buildSlimWOFDatabase(opts) {
|
|
|
58
58
|
const countries = (opts.countries ?? ["US"]).map((c) => c.toUpperCase());
|
|
59
59
|
const topLocalities = opts.topLocalitiesPerCountry ?? 1000;
|
|
60
60
|
const progress = opts.onProgress ?? (() => { });
|
|
61
|
-
// Callers pass `""` for
|
|
61
|
+
// Callers pass `""` for extracts that don't exist yet (e.g. a not-yet-built custom postcode DB).
|
|
62
62
|
// Skip empties up front; require every remaining path to exist.
|
|
63
63
|
const inputs = opts.inputs.filter((p) => p.length > 0);
|
|
64
64
|
if (!inputs.length)
|
|
65
65
|
throw new Error("no input WOF dbs provided");
|
|
66
66
|
for (const input of inputs) {
|
|
67
|
-
if (!
|
|
67
|
+
if (!(await pathExists(input)))
|
|
68
68
|
throw new Error(`input WOF db not found: ${input}`);
|
|
69
69
|
}
|
|
70
70
|
progress("init", `${inputs.length} input(s) → ${opts.output}`);
|
|
71
|
-
if (
|
|
72
|
-
|
|
71
|
+
if (await pathExists(opts.output)) {
|
|
72
|
+
await removePath(opts.output);
|
|
73
73
|
}
|
|
74
74
|
// Open the output DB and create the empty schema. We discover the schema from the FIRST input
|
|
75
75
|
// (raw sqlite_master read — Kysely doesn't model that) so the output mirrors source column
|
|
76
76
|
// ordering / types. `CREATE TABLE AS SELECT` flattens types to dynamic, which would break
|
|
77
77
|
// callers that rely on column-affinity behavior.
|
|
78
|
-
const out = new
|
|
78
|
+
const out = new DatabaseClient(opts.output);
|
|
79
79
|
let result;
|
|
80
80
|
try {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
throw new Error(`source DB ${inputs[0]} is missing required table '${table}'`);
|
|
100
|
-
}
|
|
81
|
+
using firstSource = new DatabaseClient(inputs[0], { readOnly: true });
|
|
82
|
+
progress("schema", "copying spr / names / place_population schemas from first input");
|
|
83
|
+
for (const table of COPIED_TABLES) {
|
|
84
|
+
const createSQL = firstSource
|
|
85
|
+
.prepare(`SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?`)
|
|
86
|
+
.get(table);
|
|
87
|
+
if (createSQL?.sql) {
|
|
88
|
+
// Raw DDL by design (introspect-and-replay): we exec the SOURCE DB's own CREATE TABLE
|
|
89
|
+
// string read from sqlite_master, so a static Kysely builder can't express it. See AGENTS.md.
|
|
90
|
+
out.exec(createSQL.sql);
|
|
91
|
+
}
|
|
92
|
+
else if (table === PLACE_POPULATION_TABLE) {
|
|
93
|
+
// Older source builds may predate the aux table — create it empty so the per-source
|
|
94
|
+
// copy + ranking have somewhere to land. Sparse-by-design; missing rows are fine.
|
|
95
|
+
out.exec(PLACE_POPULATION_DDL);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
throw new Error(`source DB ${inputs[0]} is missing required table '${table}'`);
|
|
101
99
|
}
|
|
102
|
-
// PRIMARY KEY on spr.id + place_population.id come from the schemas we copied; an explicit
|
|
103
|
-
// index on names.id helps the per-id INSERT SELECT later.
|
|
104
|
-
out.exec(`CREATE INDEX IF NOT EXISTS names_id_idx ON names(id);`);
|
|
105
|
-
}
|
|
106
|
-
finally {
|
|
107
|
-
firstSource.close();
|
|
108
100
|
}
|
|
109
|
-
|
|
101
|
+
// PRIMARY KEY on spr.id + place_population.id come from the schemas we copied; an explicit
|
|
102
|
+
// index on names.id helps the per-id INSERT SELECT later.
|
|
103
|
+
out.exec(`CREATE INDEX IF NOT EXISTS names_id_idx ON names(id);`);
|
|
110
104
|
// Pull rows from each input.
|
|
111
105
|
for (const inputPath of inputs) {
|
|
112
|
-
await copyFromSource(out,
|
|
106
|
+
await copyFromSource(out, out, inputPath, countries, topLocalities, progress);
|
|
113
107
|
}
|
|
114
108
|
// Build the resolver virtual tables on the trimmed row set. Both place_search (FTS5) and
|
|
115
109
|
// place_bbox (R*Tree) derive purely from spr + names — no geojson needed (see fts.ts). The
|
|
@@ -157,15 +151,15 @@ export async function buildSlimWOFDatabase(opts) {
|
|
|
157
151
|
progress("done", JSON.stringify(rowCounts));
|
|
158
152
|
result = {
|
|
159
153
|
outputPath: opts.output,
|
|
160
|
-
outputBytes:
|
|
154
|
+
outputBytes: (await statPath(opts.output)).size,
|
|
161
155
|
rowCounts,
|
|
162
156
|
};
|
|
163
157
|
}
|
|
164
158
|
finally {
|
|
165
|
-
out.
|
|
159
|
+
await out.destroy();
|
|
166
160
|
}
|
|
167
161
|
// The sealed-artifact invariant: a built DB is a read-only asset from the moment it exists.
|
|
168
|
-
sealDatabase(opts.output);
|
|
162
|
+
await sealDatabase(opts.output);
|
|
169
163
|
return result;
|
|
170
164
|
}
|
|
171
165
|
async function copyFromSource(out, kysely, inputPath, countries, topLocalities, progress) {
|
|
@@ -174,106 +168,97 @@ async function copyFromSource(out, kysely, inputPath, countries, topLocalities,
|
|
|
174
168
|
// ATTACH will still want a writable journal on the side; copying to /tmp dodges that without
|
|
175
169
|
// mutating the canonical files in /mnt/playpen/mailwoman-data/wof/. ATTACH / DETACH stay raw
|
|
176
170
|
// — Kysely doesn't model them.
|
|
177
|
-
|
|
178
|
-
const scratchPath =
|
|
179
|
-
|
|
171
|
+
await using tmpScratch = await temporaryDirectory("mailwoman-slim-src-");
|
|
172
|
+
const scratchPath = tmpScratch.resolve("src.db");
|
|
173
|
+
await copyFileTo(inputPath, scratchPath);
|
|
174
|
+
out.exec(`ATTACH DATABASE '${scratchPath.replaceAll("'", "''")}' AS src;`);
|
|
180
175
|
try {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
176
|
+
// Does this extract carry the pre-built population aux table? The admin source does; a bare
|
|
177
|
+
// postcode extract might not. The locality ranking + population copy below adapt accordingly.
|
|
178
|
+
const srcHasPopulation = Boolean(out.prepare(`SELECT 1 FROM src.sqlite_master WHERE type = 'table' AND name = '${PLACE_POPULATION_TABLE}'`).get());
|
|
179
|
+
// The SELECT-INSERT queries below go through Kysely. The cross-schema FROM is the only
|
|
180
|
+
// "interesting" bit: by declaring `src.spr` / `src.names` / `src.place_population` in
|
|
181
|
+
// `BuildSchema`, Kysely lets us write `selectFrom("src.spr")` with the same column-type
|
|
182
|
+
// checking as the regular schema. SQLite parses the dotted identifier as a schema-name
|
|
183
|
+
// qualifier, so this works directly without any aliasing trick.
|
|
184
|
+
// 1. Ancestor placetypes (country / region / county / etc.) — always-kept.
|
|
185
|
+
progress("country", `${inputPath}: ancestor placetypes in (${countries.join(",")})`);
|
|
186
|
+
await kysely
|
|
187
|
+
.insertInto("spr")
|
|
188
|
+
.expression((eb) => eb
|
|
189
|
+
.selectFrom("src.spr")
|
|
190
|
+
.selectAll()
|
|
191
|
+
.where("is_current", "!=", 0)
|
|
192
|
+
.where("is_deprecated", "=", 0)
|
|
193
|
+
.where("country", "in", countries)
|
|
194
|
+
.where("placetype", "in", [...ANCESTOR_PLACETYPES]))
|
|
195
|
+
.onConflict((oc) => oc.doNothing())
|
|
196
|
+
.execute();
|
|
197
|
+
// 2. Top-K localities by population. Population lives in the pre-built `place_population`
|
|
198
|
+
// aux table — left-join it so localities without a population row still qualify (sorted
|
|
199
|
+
// last). If the extract has no population table, fall back to a deterministic id ordering.
|
|
200
|
+
progress("locality", `${inputPath}: top-${topLocalities} localities by population`);
|
|
201
|
+
await kysely
|
|
202
|
+
.insertInto("spr")
|
|
203
|
+
.expression((eb) => eb
|
|
204
|
+
.selectFrom("src.spr as s")
|
|
205
|
+
.$if(srcHasPopulation, (qb) => qb.leftJoin("src.place_population as p", "p.id", "s.id"))
|
|
206
|
+
.selectAll("s")
|
|
207
|
+
.where("s.is_current", "!=", 0)
|
|
208
|
+
.where("s.is_deprecated", "=", 0)
|
|
209
|
+
.where("s.country", "in", countries)
|
|
210
|
+
.where("s.placetype", "=", "locality")
|
|
211
|
+
.orderBy(srcHasPopulation ? sql `COALESCE(p.population, 0)` : sql `s.id`, "desc")
|
|
212
|
+
.limit(topLocalities))
|
|
213
|
+
.onConflict((oc) => oc.doNothing())
|
|
214
|
+
.execute();
|
|
215
|
+
// 3. All postcodes in scope.
|
|
216
|
+
progress("postcode", `${inputPath}: all postcodes`);
|
|
217
|
+
await kysely
|
|
218
|
+
.insertInto("spr")
|
|
219
|
+
.expression((eb) => eb
|
|
220
|
+
.selectFrom("src.spr")
|
|
221
|
+
.selectAll()
|
|
222
|
+
.where("is_current", "!=", 0)
|
|
223
|
+
.where("is_deprecated", "=", 0)
|
|
224
|
+
.where("country", "in", countries)
|
|
225
|
+
.where("placetype", "=", "postalcode"))
|
|
226
|
+
.onConflict((oc) => oc.doNothing())
|
|
227
|
+
.execute();
|
|
228
|
+
// 4. Pull names for the IDs we just selected.
|
|
229
|
+
progress("names", `${inputPath}: names rows for selected IDs`);
|
|
230
|
+
await kysely
|
|
231
|
+
.insertInto("names")
|
|
232
|
+
.expression((eb) => eb.selectFrom("src.names").selectAll().where("id", "in", eb.selectFrom("spr").select("id")))
|
|
233
|
+
.onConflict((oc) => oc.doNothing())
|
|
234
|
+
.execute();
|
|
235
|
+
// 5. Pull population rows for the selected IDs (sparse — only the places WOF has a count for).
|
|
236
|
+
if (srcHasPopulation) {
|
|
237
|
+
progress("place_population", `${inputPath}: population rows for selected IDs`);
|
|
208
238
|
await kysely
|
|
209
|
-
.insertInto("
|
|
210
|
-
.expression((eb) => eb
|
|
211
|
-
.selectFrom("src.spr as s")
|
|
212
|
-
.$if(srcHasPopulation, (qb) => qb.leftJoin("src.place_population as p", "p.id", "s.id"))
|
|
213
|
-
.selectAll("s")
|
|
214
|
-
.where("s.is_current", "!=", 0)
|
|
215
|
-
.where("s.is_deprecated", "=", 0)
|
|
216
|
-
.where("s.country", "in", countries)
|
|
217
|
-
.where("s.placetype", "=", "locality")
|
|
218
|
-
.orderBy(srcHasPopulation ? sql `COALESCE(p.population, 0)` : sql `s.id`, "desc")
|
|
219
|
-
.limit(topLocalities))
|
|
239
|
+
.insertInto("place_population")
|
|
240
|
+
.expression((eb) => eb.selectFrom("src.place_population").selectAll().where("id", "in", eb.selectFrom("spr").select("id")))
|
|
220
241
|
.onConflict((oc) => oc.doNothing())
|
|
221
242
|
.execute();
|
|
222
|
-
// 3. All postcodes in scope.
|
|
223
|
-
progress("postcode", `${inputPath}: all postcodes`);
|
|
224
|
-
await kysely
|
|
225
|
-
.insertInto("spr")
|
|
226
|
-
.expression((eb) => eb
|
|
227
|
-
.selectFrom("src.spr")
|
|
228
|
-
.selectAll()
|
|
229
|
-
.where("is_current", "!=", 0)
|
|
230
|
-
.where("is_deprecated", "=", 0)
|
|
231
|
-
.where("country", "in", countries)
|
|
232
|
-
.where("placetype", "=", "postalcode"))
|
|
233
|
-
.onConflict((oc) => oc.doNothing())
|
|
234
|
-
.execute();
|
|
235
|
-
// 4. Pull names for the IDs we just selected.
|
|
236
|
-
progress("names", `${inputPath}: names rows for selected IDs`);
|
|
237
|
-
await kysely
|
|
238
|
-
.insertInto("names")
|
|
239
|
-
.expression((eb) => eb.selectFrom("src.names").selectAll().where("id", "in", eb.selectFrom("spr").select("id")))
|
|
240
|
-
.onConflict((oc) => oc.doNothing())
|
|
241
|
-
.execute();
|
|
242
|
-
// 5. Pull population rows for the selected IDs (sparse — only the places WOF has a count for).
|
|
243
|
-
if (srcHasPopulation) {
|
|
244
|
-
progress("place_population", `${inputPath}: population rows for selected IDs`);
|
|
245
|
-
await kysely
|
|
246
|
-
.insertInto("place_population")
|
|
247
|
-
.expression((eb) => eb.selectFrom("src.place_population").selectAll().where("id", "in", eb.selectFrom("spr").select("id")))
|
|
248
|
-
.onConflict((oc) => oc.doNothing())
|
|
249
|
-
.execute();
|
|
250
|
-
}
|
|
251
|
-
// 6. Carry the coincident_roles relation (#402) when this source has it (the admin DB), so the
|
|
252
|
-
// slim/demo DB supports dual-role hierarchy completion (on by default). Filtered to surviving
|
|
253
|
-
// spr ids → no orphans. Tiny (~hundreds of rows). `ancestors` is intentionally NOT copied (huge
|
|
254
|
-
// + build-only), so we copy the derived table rather than rebuild it. Raw SQL — conditional +
|
|
255
|
-
// not in the Kysely build schema.
|
|
256
|
-
const relationSchema = out
|
|
257
|
-
.prepare(`SELECT sql FROM src.sqlite_master WHERE type = 'table' AND name = 'coincident_roles'`)
|
|
258
|
-
.get();
|
|
259
|
-
if (relationSchema?.sql) {
|
|
260
|
-
progress("coincident_roles", `${inputPath}: copying dual-role relation`);
|
|
261
|
-
out.exec(relationSchema.sql.replace(/CREATE TABLE/i, "CREATE TABLE IF NOT EXISTS"));
|
|
262
|
-
out.exec(`INSERT OR IGNORE INTO coincident_roles SELECT * FROM src.coincident_roles
|
|
263
|
-
WHERE admin_id IN (SELECT id FROM spr) AND locality_id IN (SELECT id FROM spr)`);
|
|
264
|
-
out.exec(`CREATE INDEX IF NOT EXISTS coincident_roles_by_admin ON coincident_roles (admin_id)`);
|
|
265
|
-
}
|
|
266
243
|
}
|
|
267
|
-
|
|
268
|
-
|
|
244
|
+
// 6. Carry the coincident_roles relation (#402) when this source has it (the admin DB), so the
|
|
245
|
+
// slim/demo DB supports dual-role hierarchy completion (on by default). Filtered to surviving
|
|
246
|
+
// spr ids → no orphans. Tiny (~hundreds of rows). `ancestors` is intentionally NOT copied (huge
|
|
247
|
+
// + build-only), so we copy the derived table rather than rebuild it. Raw SQL — conditional +
|
|
248
|
+
// not in the Kysely build schema.
|
|
249
|
+
const relationSchema = out
|
|
250
|
+
.prepare(`SELECT sql FROM src.sqlite_master WHERE type = 'table' AND name = 'coincident_roles'`)
|
|
251
|
+
.get();
|
|
252
|
+
if (relationSchema?.sql) {
|
|
253
|
+
progress("coincident_roles", `${inputPath}: copying dual-role relation`);
|
|
254
|
+
out.exec(relationSchema.sql.replace(/CREATE TABLE/i, "CREATE TABLE IF NOT EXISTS"));
|
|
255
|
+
out.exec(`INSERT OR IGNORE INTO coincident_roles SELECT * FROM src.coincident_roles
|
|
256
|
+
WHERE admin_id IN (SELECT id FROM spr) AND locality_id IN (SELECT id FROM spr)`);
|
|
257
|
+
out.exec(`CREATE INDEX IF NOT EXISTS coincident_roles_by_admin ON coincident_roles (admin_id)`);
|
|
269
258
|
}
|
|
270
259
|
}
|
|
271
260
|
finally {
|
|
272
|
-
|
|
261
|
+
out.exec(`DETACH DATABASE src;`);
|
|
273
262
|
}
|
|
274
263
|
}
|
|
275
|
-
function countRows(db, table) {
|
|
276
|
-
const row = db.prepare(`SELECT COUNT(*) AS n FROM ${table}`).get();
|
|
277
|
-
return Number(row?.n ?? 0);
|
|
278
|
-
}
|
|
279
264
|
//# sourceMappingURL=build-slim.js.map
|
package/out/build-slim.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-slim.js","sourceRoot":"","sources":["../build-slim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"build-slim.js","sourceRoot":"","sources":["../lib/build-slim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA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G,8FAA8F;QAC9F,kCAAkC;QAClC,MAAM,cAAc,GAAG,GAAG;aACxB,OAAO,CAAC,sFAAsF,CAAC;aAC/F,GAAG,EAAkC,CAAA;QAEvC,IAAI,cAAc,EAAE,GAAG,EAAE,CAAC;YACzB,QAAQ,CAAC,kBAAkB,EAAE,GAAG,SAAS,8BAA8B,CAAC,CAAA;YACxE,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,4BAA4B,CAAC,CAAC,CAAA;YAEnF,GAAG,CAAC,IAAI,CACP;oFACgF,CAChF,CAAA;YAED,GAAG,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAA;QAChG,CAAC;IACF,CAAC;YAAS,CAAC;QACV,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;IACjC,CAAC;AACF,CAAC"}
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
* @file Pass 2 of the candidate build — explode `place_search.alt_names` into distinct alias rows.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
7
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
8
|
+
import type { CandidateDatabase } from "#candidate-schema";
|
|
9
|
+
import type { PlaceAttrs, StageRow } from "#candidate/place-attrs";
|
|
10
|
+
import type { WOFDatabase } from "#schema";
|
|
9
11
|
/**
|
|
10
12
|
* Pass 2 — explode each place's `place_search.alt_names` bag into distinct-key alias rows (`is_primary = 0`), and count
|
|
11
13
|
* each place's distinct staged keys (primary included) — the gloss detector's key-count signal (#1730).
|
|
12
14
|
*/
|
|
13
|
-
export declare function explodeAliasBags(src:
|
|
15
|
+
export declare function explodeAliasBags(src: DatabaseClient<WOFDatabase>, out: DatabaseClient<CandidateDatabase>, attrs: Map<number, PlaceAttrs>, stageRow: StageRow): {
|
|
14
16
|
nAlias: number;
|
|
15
17
|
keyCounts: Map<number, number>;
|
|
16
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias-bags.d.ts","sourceRoot":"","sources":["../../candidate/alias-bags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"alias-bags.d.ts","sourceRoot":"","sources":["../../lib/candidate/alias-bags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAElE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,cAAc,CAAC,WAAW,CAAC,EAChC,GAAG,EAAE,cAAc,CAAC,iBAAiB,CAAC,EACtC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAC9B,QAAQ,EAAE,QAAQ,GAChB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CA+BpD"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
* @file Pass 2 of the candidate build — explode `place_search.alt_names` into distinct alias rows.
|
|
6
6
|
*/
|
|
7
|
-
import { ALIAS_SEPARATOR } from "
|
|
8
|
-
import { normalizeLocalityForKey } from "
|
|
7
|
+
import { ALIAS_SEPARATOR } from "#fts/index";
|
|
8
|
+
import { normalizeLocalityForKey } from "#street/normalize";
|
|
9
9
|
/**
|
|
10
10
|
* Pass 2 — explode each place's `place_search.alt_names` bag into distinct-key alias rows (`is_primary = 0`), and count
|
|
11
11
|
* each place's distinct staged keys (primary included) — the gloss detector's key-count signal (#1730).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alias-bags.js","sourceRoot":"","sources":["../../candidate/alias-bags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"alias-bags.js","sourceRoot":"","sources":["../../lib/candidate/alias-bags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC/B,GAAgC,EAChC,GAAsC,EACtC,KAA8B,EAC9B,QAAkB;IAElB,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAA;IAC3C,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAEjB,KAAK,MAAM,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACrF,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;QACrC,MAAM,GAAG,GAAG,CAAC,CAAC,SAA0B,CAAA;QAExC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG;YAAE,SAAQ;QACxB,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QAEtC,+FAA+F;QAC/F,+FAA+F;QAC/F,wDAAwD;QACxD,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;YAChD,MAAM,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;YAExC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;gBAAE,SAAQ;YAC/B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;YACX,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAA;YAEnC,MAAM,EAAE,CAAA;QACT,CAAC;QAED,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3C,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAElB,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -4,24 +4,23 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
* @file Pass 3b of the candidate build — the containment sidecar (closure rows + interval labels).
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
7
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
8
|
+
import type { CandidateDatabase } from "#candidate-schema";
|
|
9
|
+
import type { PlaceAttrs } from "#candidate/place-attrs";
|
|
10
|
+
import type { WOFDatabase } from "#schema";
|
|
11
11
|
/**
|
|
12
12
|
* Pass 3b — the ancestors sidecar: closure rows + interval labels (candidate-ancestors-schema.ts owns the encoding
|
|
13
13
|
* decision and the DAG/absence semantics). Reads the same source `ancestors` table the region stamp reads,
|
|
14
14
|
* denormalizing each edge with the parent's name/key from `attrs`, streamed `ORDER BY id` so the clustered `(spr_id,
|
|
15
15
|
* depth)` insert is sorted — the contiguous-leaves discipline of the candidate table itself.
|
|
16
16
|
*
|
|
17
|
-
* Excluded by policy: self rows, and placetypes outside the containment ladder (continent, empire, …: `placetypeDepth`
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Excluded by policy: self rows, and placetypes outside the containment ladder (continent, empire, …: `placetypeDepth` 0)
|
|
18
|
+
* — they discriminate nothing a consumer of this sidecar checks. An edge to a parent with no current `spr` row has no
|
|
19
|
+
* name to denormalize; it is dropped and counted rather than stored blind.
|
|
20
20
|
*/
|
|
21
21
|
export declare function buildAncestorsSidecar(ctx: {
|
|
22
|
-
src:
|
|
23
|
-
out:
|
|
24
|
-
kdb: DatabaseClient<CandidateDatabase>;
|
|
22
|
+
src: DatabaseClient<WOFDatabase>;
|
|
23
|
+
out: DatabaseClient<CandidateDatabase>;
|
|
25
24
|
attrs: Map<number, PlaceAttrs>;
|
|
26
25
|
ptID: (pt: string | null) => number;
|
|
27
26
|
progress: (phase: string, message: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ancestors-sidecar.d.ts","sourceRoot":"","sources":["../../candidate/ancestors-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ancestors-sidecar.d.ts","sourceRoot":"","sources":["../../lib/candidate/ancestors-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAW9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE;IAChD,GAAG,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;IAChC,GAAG,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IACtC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC9B,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAClD,GAAG,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,CAqKpF"}
|
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
* @file Pass 3b of the candidate build — the containment sidecar (closure rows + interval labels).
|
|
6
6
|
*/
|
|
7
|
-
import { placetypeDepth } from "
|
|
8
|
-
import { CANDIDATE_ANCESTOR_COLUMNS, CANDIDATE_ANCESTOR_TABLE, CANDIDATE_INTERVAL_TABLE, createCandidateAncestorTable, createCandidateIntervalTable, MAX_ANCESTOR_DEPTH, } from "
|
|
7
|
+
import { placetypeDepth } from "#ancestry/index";
|
|
8
|
+
import { CANDIDATE_ANCESTOR_COLUMNS, CANDIDATE_ANCESTOR_TABLE, CANDIDATE_INTERVAL_TABLE, createCandidateAncestorTable, createCandidateIntervalTable, MAX_ANCESTOR_DEPTH, } from "#candidate-ancestors-schema";
|
|
9
9
|
/**
|
|
10
10
|
* Pass 3b — the ancestors sidecar: closure rows + interval labels (candidate-ancestors-schema.ts owns the encoding
|
|
11
11
|
* decision and the DAG/absence semantics). Reads the same source `ancestors` table the region stamp reads,
|
|
12
12
|
* denormalizing each edge with the parent's name/key from `attrs`, streamed `ORDER BY id` so the clustered `(spr_id,
|
|
13
13
|
* depth)` insert is sorted — the contiguous-leaves discipline of the candidate table itself.
|
|
14
14
|
*
|
|
15
|
-
* Excluded by policy: self rows, and placetypes outside the containment ladder (continent, empire, …: `placetypeDepth`
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* Excluded by policy: self rows, and placetypes outside the containment ladder (continent, empire, …: `placetypeDepth` 0)
|
|
16
|
+
* — they discriminate nothing a consumer of this sidecar checks. An edge to a parent with no current `spr` row has no
|
|
17
|
+
* name to denormalize; it is dropped and counted rather than stored blind.
|
|
18
18
|
*/
|
|
19
19
|
export async function buildAncestorsSidecar(ctx) {
|
|
20
20
|
const { src, out, attrs, ptID, progress } = ctx;
|
|
21
21
|
progress("ancestors", "building containment sidecar (closure rows + interval labels)");
|
|
22
|
-
await createCandidateAncestorTable(ctx.
|
|
23
|
-
await createCandidateIntervalTable(ctx.
|
|
22
|
+
await createCandidateAncestorTable(ctx.out);
|
|
23
|
+
await createCandidateIntervalTable(ctx.out);
|
|
24
24
|
const insAncestor = out.prepare(`INSERT INTO ${CANDIDATE_ANCESTOR_TABLE} VALUES (${CANDIDATE_ANCESTOR_COLUMNS.map(() => "?").join(", ")})`);
|
|
25
25
|
// The canonical-parent forest the interval labels are computed over. One parent per place — the
|
|
26
26
|
// depth-1 edge (finest containment tier, lowest ancestor id; the `regionOf` MIN-stability
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ancestors-sidecar.js","sourceRoot":"","sources":["../../candidate/ancestors-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"ancestors-sidecar.js","sourceRoot":"","sources":["../../lib/candidate/ancestors-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EACN,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,kBAAkB,GAClB,MAAM,6BAA6B,CAAA;AAKpC;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,GAM3C;IACA,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAA;IAE/C,QAAQ,CAAC,WAAW,EAAE,+DAA+D,CAAC,CAAA;IACtF,MAAM,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAC3C,MAAM,4BAA4B,CAAC,GAAG,CAAC,GAAG,CAAC,C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AAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAEjB,KAAK,MAAM,EAAE,IAAI,OAAO,EAAE,CAAC;QAC1B,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAE,EAAE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAE,CAAC,CAAA;IACrD,CAAC;IAED,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAElB,QAAQ,CACP,WAAW,EACX,GAAG,YAAY,CAAC,cAAc,EAAE,wBAAwB,cAAc,CAAC,cAAc,EAAE,WAAW;QACjG,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,EAAE,kBAAkB;QAChD,CAAC,cAAc,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,cAAc,EAAE,gDAAgD,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5G,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,cAAc,EAAE,0CAA0C,CAAC,CAAC,CAAC,EAAE,CAAC,CACnG,CAAA;IAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;AACpE,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
* @file Pass 1b of the candidate build — fold ICU's country display names onto the country rows.
|
|
6
6
|
*/
|
|
7
|
-
import type { PlaceAttrs, StageRow } from "
|
|
7
|
+
import type { PlaceAttrs, StageRow } from "#candidate/place-attrs";
|
|
8
8
|
/**
|
|
9
9
|
* Fold every country surface ICU knows onto that country's candidate row (#1678 thread 1).
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country-display-names.d.ts","sourceRoot":"","sources":["../../candidate/country-display-names.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"country-display-names.d.ts","sourceRoot":"","sources":["../../lib/candidate/country-display-names.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAGlE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE;IAC7C,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC9B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,QAAQ,CAAA;IAClB,EAAE,EAAE;QAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CAC/B,GAAG,MAAM,CA0CT"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @file Pass 1b of the candidate build — fold ICU's country display names onto the country rows.
|
|
6
6
|
*/
|
|
7
7
|
import { enumerateCountryDisplayNames } from "@mailwoman/codex/country";
|
|
8
|
-
import { normalizeLocalityForKey } from "
|
|
8
|
+
import { normalizeLocalityForKey } from "#street/normalize";
|
|
9
9
|
/**
|
|
10
10
|
* Fold every country surface ICU knows onto that country's candidate row (#1678 thread 1).
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"country-display-names.js","sourceRoot":"","sources":["../../candidate/country-display-names.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"country-display-names.js","sourceRoot":"","sources":["../../lib/candidate/country-display-names.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAA;AAGvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,wBAAwB,CAA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;QAExC,MAAM,EAAE,CAAA;IACT,CAAC;IAED,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAErB,OAAO,MAAM,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
* @file Pass 4 of the candidate build — fold a postcode or locality extract into the staging table.
|
|
6
|
+
*/
|
|
7
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
8
|
+
import type { CandidateDatabase } from "#candidate-schema";
|
|
9
|
+
import type { StageRow } from "#candidate/place-attrs";
|
|
10
|
+
/**
|
|
11
|
+
* Fold ONE extract (`spr` rows at `extractPlacetype` carrying real coordinates) in, then pass 4b: the alias names
|
|
12
|
+
* hanging off that same extract's `names` table.
|
|
13
|
+
*
|
|
14
|
+
* Self-contained by construction — it shares only the staging statement and the code dictionaries with the admin passes
|
|
15
|
+
* above it, and nothing downstream reads anything it produces except the two counters it returns.
|
|
16
|
+
*/
|
|
17
|
+
export declare function foldExtract(ctx: {
|
|
18
|
+
/**
|
|
19
|
+
* The staging connection. The extract itself is opened read-only here and closed before returning.
|
|
20
|
+
*/
|
|
21
|
+
out: DatabaseClient<CandidateDatabase>;
|
|
22
|
+
extractPath: string;
|
|
23
|
+
extractPlacetype: "postalcode" | "locality";
|
|
24
|
+
ccID: (code: string | null) => number;
|
|
25
|
+
ptID: (pt: string | null) => number;
|
|
26
|
+
stageRow: StageRow;
|
|
27
|
+
progress: (phase: string, message: string) => void;
|
|
28
|
+
}): {
|
|
29
|
+
primaries: number;
|
|
30
|
+
aliases: number;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=extract-fold.d.ts.map
|