@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/geonames/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA"}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* #920 — fold GeoNames POSTAL codes into a WOF/unified postcode
|
|
6
|
+
* #920 — fold GeoNames POSTAL codes into a WOF/unified postcode extract as first-class
|
|
7
7
|
* `postalcode` places, for the countries whose WOF postalcode repos don't exist (the
|
|
8
8
|
* namesake-tail locales: FI/CZ/SK/SI/DK/NO/HR/PL and any future gap).
|
|
9
9
|
*
|
|
10
10
|
* Why: the night-31 taxonomy measured the cross-locale resolve tail as NAMESAKE COLLISION
|
|
11
|
-
* (FI 300/1k … PL 75/1k offender rows), and the controlled experiment showed postcode-
|
|
11
|
+
* (FI 300/1k … PL 75/1k offender rows), and the controlled experiment showed postcode-extract
|
|
12
12
|
* coverage alone collapses it (FI 300→1, CZ 131→4): a resolvable postcode node feeds the
|
|
13
13
|
* resolver's coordinate-first sibling-postcode candidate injection, which binds the locality
|
|
14
|
-
* pick to its postcode neighborhood. The
|
|
14
|
+
* pick to its postcode neighborhood. The implementation already ships; it was coverage-starved.
|
|
15
15
|
*
|
|
16
16
|
* Two hard-won laws from the experiment are enforced HERE, in code, not in a runbook:
|
|
17
17
|
*
|
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
* --geonames-postal-countries`, any standalone fold, and the `mailwoman gazetteer` commands
|
|
31
31
|
* share ONE implementation. GeoNames postal dump = `download.geonames.org/export/zip/<CC>.zip`
|
|
32
32
|
* → `<CC>.txt` (TSV: country, postcode, place, admin1, code1, admin2, code2, admin3, code3,
|
|
33
|
-
* lat, lon, accuracy). License CC BY 4.0 — attribution rides the
|
|
33
|
+
* lat, lon, accuracy). License CC BY 4.0 — attribution rides the extract's `meta` provenance and
|
|
34
34
|
* the model card like the existing GeoNames alias fold.
|
|
35
35
|
*/
|
|
36
|
-
import type {
|
|
36
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
37
|
+
import { type PathBuilderLike } from "path-ts";
|
|
38
|
+
import type { WOFDatabase } from "#schema";
|
|
37
39
|
/**
|
|
38
40
|
* Synthetic id base for GeoNames-POSTAL rows — its own namespace above the alias fold's {@link GEONAMES_ID_BASE} (9e12)
|
|
39
41
|
* allocation so all four sources (WOF, Overture, GeoNames-alias, GeoNames-postal) coexist collision-free in a combined
|
|
@@ -60,7 +62,7 @@ export type PostcodePoint = readonly [number, number];
|
|
|
60
62
|
*
|
|
61
63
|
* Distance is squared-Euclidean in DEGREES, not haversine. At the scale a postcode spans, the ranking the two produce
|
|
62
64
|
* is the same, and this one carries no trig into a per-group inner loop. Ties go to the earliest member, which makes
|
|
63
|
-
* the result a pure function of the input order — the property a rebuilt
|
|
65
|
+
* the result a pure function of the input order — the property a rebuilt extract's ids depend on.
|
|
64
66
|
*
|
|
65
67
|
* Exported (rather than inlined at each ingest) because it is the second half of the #920 pair: every postcode source
|
|
66
68
|
* that groups member points — GeoNames postal, OSM `addr:postcode` — owes the same law, and a second hand-rolled copy
|
|
@@ -87,5 +89,5 @@ export interface GeonamesPostalIngestResult {
|
|
|
87
89
|
* the display form as an extra `names` row when it differs. The caller owns the FTS rebuild (rows ride the standard
|
|
88
90
|
* freeze phase).
|
|
89
91
|
*/
|
|
90
|
-
export declare function ingestGeonamesPostal(db:
|
|
91
|
-
//# sourceMappingURL=
|
|
92
|
+
export declare function ingestGeonamesPostal(db: DatabaseClient<WOFDatabase>, countries: readonly string[], postalDir: PathBuilderLike): Promise<GeonamesPostalIngestResult>;
|
|
93
|
+
//# sourceMappingURL=postal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postal.d.ts","sourceRoot":"","sources":["../../lib/geonames/postal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAQ,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAGpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAQ1C;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,gBAAoB,CAAA;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAErD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,aAAa,CA+B3E;AAED,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAA;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,cAAc,CAAC,WAAW,CAAC,EAC/B,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,SAAS,EAAE,eAAe,GACxB,OAAO,CAAC,0BAA0B,CAAC,CAsErC"}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* #920 — fold GeoNames POSTAL codes into a WOF/unified postcode
|
|
6
|
+
* #920 — fold GeoNames POSTAL codes into a WOF/unified postcode extract as first-class
|
|
7
7
|
* `postalcode` places, for the countries whose WOF postalcode repos don't exist (the
|
|
8
8
|
* namesake-tail locales: FI/CZ/SK/SI/DK/NO/HR/PL and any future gap).
|
|
9
9
|
*
|
|
10
10
|
* Why: the night-31 taxonomy measured the cross-locale resolve tail as NAMESAKE COLLISION
|
|
11
|
-
* (FI 300/1k … PL 75/1k offender rows), and the controlled experiment showed postcode-
|
|
11
|
+
* (FI 300/1k … PL 75/1k offender rows), and the controlled experiment showed postcode-extract
|
|
12
12
|
* coverage alone collapses it (FI 300→1, CZ 131→4): a resolvable postcode node feeds the
|
|
13
13
|
* resolver's coordinate-first sibling-postcode candidate injection, which binds the locality
|
|
14
|
-
* pick to its postcode neighborhood. The
|
|
14
|
+
* pick to its postcode neighborhood. The implementation already ships; it was coverage-starved.
|
|
15
15
|
*
|
|
16
16
|
* Two hard-won laws from the experiment are enforced HERE, in code, not in a runbook:
|
|
17
17
|
*
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
* --geonames-postal-countries`, any standalone fold, and the `mailwoman gazetteer` commands
|
|
31
31
|
* share ONE implementation. GeoNames postal dump = `download.geonames.org/export/zip/<CC>.zip`
|
|
32
32
|
* → `<CC>.txt` (TSV: country, postcode, place, admin1, code1, admin2, code2, admin3, code3,
|
|
33
|
-
* lat, lon, accuracy). License CC BY 4.0 — attribution rides the
|
|
33
|
+
* lat, lon, accuracy). License CC BY 4.0 — attribution rides the extract's `meta` provenance and
|
|
34
34
|
* the model card like the existing GeoNames alias fold.
|
|
35
35
|
*/
|
|
36
|
-
import {
|
|
36
|
+
import { pathExists } from "@mailwoman/core/fs/readers";
|
|
37
37
|
import { join } from "path-ts";
|
|
38
38
|
import { TSVSpliterator } from "spliterator";
|
|
39
39
|
/**
|
|
@@ -65,7 +65,7 @@ export function normalizePostcodeName(raw) {
|
|
|
65
65
|
*
|
|
66
66
|
* Distance is squared-Euclidean in DEGREES, not haversine. At the scale a postcode spans, the ranking the two produce
|
|
67
67
|
* is the same, and this one carries no trig into a per-group inner loop. Ties go to the earliest member, which makes
|
|
68
|
-
* the result a pure function of the input order — the property a rebuilt
|
|
68
|
+
* the result a pure function of the input order — the property a rebuilt extract's ids depend on.
|
|
69
69
|
*
|
|
70
70
|
* Exported (rather than inlined at each ingest) because it is the second half of the #920 pair: every postcode source
|
|
71
71
|
* that groups member points — GeoNames postal, OSM `addr:postcode` — owes the same law, and a second hand-rolled copy
|
|
@@ -112,7 +112,7 @@ export async function ingestGeonamesPostal(db, countries, postalDir) {
|
|
|
112
112
|
for (const country of countries) {
|
|
113
113
|
const cc = country.toUpperCase();
|
|
114
114
|
const file = join(postalDir, `${cc}.txt`);
|
|
115
|
-
if (!
|
|
115
|
+
if (!(await pathExists(file))) {
|
|
116
116
|
missing.push(cc);
|
|
117
117
|
console.error(` GeoNames postal ${cc}: ${file} missing — download from download.geonames.org/export/zip/${cc}.zip; skipped`);
|
|
118
118
|
continue;
|
|
@@ -120,7 +120,7 @@ export async function ingestGeonamesPostal(db, countries, postalDir) {
|
|
|
120
120
|
// Group member settlement points per NORMALIZED code; remember one display form.
|
|
121
121
|
const members = new Map();
|
|
122
122
|
// Streamed: a national dump is a caller-supplied size — GB's is 177 MB, and only the caller
|
|
123
|
-
// knows which country is next. `header: false` is
|
|
123
|
+
// knows which country is next. `header: false` is required; the GeoNames postal dump is
|
|
124
124
|
// headerless, so row 1 would be consumed as column names and its postcode lost.
|
|
125
125
|
for await (const cols of TSVSpliterator.fromAsync(file, { header: false })) {
|
|
126
126
|
if (cols.length < GEONAMES_POSTAL_COLUMNS)
|
|
@@ -153,4 +153,4 @@ export async function ingestGeonamesPostal(db, countries, postalDir) {
|
|
|
153
153
|
}
|
|
154
154
|
return { inserted, byCountry, missing };
|
|
155
155
|
}
|
|
156
|
-
//# sourceMappingURL=
|
|
156
|
+
//# sourceMappingURL=postal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postal.js","sourceRoot":"","sources":["../../lib/geonames/postal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAEvD,OAAO,EAAE,IAAI,EAAwB,MAAM,SAAS,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAI5C;;;GAGG;AACH,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAElC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CAAA;AAExD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAChD,OAAO,GAAG,CAAC,UAAU,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAA;AAC7C,CAAC;AAOD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,WAAW,CAAC,MAAgC;IAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;IAEvB,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;IAE5D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAErC,IAAI,MAAM,GAAG,CAAC,CAAA;IACd,IAAI,MAAM,GAAG,CAAC,CAAA;IAEd,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACxB,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;QACd,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IACf,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;IACtC,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAA;IAEtC,I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ACnB,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;YACjF,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;YAE7B,IAAI,CAAC,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;gBACxB,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;YACnC,CAAC;YAED,QAAQ,EAAE,CAAA;QACX,CAAC;QAED,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACjB,SAAS,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAA;QAE5B,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,oCAAoC,CAAC,CAAA;IAC7G,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;AACxC,CAAC"}
|
package/out/index.d.ts
CHANGED
|
@@ -3,36 +3,36 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*/
|
|
6
|
-
export type { FindPlaceQuery, GeoBbox, GeoPoint, PlaceCandidate, PlaceLookup, WOFPlacetype } from "
|
|
7
|
-
export type { AncestorsTable, CoincidentRolesTable, ConcordancesTable, GeojsonTable, NamesTable, PlaceAbbrTable, PlacePopulationTable, PlaceSearchTable, SprTable, WOFDatabase, } from "
|
|
8
|
-
export { WOFSQLitePlaceLookup, type RankingWeights, type WOFSQLitePlaceLookupOpts } from "
|
|
9
|
-
export { CANDIDATE_ANCESTOR_COLUMNS, CANDIDATE_ANCESTOR_TABLE, CANDIDATE_INTERVAL_TABLE, createCandidateAncestorTable, createCandidateIntervalTable, intervalContains, MAX_ANCESTOR_DEPTH, } from "
|
|
10
|
-
export type { CandidateAncestorsDatabase, CandidateAncestorTable, CandidateIntervalTable, IntervalLabel, } from "
|
|
11
|
-
export { CANDIDATE_FTS_TABLE, createCandidateFTS } from "
|
|
12
|
-
export { ImportanceIndex,
|
|
13
|
-
export { WOFCandidateTableLookup, type WOFCandidateTableLookupOpts } from "
|
|
14
|
-
export { COUNTRY_BBOX_TABLE, COUNTRY_COVERAGE_TABLE, createCountryBBoxTable, createCountryCoverageTable, readGazetteerCoverageManifest, writeGazetteerCoverageManifest, } from "
|
|
15
|
-
export type { CountryBBoxTable, CountryCoverageTable, GazetteerCoverageDatabase } from "
|
|
16
|
-
export { SQLiteStreetNameLookup, type SQLiteStreetNameLookupOpts } from "
|
|
17
|
-
export { GEONAMES_ID_BASE, type GeonamesIngestProgress, ingestGeonamesAliases, purgeGeonamesAliasRange, } from "
|
|
18
|
-
export { GEONAMES_POSTAL_ID_BASE } from "
|
|
19
|
-
export { ADDRESS_POINT_COLUMNS, createAddressPointIndexes, createAddressPointTable } from "
|
|
20
|
-
export type { AddressPointDatabase, AddressPointTable } from "
|
|
21
|
-
export { WOFPostalCityAliasLookup, type PostalCityAlias, type WOFPostalCityAliasLookupOpts, } from "
|
|
22
|
-
export type { PostalCityAliasDatabase, PostalCityAliasTable } from "
|
|
23
|
-
export { POSTAL_CITY_CANDIDATE_COLUMNS, POSTAL_CITY_CANDIDATE_TABLE, createPostalCityCandidateTable, } from "
|
|
24
|
-
export type { PostalCityCandidateDatabase, PostalCityCandidateTable } from "
|
|
25
|
-
export { ADDRESS_CONVENTION_TABLE, BUILTIN_STRATEGY_NAMES, SeedConventionSource, WORLD_DEFAULT, mergeConventions, resolveConvention, type Convention, type ConventionSource, type ResolvedConvention, type ScoringWeights, type Strategy, } from "
|
|
26
|
-
export { SqliteConventionSource } from "
|
|
27
|
-
export { WOFPostcodeLookup, type PostcodePlace } from "
|
|
28
|
-
export { PLACE_BBOX_TABLE, PLACE_SEARCH_TABLE, buildPlaceSearchFTS, placeBboxExists, placeSearchFTSExists, type BuildPlaceSearchFTSOpts, type BuildPlaceSearchFTSResult, } from "
|
|
29
|
-
export { PLACETYPE_DEPTH, ancestorLineage, placetypeDepth, type AncestorPlaceRow } from "
|
|
30
|
-
export { WOFReverseGeocoder, type ContainmentKind, type ReverseGeocodeOpts, type ReverseGeocodeResult, type WOFReverseGeocoderOpts, } from "
|
|
31
|
-
export { AddressPointInterpolator } from "
|
|
32
|
-
export { AddressPointSqliteLookup } from "
|
|
33
|
-
export { STREET_CENTROID_COLUMNS, createStreetCentroidIndexes, createStreetCentroidTable, } from "
|
|
34
|
-
export type { StreetCentroidDatabase, StreetCentroidTable } from "
|
|
35
|
-
export { StreetCentroidSqliteLookup } from "
|
|
36
|
-
export { StreetInterpolator, type InterpolatedHit, type InterpolationMethod, type InterpolationQuery, } from "
|
|
37
|
-
export { deriveSchemaName,
|
|
6
|
+
export type { FindPlaceQuery, GeoBbox, GeoPoint, PlaceCandidate, PlaceLookup, WOFPlacetype } from "#types";
|
|
7
|
+
export type { AncestorsTable, CoincidentRolesTable, ConcordancesTable, GeojsonTable, NamesTable, PlaceAbbrTable, PlacePopulationTable, PlaceSearchTable, SprTable, WOFDatabase, } from "#schema";
|
|
8
|
+
export { WOFSQLitePlaceLookup, type RankingWeights, type WOFSQLitePlaceLookupOpts } from "#lookup";
|
|
9
|
+
export { CANDIDATE_ANCESTOR_COLUMNS, CANDIDATE_ANCESTOR_TABLE, CANDIDATE_INTERVAL_TABLE, createCandidateAncestorTable, createCandidateIntervalTable, intervalContains, MAX_ANCESTOR_DEPTH, } from "#candidate-ancestors-schema";
|
|
10
|
+
export type { CandidateAncestorsDatabase, CandidateAncestorTable, CandidateIntervalTable, IntervalLabel, } from "#candidate-ancestors-schema";
|
|
11
|
+
export { CANDIDATE_FTS_TABLE, createCandidateFTS } from "#candidate-fts";
|
|
12
|
+
export { ImportanceIndex, IMPORTANCE_JOIN_RADIUS_KM, type ImportanceIndexStats, loadImportanceIndex, } from "#candidate-importance";
|
|
13
|
+
export { WOFCandidateTableLookup, type WOFCandidateTableLookupOpts } from "#candidate-lookup";
|
|
14
|
+
export { COUNTRY_BBOX_TABLE, COUNTRY_COVERAGE_TABLE, createCountryBBoxTable, createCountryCoverageTable, readGazetteerCoverageManifest, writeGazetteerCoverageManifest, } from "#coverage-manifest-schema";
|
|
15
|
+
export type { CountryBBoxTable, CountryCoverageTable, GazetteerCoverageDatabase } from "#coverage-manifest-schema";
|
|
16
|
+
export { SQLiteStreetNameLookup, type SQLiteStreetNameLookupOpts } from "#street/name-lookup";
|
|
17
|
+
export { GEONAMES_ID_BASE, type GeonamesIngestProgress, ingestGeonamesAliases, purgeGeonamesAliasRange, } from "#geonames/aliases";
|
|
18
|
+
export { GEONAMES_POSTAL_ID_BASE } from "#geonames/postal";
|
|
19
|
+
export { ADDRESS_POINT_COLUMNS, createAddressPointIndexes, createAddressPointTable } from "#address/point-schema";
|
|
20
|
+
export type { AddressPointDatabase, AddressPointTable } from "#address/point-schema";
|
|
21
|
+
export { WOFPostalCityAliasLookup, type PostalCityAlias, type WOFPostalCityAliasLookupOpts, } from "#postal/city-alias-lookup";
|
|
22
|
+
export type { PostalCityAliasDatabase, PostalCityAliasTable } from "#postal/city-alias-schema";
|
|
23
|
+
export { POSTAL_CITY_CANDIDATE_COLUMNS, POSTAL_CITY_CANDIDATE_TABLE, createPostalCityCandidateTable, } from "#postal/city-candidate-schema";
|
|
24
|
+
export type { PostalCityCandidateDatabase, PostalCityCandidateTable } from "#postal/city-candidate-schema";
|
|
25
|
+
export { ADDRESS_CONVENTION_TABLE, BUILTIN_STRATEGY_NAMES, SeedConventionSource, WORLD_DEFAULT, mergeConventions, resolveConvention, type Convention, type ConventionSource, type ResolvedConvention, type ScoringWeights, type Strategy, } from "#convention/index";
|
|
26
|
+
export { SqliteConventionSource } from "#sqlite-convention-source";
|
|
27
|
+
export { WOFPostcodeLookup, type PostcodePlace } from "#postcode-point-lookup";
|
|
28
|
+
export { PLACE_BBOX_TABLE, PLACE_SEARCH_TABLE, buildPlaceSearchFTS, placeBboxExists, placeSearchFTSExists, type BuildPlaceSearchFTSOpts, type BuildPlaceSearchFTSResult, } from "#fts/index";
|
|
29
|
+
export { PLACETYPE_DEPTH, ancestorLineage, placetypeDepth, type AncestorPlaceRow } from "#ancestry/index";
|
|
30
|
+
export { WOFReverseGeocoder, type ContainmentKind, type ReverseGeocodeOpts, type ReverseGeocodeResult, type WOFReverseGeocoderOpts, } from "#reverse";
|
|
31
|
+
export { AddressPointInterpolator } from "#address/point-interpolation";
|
|
32
|
+
export { AddressPointSqliteLookup } from "#address/point";
|
|
33
|
+
export { STREET_CENTROID_COLUMNS, createStreetCentroidIndexes, createStreetCentroidTable, } from "#street/centroid-schema";
|
|
34
|
+
export type { StreetCentroidDatabase, StreetCentroidTable } from "#street/centroid-schema";
|
|
35
|
+
export { StreetCentroidSqliteLookup } from "#street/centroid";
|
|
36
|
+
export { StreetInterpolator, type InterpolatedHit, type InterpolationMethod, type InterpolationQuery, } from "#interpolation";
|
|
37
|
+
export { deriveSchemaName, pickExtractForPlacetype, resolveExtracts, type ResolvedExtract, type ExtractConfig, } from "#extracts";
|
|
38
38
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,cAAc,EA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E,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,OAAO,EACN,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,GACzB,MAAM,yBAAyB,CAAA;AAEhC,YAAY,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAE7D,OAAO,EACN,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACvB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,aAAa,GAClB,MAAM,WAAW,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -3,28 +3,28 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*/
|
|
6
|
-
export { WOFSQLitePlaceLookup } from "
|
|
7
|
-
export { CANDIDATE_ANCESTOR_COLUMNS, CANDIDATE_ANCESTOR_TABLE, CANDIDATE_INTERVAL_TABLE, createCandidateAncestorTable, createCandidateIntervalTable, intervalContains, MAX_ANCESTOR_DEPTH, } from "
|
|
8
|
-
export { CANDIDATE_FTS_TABLE, createCandidateFTS } from "
|
|
9
|
-
export { ImportanceIndex,
|
|
10
|
-
export { WOFCandidateTableLookup } from "
|
|
11
|
-
export { COUNTRY_BBOX_TABLE, COUNTRY_COVERAGE_TABLE, createCountryBBoxTable, createCountryCoverageTable, readGazetteerCoverageManifest, writeGazetteerCoverageManifest, } from "
|
|
12
|
-
export { SQLiteStreetNameLookup } from "
|
|
13
|
-
export { GEONAMES_ID_BASE, ingestGeonamesAliases, purgeGeonamesAliasRange, } from "
|
|
14
|
-
export { GEONAMES_POSTAL_ID_BASE } from "
|
|
15
|
-
export { ADDRESS_POINT_COLUMNS, createAddressPointIndexes, createAddressPointTable } from "
|
|
16
|
-
export { WOFPostalCityAliasLookup, } from "
|
|
17
|
-
export { POSTAL_CITY_CANDIDATE_COLUMNS, POSTAL_CITY_CANDIDATE_TABLE, createPostalCityCandidateTable, } from "
|
|
18
|
-
export { ADDRESS_CONVENTION_TABLE, BUILTIN_STRATEGY_NAMES, SeedConventionSource, WORLD_DEFAULT, mergeConventions, resolveConvention, } from "
|
|
19
|
-
export { SqliteConventionSource } from "
|
|
20
|
-
export { WOFPostcodeLookup } from "
|
|
21
|
-
export { PLACE_BBOX_TABLE, PLACE_SEARCH_TABLE, buildPlaceSearchFTS, placeBboxExists, placeSearchFTSExists, } from "
|
|
22
|
-
export { PLACETYPE_DEPTH, ancestorLineage, placetypeDepth } from "
|
|
23
|
-
export { WOFReverseGeocoder, } from "
|
|
24
|
-
export { AddressPointInterpolator } from "
|
|
25
|
-
export { AddressPointSqliteLookup } from "
|
|
26
|
-
export { STREET_CENTROID_COLUMNS, createStreetCentroidIndexes, createStreetCentroidTable, } from "
|
|
27
|
-
export { StreetCentroidSqliteLookup } from "
|
|
28
|
-
export { StreetInterpolator, } from "
|
|
29
|
-
export { deriveSchemaName,
|
|
6
|
+
export { WOFSQLitePlaceLookup } from "#lookup";
|
|
7
|
+
export { CANDIDATE_ANCESTOR_COLUMNS, CANDIDATE_ANCESTOR_TABLE, CANDIDATE_INTERVAL_TABLE, createCandidateAncestorTable, createCandidateIntervalTable, intervalContains, MAX_ANCESTOR_DEPTH, } from "#candidate-ancestors-schema";
|
|
8
|
+
export { CANDIDATE_FTS_TABLE, createCandidateFTS } from "#candidate-fts";
|
|
9
|
+
export { ImportanceIndex, IMPORTANCE_JOIN_RADIUS_KM, loadImportanceIndex, } from "#candidate-importance";
|
|
10
|
+
export { WOFCandidateTableLookup } from "#candidate-lookup";
|
|
11
|
+
export { COUNTRY_BBOX_TABLE, COUNTRY_COVERAGE_TABLE, createCountryBBoxTable, createCountryCoverageTable, readGazetteerCoverageManifest, writeGazetteerCoverageManifest, } from "#coverage-manifest-schema";
|
|
12
|
+
export { SQLiteStreetNameLookup } from "#street/name-lookup";
|
|
13
|
+
export { GEONAMES_ID_BASE, ingestGeonamesAliases, purgeGeonamesAliasRange, } from "#geonames/aliases";
|
|
14
|
+
export { GEONAMES_POSTAL_ID_BASE } from "#geonames/postal";
|
|
15
|
+
export { ADDRESS_POINT_COLUMNS, createAddressPointIndexes, createAddressPointTable } from "#address/point-schema";
|
|
16
|
+
export { WOFPostalCityAliasLookup, } from "#postal/city-alias-lookup";
|
|
17
|
+
export { POSTAL_CITY_CANDIDATE_COLUMNS, POSTAL_CITY_CANDIDATE_TABLE, createPostalCityCandidateTable, } from "#postal/city-candidate-schema";
|
|
18
|
+
export { ADDRESS_CONVENTION_TABLE, BUILTIN_STRATEGY_NAMES, SeedConventionSource, WORLD_DEFAULT, mergeConventions, resolveConvention, } from "#convention/index";
|
|
19
|
+
export { SqliteConventionSource } from "#sqlite-convention-source";
|
|
20
|
+
export { WOFPostcodeLookup } from "#postcode-point-lookup";
|
|
21
|
+
export { PLACE_BBOX_TABLE, PLACE_SEARCH_TABLE, buildPlaceSearchFTS, placeBboxExists, placeSearchFTSExists, } from "#fts/index";
|
|
22
|
+
export { PLACETYPE_DEPTH, ancestorLineage, placetypeDepth } from "#ancestry/index";
|
|
23
|
+
export { WOFReverseGeocoder, } from "#reverse";
|
|
24
|
+
export { AddressPointInterpolator } from "#address/point-interpolation";
|
|
25
|
+
export { AddressPointSqliteLookup } from "#address/point";
|
|
26
|
+
export { STREET_CENTROID_COLUMNS, createStreetCentroidIndexes, createStreetCentroidTable, } from "#street/centroid-schema";
|
|
27
|
+
export { StreetCentroidSqliteLookup } from "#street/centroid";
|
|
28
|
+
export { StreetInterpolator, } from "#interpolation";
|
|
29
|
+
export { deriveSchemaName, pickExtractForPlacetype, resolveExtracts, } from "#extracts";
|
|
30
30
|
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,EAAE,oBAAoB,EAAsD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,OAAO,EAAE,oBAAoB,EAAsD,MAAM,SAAS,CAAA;AAElG,OAAO,EACN,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,6BAA6B,CAAA;AASpC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAExE,OAAO,EACN,eAAe,EACf,yBAAyB,EAEzB,mBAAmB,GACnB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EAAE,uBAAuB,EAAoC,MAAM,mBAAmB,CAAA;AAE7F,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,GAC9B,MAAM,2BAA2B,CAAA;AAGlC,OAAO,EAAE,sBAAsB,EAAmC,MAAM,qBAAqB,CAAA;AAE7F,OAAO,EACN,gBAAgB,EAEhB,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE1D,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAGjH,OAAO,EACN,wBAAwB,GAGxB,MAAM,2BAA2B,CAAA;AAIlC,OAAO,EACN,6BAA6B,EAC7B,2BAA2B,EAC3B,8BAA8B,GAC9B,MAAM,+BAA+B,CAAA;AAItC,OAAO,EACN,wBAAwB,EACxB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAMjB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAElE,OAAO,EAAE,iBAAiB,EAAsB,MAAM,wBAAwB,CAAA;AAE9E,OAAO,EACN,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,GAGpB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,cAAc,EAAyB,MAAM,iBAAiB,CAAA;AAEzG,OAAO,EACN,kBAAkB,GAKlB,MAAM,UAAU,CAAA;AAEjB,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,OAAO,EACN,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,GACzB,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAA;AAE7D,OAAO,EACN,kBAAkB,GAIlB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EACN,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,GAGf,MAAM,WAAW,CAAA"}
|
package/out/interpolation.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* then linear interpolation along the segment polyline. Design:
|
|
9
9
|
* `docs/articles/plan/2026-06-11-interpolation-design.md`.
|
|
10
10
|
*
|
|
11
|
-
* Reads the per-state
|
|
11
|
+
* Reads the per-state extract built by `scripts/build-interpolation-extract.ts` (`street_segment`: one
|
|
12
12
|
* row per TIGER edge SIDE — independent left/right ranges, ZIPs, parity). Query-side
|
|
13
13
|
* normalization is THE shared normalizer (`street-normalize.ts`) — identical to build-side, by
|
|
14
14
|
* construction.
|
|
@@ -25,12 +25,13 @@
|
|
|
25
25
|
* exact-point fall-through) is a noted follow-up on #483, so the `find()` shape mirrors
|
|
26
26
|
* `AddressPointLookup.find()` to keep that wiring mechanical.
|
|
27
27
|
*/
|
|
28
|
-
import { DatabaseSync } from "node:sqlite";
|
|
29
28
|
import type { InterpolationLookup } from "@mailwoman/resolver";
|
|
29
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
30
|
+
import type { StreetSegmentDatabase } from "#street/segment-schema";
|
|
30
31
|
/**
|
|
31
32
|
* How an interpolated answer was computed (#483 Method 2):
|
|
32
33
|
*
|
|
33
|
-
* - `address_point` — bracketed/extrapolated between REAL neighbor points from the #476
|
|
34
|
+
* - `address_point` — bracketed/extrapolated between REAL neighbor points from the #476 extract
|
|
34
35
|
* (`AddressPointInterpolator`), replacing TIGER's uniform-spacing assumption with occupancy.
|
|
35
36
|
* - `tiger_range` — linear position within a TIGER segment's theoretical house-number range (`StreetInterpolator`), the
|
|
36
37
|
* fallback for streets too sparse to bracket.
|
|
@@ -90,19 +91,19 @@ export interface InterpolationQuery {
|
|
|
90
91
|
lon: number;
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
|
-
export declare class StreetInterpolator implements InterpolationLookup {
|
|
94
|
+
export declare class StreetInterpolator<DB extends StreetSegmentDatabase = StreetSegmentDatabase> implements InterpolationLookup {
|
|
94
95
|
#private;
|
|
95
96
|
constructor(opts: {
|
|
96
97
|
dbPath?: string;
|
|
97
|
-
database?:
|
|
98
|
+
database?: DatabaseClient<DB>;
|
|
98
99
|
});
|
|
99
100
|
/**
|
|
100
|
-
* The artifact's own conformal radius multiplier (#374), read from the
|
|
101
|
-
* construction. `undefined` = the
|
|
102
|
-
* artifact default and callers may supply a legacy fallback.
|
|
101
|
+
* The artifact's own conformal radius multiplier (#374), read from the extract's `interp_calibration` metadata table
|
|
102
|
+
* at construction. `undefined` = the extract predates the table (or carries no valid row) — the resolver then applies
|
|
103
|
+
* no artifact default and callers may supply a legacy fallback.
|
|
103
104
|
*/
|
|
104
105
|
get radiusCalibration(): number | undefined;
|
|
105
106
|
find(query: InterpolationQuery): InterpolatedHit | null;
|
|
106
|
-
|
|
107
|
+
[Symbol.dispose](): void;
|
|
107
108
|
}
|
|
108
109
|
//# sourceMappingURL=interpolation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../interpolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;
|
|
1
|
+
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../lib/interpolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAIzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAEnE;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,aAAa,CAAA;AAEjE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,YAAY,EAAE,IAAI,CAAA;IAClB;;OAEG;IACH,MAAM,EAAE,mBAAmB,CAAA;IAC3B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3B;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACnC;AAsED,qBAAa,kBAAkB,CAC9B,EAAE,SAAS,qBAAqB,GAAG,qBAAqB,CACvD,YAAW,mBAAmB;;gBAanB,IAAI,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC,CAAA;KAAE;IA6CpE;;;;OAIG;IACH,IAAI,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAE1C;IAED,IAAI,CAAC,KAAK,EAAE,kBAAkB,GAAG,eAAe,GAAG,IAAI;IA4FvD,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGxB"}
|
package/out/interpolation.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* then linear interpolation along the segment polyline. Design:
|
|
9
9
|
* `docs/articles/plan/2026-06-11-interpolation-design.md`.
|
|
10
10
|
*
|
|
11
|
-
* Reads the per-state
|
|
11
|
+
* Reads the per-state extract built by `scripts/build-interpolation-extract.ts` (`street_segment`: one
|
|
12
12
|
* row per TIGER edge SIDE — independent left/right ranges, ZIPs, parity). Query-side
|
|
13
13
|
* normalization is THE shared normalizer (`street-normalize.ts`) — identical to build-side, by
|
|
14
14
|
* construction.
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
* exact-point fall-through) is a noted follow-up on #483, so the `find()` shape mirrors
|
|
26
26
|
* `AddressPointLookup.find()` to keep that wiring mechanical.
|
|
27
27
|
*/
|
|
28
|
-
import {
|
|
29
|
-
import { parseJSONStrict } from "@mailwoman/core/objects";
|
|
28
|
+
import { parseJSONStrict } from "@mailwoman/core/json";
|
|
30
29
|
import { clampFraction, haversineKm, pointAlong } from "@mailwoman/spatial";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
30
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
31
|
+
import { hasTable, prepareAll } from "#sqlite-utils";
|
|
32
|
+
import { canonicalizeRouteKey, streetKeyVariants } from "#street/normalize";
|
|
33
33
|
/**
|
|
34
34
|
* Acceptance geometry for the `near` tie-break: the winning postcode group's closest segment must sit within this many
|
|
35
35
|
* kilometres of `near`, AND the runner-up group must be at least {@link NEAR_DOMINANCE} times farther. Both measured on
|
|
@@ -80,23 +80,25 @@ function nearestPostcodeGroup(pool, near) {
|
|
|
80
80
|
}
|
|
81
81
|
export class StreetInterpolator {
|
|
82
82
|
#db;
|
|
83
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Resources this instance opened. A connection handed in by a caller is NOT in here, so disposal cannot reach it —
|
|
85
|
+
* ownership is membership rather than a flag a later branch has to check.
|
|
86
|
+
*/
|
|
87
|
+
#resources = new DisposableStack();
|
|
84
88
|
#byPostcode;
|
|
85
89
|
#byStreet;
|
|
86
90
|
#radiusCalibration;
|
|
87
91
|
constructor(opts) {
|
|
88
92
|
if (opts.database) {
|
|
89
93
|
this.#db = opts.database;
|
|
90
|
-
this.#ownsDB = false;
|
|
91
94
|
}
|
|
92
95
|
else if (opts.dbPath) {
|
|
93
|
-
this.#db = new
|
|
94
|
-
this.#ownsDB = true;
|
|
96
|
+
this.#db = this.#resources.use(new DatabaseClient(opts.dbPath, { readOnly: true }));
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
97
99
|
throw new Error("StreetInterpolator: one of dbPath or database is required");
|
|
98
100
|
}
|
|
99
|
-
// Degrade gracefully on an empty/tableless
|
|
101
|
+
// Degrade gracefully on an empty/tableless extract (interrupted build, stray 0-byte file): with no
|
|
100
102
|
// `street_segment` table this interpolator is a no-op miss, not a crash that loses the state (#568).
|
|
101
103
|
if (hasTable(this.#db, "street_segment")) {
|
|
102
104
|
const columns = `from_hn, to_hn, min_hn, max_hn, parity, postcode, geometry, source, release`;
|
|
@@ -106,9 +108,9 @@ export class StreetInterpolator {
|
|
|
106
108
|
WHERE street_norm = ? AND min_hn <= ? AND max_hn >= ?`);
|
|
107
109
|
}
|
|
108
110
|
// #374 doctrine: the conformal radius multiplier is a property of the calibration set the ARTIFACT was
|
|
109
|
-
// built against, so it ships in the
|
|
111
|
+
// built against, so it ships in the extract's `interp_calibration` metadata table (street-segment-schema.ts)
|
|
110
112
|
// and is read here, once, at open time — sync raw `.prepare()` per the sync-by-interface doctrine
|
|
111
|
-
// (AGENTS.md).
|
|
113
|
+
// (AGENTS.md). Extracts predating the table (the pre-2026-07 fleet) yield `undefined`; callers then fall
|
|
112
114
|
// back to their in-code table, byte-identically.
|
|
113
115
|
if (hasTable(this.#db, "interp_calibration")) {
|
|
114
116
|
const row = this.#db.prepare("SELECT radius_multiplier FROM interp_calibration LIMIT 1").get();
|
|
@@ -119,9 +121,9 @@ export class StreetInterpolator {
|
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
/**
|
|
122
|
-
* The artifact's own conformal radius multiplier (#374), read from the
|
|
123
|
-
* construction. `undefined` = the
|
|
124
|
-
* artifact default and callers may supply a legacy fallback.
|
|
124
|
+
* The artifact's own conformal radius multiplier (#374), read from the extract's `interp_calibration` metadata table
|
|
125
|
+
* at construction. `undefined` = the extract predates the table (or carries no valid row) — the resolver then applies
|
|
126
|
+
* no artifact default and callers may supply a legacy fallback.
|
|
125
127
|
*/
|
|
126
128
|
get radiusCalibration() {
|
|
127
129
|
return this.#radiusCalibration;
|
|
@@ -138,7 +140,7 @@ export class StreetInterpolator {
|
|
|
138
140
|
// Key-variant ladder (see `streetKeyVariants`): the literal key first, then the doubled-type
|
|
139
141
|
// collapse and the saint↔st register swap. A variant advances the ladder when it produces no
|
|
140
142
|
// ANSWER, not merely no rows — a wrong-register key can cover the number in far-away towns and
|
|
141
|
-
// then fail the ambiguity
|
|
143
|
+
// then fail the ambiguity check ("saint pauls place" reaches Nassau's rows; the Brooklyn answer
|
|
142
144
|
// lives under "st pauls place"), and stopping at rows would eclipse the right variant.
|
|
143
145
|
for (const variant of streetKeyVariants(query.street)) {
|
|
144
146
|
const streetNorm = canonicalizeRouteKey(variant);
|
|
@@ -207,10 +209,8 @@ export class StreetInterpolator {
|
|
|
207
209
|
release: best.release,
|
|
208
210
|
};
|
|
209
211
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
this.#db.close();
|
|
213
|
-
}
|
|
212
|
+
[Symbol.dispose]() {
|
|
213
|
+
this.#resources[Symbol.dispose]();
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
//# sourceMappingURL=interpolation.js.map
|
package/out/interpolation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolation.js","sourceRoot":"","sources":["../interpolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"interpolation.js","sourceRoot":"","sources":["../lib/interpolation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAEtD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAoB,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,oBAAoB,EAAiB,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAkE1F;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,EAAE,CAAA;AAEtB;;GAEG;AACH,MAAM,cAAc,GAAG,CAAC,CAAA;AAcxB;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,IAA2B,EAAE,IAAkC;IAC5F,MAAM,MAAM,GAAG,IAAI,GAAG,EAA8C,CAAA;IAEpE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAA;QAC9B,IAAI,EAAE,GAAG,MAAM,CAAC,iB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OAAO,CAAC;QACf,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAA;IAClC,CAAC;CACD"}
|
package/out/lookup.d.ts
CHANGED
|
@@ -9,42 +9,43 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See `docs/plan/phases/PHASE_4_2_wof_sqlite.md` for the design rationale.
|
|
11
11
|
*/
|
|
12
|
-
import { DatabaseSync } from "node:sqlite";
|
|
13
12
|
import { type Ancestor, type CoincidentLocality } from "@mailwoman/resolver";
|
|
14
|
-
import {
|
|
15
|
-
import type
|
|
16
|
-
import { type
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
13
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
14
|
+
import { type Convention, type ConventionSource } from "#convention/index";
|
|
15
|
+
import { type ExtractConfig } from "#extracts";
|
|
16
|
+
import type { WOFPostalCityAliasLookup } from "#postal/city-alias-lookup";
|
|
17
|
+
import { type RankingWeights } from "#ranking-weights";
|
|
18
|
+
import type { WOFDatabase } from "#schema";
|
|
19
|
+
import type { FindPlaceQuery, PlaceCandidate, PlaceLookup } from "#types";
|
|
19
20
|
export interface WOFSQLitePlaceLookupOpts {
|
|
20
21
|
/**
|
|
21
22
|
* Path to the WOF SQLite distribution on disk. Mutually exclusive with `database`.
|
|
22
23
|
*
|
|
23
|
-
* **Single string** — opens that one DB as the main
|
|
24
|
+
* **Single string** — opens that one DB as the main extract.
|
|
24
25
|
*
|
|
25
26
|
* **Array** — opens the first entry as main, then ATTACHes each subsequent entry as a separate SQLite schema. Schema
|
|
26
27
|
* names are derived from the filename (`whosonfirst-data-postalcode- us-latest.db` → `postalcode_us`); override with
|
|
27
|
-
* `
|
|
28
|
+
* `ExtractConfig.schemaName` when the filename doesn't follow WOF convention. See `extracts.ts` for the derivation
|
|
28
29
|
* rules.
|
|
29
30
|
*
|
|
30
|
-
* Routing: queries with a `placetype` matching a
|
|
31
|
-
* everything else hits main. Cross-
|
|
32
|
-
* corpora.
|
|
31
|
+
* Routing: queries with a `placetype` matching a extract's name (or explicit `placetypes` hint) are sent to that
|
|
32
|
+
* extract; everything else hits main. Cross-extract UNION is NOT done — BM25 isn't comparable across
|
|
33
|
+
* separately-indexed corpora.
|
|
33
34
|
*/
|
|
34
|
-
databasePath?: string | ReadonlyArray<string |
|
|
35
|
+
databasePath?: string | ReadonlyArray<string | ExtractConfig>;
|
|
35
36
|
/**
|
|
36
|
-
* Pre-opened
|
|
37
|
-
* Multi-
|
|
37
|
+
* Pre-opened connection — primarily for tests against an inline fixture DB. Mutually exclusive with `databasePath`.
|
|
38
|
+
* Multi-extract requires `databasePath` (so the lookup owns the ATTACH).
|
|
38
39
|
*/
|
|
39
|
-
database?:
|
|
40
|
+
database?: DatabaseClient<WOFDatabase>;
|
|
40
41
|
/**
|
|
41
42
|
* If true, build the FTS5 `place_search` virtual table on construction if it doesn't already exist. The upstream WOF
|
|
42
43
|
* distribution does NOT ship FTS5, so callers either set this once on first open or pre-build it via the
|
|
43
44
|
* operator-side CLI documented in the README. Default false — the resolver assumes the index already exists and
|
|
44
45
|
* errors loudly if it doesn't.
|
|
45
46
|
*
|
|
46
|
-
* With multi-
|
|
47
|
-
* `mailwoman gazetteer build fts` — operator script for predictable cost.
|
|
47
|
+
* With multi-extract, `buildFTS: true` builds the index on the **main** extract only. Other extracts must be
|
|
48
|
+
* pre-built via `mailwoman gazetteer build fts` — operator script for predictable cost.
|
|
48
49
|
*/
|
|
49
50
|
buildFTS?: boolean;
|
|
50
51
|
/**
|
|
@@ -58,7 +59,8 @@ export interface WOFSQLitePlaceLookupOpts {
|
|
|
58
59
|
* Opt-in postal-city alias reader (#475). When supplied, the coordinate-first locality scorer treats an observed
|
|
59
60
|
* `postal_city` ("Antioch", postcode 37013) as a name-match alias for the geographic locality the postcode sits in
|
|
60
61
|
* ("Nashville"), recovering the chronic postal-vs- geographic-city mismatch. Absent (the default), the resolver is
|
|
61
|
-
* byte-identical — every alias code path is
|
|
62
|
+
* byte-identical — every alias code path is conditioned on this being non-null, so an unprovided reader changes no
|
|
63
|
+
* score.
|
|
62
64
|
*/
|
|
63
65
|
postalCityAliases?: WOFPostalCityAliasLookup;
|
|
64
66
|
}
|
|
@@ -83,8 +85,7 @@ export declare class WOFSQLitePlaceLookup implements PlaceLookup, Disposable {
|
|
|
83
85
|
* locality/neighbourhood ancestors order correctly instead of sorting last.
|
|
84
86
|
*/
|
|
85
87
|
ancestors(id: number | string): Ancestor[];
|
|
86
|
-
close(): void;
|
|
87
88
|
[Symbol.dispose](): void;
|
|
88
89
|
}
|
|
89
|
-
export type { RankingWeights } from "
|
|
90
|
+
export type { RankingWeights } from "#ranking-weights";
|
|
90
91
|
//# sourceMappingURL=lookup.d.ts.map
|
package/out/lookup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../lib/lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAGnG,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAKzD,OAAO,EAIN,KAAK,UAAU,EACf,KAAK,gBAAgB,EAGrB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAKN,KAAK,aAAa,EAClB,MAAM,WAAW,CAAA;AAalB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AACzE,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAI1C,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAgB,MAAM,QAAQ,CA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