@mailwoman/resolver-wof-sqlite 9.4.0 → 10.1.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 +8 -8
- package/lib/address/{point-interpolation.ts → point/interpolation.ts} +40 -38
- package/lib/address/point/schema.ts +132 -0
- package/lib/address/point.ts +68 -81
- package/lib/{address/index.ts → address.ts} +2 -2
- package/lib/ancestry/backfill.ts +24 -88
- package/lib/{ancestry/index.ts → ancestry.ts} +19 -15
- package/lib/build/candidate.ts +608 -0
- package/lib/build/population-corrections.ts +64 -0
- package/lib/build/slim.ts +338 -0
- package/lib/candidate/alias-bags.ts +74 -14
- package/lib/candidate/ancestors/schema.ts +211 -0
- package/lib/candidate/{ancestors-sidecar.ts → ancestors/sidecar.ts} +17 -24
- package/lib/candidate/country-display-names.ts +6 -20
- package/lib/candidate/extract-fold.ts +12 -57
- package/lib/candidate/fts.ts +28 -0
- package/lib/candidate/importance.ts +221 -0
- package/lib/candidate/lookup.ts +669 -0
- package/lib/candidate/name-roles.ts +16 -34
- package/lib/candidate/own-name.ts +34 -31
- package/lib/candidate/place-attrs.ts +20 -13
- package/lib/candidate/schema.ts +211 -0
- package/lib/candidate/scoring.ts +222 -0
- package/lib/capital-schema.ts +21 -17
- package/lib/capitals.ts +26 -24
- package/lib/coincident-roles.ts +74 -55
- package/lib/convention/schema.ts +13 -7
- package/lib/convention.ts +144 -0
- package/lib/coverage-manifest-schema.ts +34 -39
- package/lib/currency-backfill.ts +24 -69
- package/lib/env.ts +1 -1
- package/lib/exact-match.ts +31 -20
- package/lib/extracts.ts +96 -73
- package/lib/fst/autocomplete.ts +52 -35
- package/lib/fst/builder.ts +30 -36
- package/lib/fst/deserialize-web.ts +8 -9
- package/lib/fst/format.ts +41 -23
- package/lib/fst/freshness.ts +17 -95
- package/lib/fst/matcher.ts +2 -2
- package/lib/fst/serialize.ts +45 -60
- package/lib/fst/types.ts +71 -59
- package/lib/fts/query.ts +5 -36
- package/lib/fts.ts +280 -0
- package/lib/geonames/aliases.ts +72 -149
- package/lib/geonames/postal.ts +162 -77
- package/lib/index.ts +20 -27
- package/lib/interpolation.ts +43 -96
- package/lib/lookup.ts +137 -257
- package/lib/name-score.ts +9 -7
- package/lib/nsul/lookup.ts +36 -53
- package/lib/nsul/schema.ts +16 -43
- package/lib/paths.ts +159 -0
- package/lib/place-importance-schema.ts +57 -164
- package/lib/poi/lookup.ts +100 -109
- package/lib/poi/schema.ts +42 -26
- package/lib/polygon-schema.ts +10 -6
- package/lib/postal/city/alias/lookup.ts +79 -0
- package/lib/postal/{city-alias-schema.ts → city/alias/schema.ts} +14 -10
- package/lib/postal/{city-candidate-schema.ts → city/candidate-schema.ts} +26 -20
- package/lib/postal.ts +9 -0
- package/lib/postcode-point-lookup.ts +9 -19
- package/lib/primary-preference.ts +45 -125
- package/lib/proximity-rerank.ts +43 -32
- package/lib/ranking-weights.ts +98 -76
- package/lib/region-keys.ts +68 -40
- package/lib/reverse.ts +108 -72
- package/lib/schema.ts +74 -42
- package/lib/search-fetch.ts +90 -68
- package/lib/sqlite/convention-source.ts +57 -0
- package/lib/sqlite/utils.ts +79 -0
- package/lib/street/centroid/schema.ts +149 -0
- package/lib/street/centroid.ts +16 -25
- package/lib/street/{morphology-fst-builder.ts → morphology/fst/builder.ts} +56 -41
- package/lib/street/{morphology-fst-loader.ts → morphology/fst/loader.ts} +36 -29
- package/lib/street/name-lookup.ts +43 -35
- package/lib/street/normalize.ts +85 -216
- package/lib/street/segment-schema.ts +116 -43
- package/lib/{street/index.ts → street.ts} +3 -3
- package/lib/types.ts +94 -140
- package/lib/unified-schema.ts +29 -29
- package/lib/uprn/existence.ts +30 -19
- package/lib/uprn/lookup.ts +28 -67
- package/lib/uprn/schema.ts +18 -40
- package/lib/weights-overlay-linker.ts +204 -232
- package/out/address/point/interpolation.d.ts +45 -0
- package/out/address/point/interpolation.d.ts.map +1 -0
- package/out/address/{point-interpolation.js → point/interpolation.js} +38 -38
- package/out/address/point/interpolation.js.map +1 -0
- package/out/address/point/schema.d.ts +74 -0
- package/out/address/point/schema.d.ts.map +1 -0
- package/out/address/{point-schema.js → point/schema.js} +4 -20
- package/out/address/point/schema.js.map +1 -0
- package/out/address/point.d.ts +24 -21
- package/out/address/point.d.ts.map +1 -1
- package/out/address/point.js +60 -77
- package/out/address/point.js.map +1 -1
- package/out/{address/index.js → address.d.ts} +3 -3
- package/out/address.d.ts.map +1 -0
- package/out/{address/index.d.ts → address.js} +3 -3
- package/out/address.js.map +1 -0
- package/out/ancestry/backfill.d.ts +11 -64
- package/out/ancestry/backfill.d.ts.map +1 -1
- package/out/ancestry/backfill.js +18 -76
- package/out/ancestry/backfill.js.map +1 -1
- package/out/ancestry.d.ts +49 -0
- package/out/ancestry.d.ts.map +1 -0
- package/out/ancestry.js +59 -0
- package/out/ancestry.js.map +1 -0
- package/out/build/candidate.d.ts +170 -0
- package/out/build/candidate.d.ts.map +1 -0
- package/out/{build-candidate.js → build/candidate.js} +33 -102
- package/out/build/candidate.js.map +1 -0
- package/out/build/population-corrections.d.ts +52 -0
- package/out/build/population-corrections.d.ts.map +1 -0
- package/out/build/population-corrections.js +40 -0
- package/out/build/population-corrections.js.map +1 -0
- package/out/build/slim.d.ts +44 -0
- package/out/build/slim.d.ts.map +1 -0
- package/out/{build-slim.js → build/slim.js} +33 -94
- package/out/build/slim.js.map +1 -0
- package/out/candidate/alias-bags.d.ts +13 -5
- package/out/candidate/alias-bags.d.ts.map +1 -1
- package/out/candidate/alias-bags.js +55 -12
- package/out/candidate/alias-bags.js.map +1 -1
- package/out/candidate/ancestors/schema.d.ts +166 -0
- package/out/candidate/ancestors/schema.d.ts.map +1 -0
- package/out/candidate/ancestors/schema.js +131 -0
- package/out/candidate/ancestors/schema.js.map +1 -0
- package/out/candidate/ancestors/sidecar.d.ts +27 -0
- package/out/candidate/ancestors/sidecar.d.ts.map +1 -0
- package/out/candidate/{ancestors-sidecar.js → ancestors/sidecar.js} +17 -24
- package/out/candidate/ancestors/sidecar.js.map +1 -0
- package/out/candidate/country-display-names.d.ts +5 -15
- package/out/candidate/country-display-names.d.ts.map +1 -1
- package/out/candidate/country-display-names.js +6 -20
- package/out/candidate/country-display-names.js.map +1 -1
- package/out/candidate/extract-fold.d.ts +8 -16
- package/out/candidate/extract-fold.d.ts.map +1 -1
- package/out/candidate/extract-fold.js +6 -48
- package/out/candidate/extract-fold.js.map +1 -1
- package/out/candidate/fts.d.ts +19 -0
- package/out/candidate/fts.d.ts.map +1 -0
- package/out/candidate/fts.js +22 -0
- package/out/candidate/fts.js.map +1 -0
- package/out/candidate/importance.d.ts +127 -0
- package/out/candidate/importance.d.ts.map +1 -0
- package/out/candidate/importance.js +162 -0
- package/out/candidate/importance.js.map +1 -0
- package/out/candidate/lookup.d.ts +36 -0
- package/out/candidate/lookup.d.ts.map +1 -0
- package/out/candidate/lookup.js +456 -0
- package/out/candidate/lookup.js.map +1 -0
- package/out/candidate/name-roles.d.ts +10 -22
- package/out/candidate/name-roles.d.ts.map +1 -1
- package/out/candidate/name-roles.js +15 -33
- package/out/candidate/name-roles.js.map +1 -1
- package/out/candidate/own-name.d.ts +23 -25
- package/out/candidate/own-name.d.ts.map +1 -1
- package/out/candidate/own-name.js +34 -31
- package/out/candidate/own-name.js.map +1 -1
- package/out/candidate/place-attrs.d.ts +20 -13
- package/out/candidate/place-attrs.d.ts.map +1 -1
- package/out/candidate/place-attrs.js +4 -5
- package/out/candidate/place-attrs.js.map +1 -1
- package/out/candidate/schema.d.ts +120 -0
- package/out/candidate/schema.d.ts.map +1 -0
- package/out/{candidate-schema.js → candidate/schema.js} +11 -23
- package/out/candidate/schema.js.map +1 -0
- package/out/{candidate-scoring.d.ts → candidate/scoring.d.ts} +8 -9
- package/out/candidate/scoring.d.ts.map +1 -0
- package/out/candidate/scoring.js +157 -0
- package/out/candidate/scoring.js.map +1 -0
- package/out/capital-schema.d.ts +21 -17
- package/out/capital-schema.d.ts.map +1 -1
- package/out/capital-schema.js +17 -15
- package/out/capital-schema.js.map +1 -1
- package/out/capitals.d.ts +26 -24
- package/out/capitals.d.ts.map +1 -1
- package/out/capitals.js +23 -21
- package/out/capitals.js.map +1 -1
- package/out/coincident-roles.d.ts +60 -43
- package/out/coincident-roles.d.ts.map +1 -1
- package/out/coincident-roles.js +61 -50
- package/out/coincident-roles.js.map +1 -1
- package/out/convention/schema.d.ts +12 -6
- package/out/convention/schema.d.ts.map +1 -1
- package/out/convention/schema.js +6 -4
- package/out/convention/schema.js.map +1 -1
- package/out/convention.d.ts +97 -0
- package/out/convention.d.ts.map +1 -0
- package/out/convention.js +81 -0
- package/out/convention.js.map +1 -0
- package/out/coverage-manifest-schema.d.ts +33 -38
- package/out/coverage-manifest-schema.d.ts.map +1 -1
- package/out/coverage-manifest-schema.js +20 -29
- package/out/coverage-manifest-schema.js.map +1 -1
- package/out/currency-backfill.d.ts +13 -35
- package/out/currency-backfill.d.ts.map +1 -1
- package/out/currency-backfill.js +12 -39
- package/out/currency-backfill.js.map +1 -1
- package/out/env.d.ts +2 -2
- package/out/env.js +1 -1
- package/out/exact-match.d.ts +19 -10
- package/out/exact-match.d.ts.map +1 -1
- package/out/exact-match.js +31 -20
- package/out/exact-match.js.map +1 -1
- package/out/extracts.d.ts +65 -54
- package/out/extracts.d.ts.map +1 -1
- package/out/extracts.js +63 -55
- package/out/extracts.js.map +1 -1
- package/out/fst/autocomplete.d.ts +28 -20
- package/out/fst/autocomplete.d.ts.map +1 -1
- package/out/fst/autocomplete.js +38 -27
- package/out/fst/autocomplete.js.map +1 -1
- package/out/fst/builder.d.ts.map +1 -1
- package/out/fst/builder.js +30 -36
- package/out/fst/builder.js.map +1 -1
- package/out/fst/deserialize-web.d.ts +3 -3
- package/out/fst/deserialize-web.d.ts.map +1 -1
- package/out/fst/deserialize-web.js +8 -9
- package/out/fst/deserialize-web.js.map +1 -1
- package/out/fst/format.d.ts +41 -23
- package/out/fst/format.d.ts.map +1 -1
- package/out/fst/format.js +41 -23
- package/out/fst/format.js.map +1 -1
- package/out/fst/freshness.d.ts +11 -73
- package/out/fst/freshness.d.ts.map +1 -1
- package/out/fst/freshness.js +12 -76
- package/out/fst/freshness.js.map +1 -1
- package/out/fst/matcher.d.ts +1 -1
- package/out/fst/matcher.d.ts.map +1 -1
- package/out/fst/matcher.js +2 -2
- package/out/fst/matcher.js.map +1 -1
- package/out/fst/serialize.d.ts +30 -26
- package/out/fst/serialize.d.ts.map +1 -1
- package/out/fst/serialize.js +44 -58
- package/out/fst/serialize.js.map +1 -1
- package/out/fst/types.d.ts +71 -59
- package/out/fst/types.d.ts.map +1 -1
- package/out/fst/types.js +1 -4
- package/out/fst/types.js.map +1 -1
- package/out/{fst/index.js → fst.d.ts} +1 -1
- package/out/fst.d.ts.map +1 -0
- package/out/{fst/index.d.ts → fst.js} +1 -1
- package/out/fst.js.map +1 -0
- package/out/fts/query.d.ts +2 -27
- package/out/fts/query.d.ts.map +1 -1
- package/out/fts/query.js +5 -36
- package/out/fts/query.js.map +1 -1
- package/out/fts.d.ts +126 -0
- package/out/fts.d.ts.map +1 -0
- package/out/fts.js +188 -0
- package/out/fts.js.map +1 -0
- package/out/geonames/aliases.d.ts +26 -67
- package/out/geonames/aliases.d.ts.map +1 -1
- package/out/geonames/aliases.js +44 -121
- package/out/geonames/aliases.js.map +1 -1
- package/out/geonames/postal.d.ts +84 -50
- package/out/geonames/postal.d.ts.map +1 -1
- package/out/geonames/postal.js +115 -78
- package/out/geonames/postal.js.map +1 -1
- package/out/{geonames/index.js → geonames.d.ts} +1 -1
- package/out/geonames.d.ts.map +1 -0
- package/out/{geonames/index.d.ts → geonames.js} +1 -1
- package/out/geonames.js.map +1 -0
- package/out/index.d.ts +20 -21
- package/out/index.d.ts.map +1 -1
- package/out/index.js +14 -15
- package/out/index.js.map +1 -1
- package/out/interpolation.d.ts +15 -52
- package/out/interpolation.d.ts.map +1 -1
- package/out/interpolation.js +25 -68
- package/out/interpolation.js.map +1 -1
- package/out/lookup.d.ts +24 -53
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +117 -223
- package/out/lookup.js.map +1 -1
- package/out/name-score.d.ts +2 -2
- package/out/name-score.d.ts.map +1 -1
- package/out/name-score.js +9 -7
- package/out/name-score.js.map +1 -1
- package/out/nsul/lookup.d.ts +33 -34
- package/out/nsul/lookup.d.ts.map +1 -1
- package/out/nsul/lookup.js +26 -40
- package/out/nsul/lookup.js.map +1 -1
- package/out/nsul/schema.d.ts +16 -43
- package/out/nsul/schema.d.ts.map +1 -1
- package/out/nsul/schema.js +9 -35
- package/out/nsul/schema.js.map +1 -1
- package/out/{nsul/index.d.ts → nsul.d.ts} +1 -1
- package/out/nsul.d.ts.map +1 -0
- package/out/{nsul/index.js → nsul.js} +1 -1
- package/out/nsul.js.map +1 -0
- package/out/paths.d.ts +124 -0
- package/out/paths.d.ts.map +1 -0
- package/out/paths.js +104 -0
- package/out/paths.js.map +1 -0
- package/out/place-importance-schema.d.ts +49 -141
- package/out/place-importance-schema.d.ts.map +1 -1
- package/out/place-importance-schema.js +25 -140
- package/out/place-importance-schema.js.map +1 -1
- package/out/poi/lookup.d.ts +38 -42
- package/out/poi/lookup.d.ts.map +1 -1
- package/out/poi/lookup.js +67 -90
- package/out/poi/lookup.js.map +1 -1
- package/out/poi/schema.d.ts +41 -25
- package/out/poi/schema.d.ts.map +1 -1
- package/out/poi/schema.js +25 -17
- package/out/poi/schema.js.map +1 -1
- package/out/{poi/index.js → poi.d.ts} +1 -1
- package/out/poi.d.ts.map +1 -0
- package/out/{poi/index.d.ts → poi.js} +1 -1
- package/out/poi.js.map +1 -0
- package/out/polygon-schema.d.ts +10 -6
- package/out/polygon-schema.d.ts.map +1 -1
- package/out/polygon-schema.js +2 -2
- package/out/polygon-schema.js.map +1 -1
- package/out/postal/{city-alias-lookup.d.ts → city/alias/lookup.d.ts} +22 -25
- package/out/postal/city/alias/lookup.d.ts.map +1 -0
- package/out/postal/city/alias/lookup.js +49 -0
- package/out/postal/city/alias/lookup.js.map +1 -0
- package/out/postal/{city-alias-schema.d.ts → city/alias/schema.d.ts} +15 -11
- package/out/postal/city/alias/schema.d.ts.map +1 -0
- package/out/postal/{city-alias-schema.js → city/alias/schema.js} +11 -9
- package/out/postal/city/alias/schema.js.map +1 -0
- package/out/postal/city/candidate-schema.d.ts +72 -0
- package/out/postal/city/candidate-schema.d.ts.map +1 -0
- package/out/postal/city/candidate-schema.js +60 -0
- package/out/postal/city/candidate-schema.js.map +1 -0
- package/out/postal.d.ts +9 -0
- package/out/postal.d.ts.map +1 -0
- package/out/postal.js +9 -0
- package/out/postal.js.map +1 -0
- package/out/postcode-point-lookup.d.ts +9 -19
- package/out/postcode-point-lookup.d.ts.map +1 -1
- package/out/postcode-point-lookup.js +5 -17
- package/out/postcode-point-lookup.js.map +1 -1
- package/out/primary-preference.d.ts +39 -93
- package/out/primary-preference.d.ts.map +1 -1
- package/out/primary-preference.js +13 -97
- package/out/primary-preference.js.map +1 -1
- package/out/proximity-rerank.d.ts +40 -29
- package/out/proximity-rerank.d.ts.map +1 -1
- package/out/proximity-rerank.js +38 -29
- package/out/proximity-rerank.js.map +1 -1
- package/out/ranking-weights.d.ts +91 -62
- package/out/ranking-weights.d.ts.map +1 -1
- package/out/ranking-weights.js +26 -25
- package/out/ranking-weights.js.map +1 -1
- package/out/region-keys.d.ts +48 -29
- package/out/region-keys.d.ts.map +1 -1
- package/out/region-keys.js +68 -40
- package/out/region-keys.js.map +1 -1
- package/out/reverse.d.ts +75 -50
- package/out/reverse.d.ts.map +1 -1
- package/out/reverse.js +61 -49
- package/out/reverse.js.map +1 -1
- package/out/schema.d.ts +74 -42
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +4 -5
- package/out/schema.js.map +1 -1
- package/out/search-fetch.d.ts +16 -12
- package/out/search-fetch.d.ts.map +1 -1
- package/out/search-fetch.js +83 -63
- package/out/search-fetch.js.map +1 -1
- package/out/sqlite/convention-source.d.ts +25 -0
- package/out/sqlite/convention-source.d.ts.map +1 -0
- package/out/sqlite/convention-source.js +48 -0
- package/out/sqlite/convention-source.js.map +1 -0
- package/out/sqlite/utils.d.ts +45 -0
- package/out/sqlite/utils.d.ts.map +1 -0
- package/out/sqlite/utils.js +56 -0
- package/out/sqlite/utils.js.map +1 -0
- package/out/street/centroid/schema.d.ts +100 -0
- package/out/street/centroid/schema.d.ts.map +1 -0
- package/out/street/centroid/schema.js +66 -0
- package/out/street/centroid/schema.js.map +1 -0
- package/out/street/centroid.d.ts +9 -19
- package/out/street/centroid.d.ts.map +1 -1
- package/out/street/centroid.js +11 -22
- package/out/street/centroid.js.map +1 -1
- package/out/street/{morphology-fst-builder.d.ts → morphology/fst/builder.d.ts} +21 -11
- package/out/street/morphology/fst/builder.d.ts.map +1 -0
- package/out/street/{morphology-fst-builder.js → morphology/fst/builder.js} +40 -34
- package/out/street/morphology/fst/builder.js.map +1 -0
- package/out/street/morphology/fst/loader.d.ts +74 -0
- package/out/street/morphology/fst/loader.d.ts.map +1 -0
- package/out/street/{morphology-fst-loader.js → morphology/fst/loader.js} +21 -21
- package/out/street/morphology/fst/loader.js.map +1 -0
- package/out/street/name-lookup.d.ts +24 -18
- package/out/street/name-lookup.d.ts.map +1 -1
- package/out/street/name-lookup.js +32 -31
- package/out/street/name-lookup.js.map +1 -1
- package/out/street/normalize.d.ts +35 -136
- package/out/street/normalize.d.ts.map +1 -1
- package/out/street/normalize.js +74 -191
- package/out/street/normalize.js.map +1 -1
- package/out/street/segment-schema.d.ts +79 -39
- package/out/street/segment-schema.d.ts.map +1 -1
- package/out/street/segment-schema.js +71 -21
- package/out/street/segment-schema.js.map +1 -1
- package/out/{street/index.d.ts → street.d.ts} +4 -4
- package/out/street.d.ts.map +1 -0
- package/out/{street/index.js → street.js} +4 -4
- package/out/street.js.map +1 -0
- package/out/types.d.ts +69 -138
- package/out/types.d.ts.map +1 -1
- package/out/types.js +0 -6
- package/out/types.js.map +1 -1
- package/out/unified-schema.d.ts +8 -12
- package/out/unified-schema.d.ts.map +1 -1
- package/out/unified-schema.js +29 -29
- package/out/unified-schema.js.map +1 -1
- package/out/uprn/existence.d.ts +28 -17
- package/out/uprn/existence.d.ts.map +1 -1
- package/out/uprn/existence.js +26 -16
- package/out/uprn/existence.js.map +1 -1
- package/out/uprn/lookup.d.ts +14 -44
- package/out/uprn/lookup.d.ts.map +1 -1
- package/out/uprn/lookup.js +20 -56
- package/out/uprn/lookup.js.map +1 -1
- package/out/uprn/schema.d.ts +18 -40
- package/out/uprn/schema.d.ts.map +1 -1
- package/out/uprn/schema.js +10 -32
- package/out/uprn/schema.js.map +1 -1
- package/out/{uprn/index.d.ts → uprn.d.ts} +1 -1
- package/out/uprn.d.ts.map +1 -0
- package/out/{uprn/index.js → uprn.js} +1 -1
- package/out/uprn.js.map +1 -0
- package/out/weights-overlay-linker.d.ts +132 -141
- package/out/weights-overlay-linker.d.ts.map +1 -1
- package/out/weights-overlay-linker.js +86 -154
- package/out/weights-overlay-linker.js.map +1 -1
- package/package.json +94 -599
- package/lib/address/point-schema.ts +0 -155
- package/lib/build-candidate.ts +0 -632
- package/lib/build-slim.ts +0 -408
- package/lib/candidate-ancestors-schema.ts +0 -195
- package/lib/candidate-fts.ts +0 -46
- package/lib/candidate-importance.ts +0 -224
- package/lib/candidate-lookup.ts +0 -977
- package/lib/candidate-schema.ts +0 -247
- package/lib/candidate-scoring.ts +0 -261
- package/lib/convention/index.ts +0 -154
- package/lib/fts/index.ts +0 -361
- package/lib/postal/city-alias-lookup.ts +0 -97
- package/lib/postal/index.ts +0 -9
- package/lib/sqlite-convention-source.ts +0 -65
- package/lib/sqlite-utils.ts +0 -82
- package/lib/street/centroid-schema.ts +0 -154
- package/out/address/index.d.ts.map +0 -1
- package/out/address/index.js.map +0 -1
- package/out/address/point-interpolation.d.ts +0 -49
- 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 +0 -97
- package/out/address/point-schema.d.ts.map +0 -1
- package/out/address/point-schema.js.map +0 -1
- package/out/ancestry/index.d.ts +0 -45
- package/out/ancestry/index.d.ts.map +0 -1
- package/out/ancestry/index.js +0 -55
- package/out/ancestry/index.js.map +0 -1
- package/out/build-candidate.d.ts +0 -184
- package/out/build-candidate.d.ts.map +0 -1
- package/out/build-candidate.js.map +0 -1
- package/out/build-slim.d.ts +0 -80
- package/out/build-slim.d.ts.map +0 -1
- package/out/build-slim.js.map +0 -1
- package/out/candidate/ancestors-sidecar.d.ts +0 -32
- package/out/candidate/ancestors-sidecar.d.ts.map +0 -1
- package/out/candidate/ancestors-sidecar.js.map +0 -1
- package/out/candidate-ancestors-schema.d.ts +0 -150
- package/out/candidate-ancestors-schema.d.ts.map +0 -1
- package/out/candidate-ancestors-schema.js +0 -123
- package/out/candidate-ancestors-schema.js.map +0 -1
- package/out/candidate-fts.d.ts +0 -37
- package/out/candidate-fts.d.ts.map +0 -1
- package/out/candidate-fts.js +0 -40
- package/out/candidate-fts.js.map +0 -1
- package/out/candidate-importance.d.ts +0 -132
- package/out/candidate-importance.d.ts.map +0 -1
- package/out/candidate-importance.js +0 -169
- package/out/candidate-importance.js.map +0 -1
- package/out/candidate-lookup.d.ts +0 -76
- package/out/candidate-lookup.d.ts.map +0 -1
- package/out/candidate-lookup.js +0 -768
- package/out/candidate-lookup.js.map +0 -1
- package/out/candidate-schema.d.ts +0 -155
- package/out/candidate-schema.d.ts.map +0 -1
- package/out/candidate-schema.js.map +0 -1
- package/out/candidate-scoring.d.ts.map +0 -1
- package/out/candidate-scoring.js +0 -196
- package/out/candidate-scoring.js.map +0 -1
- package/out/convention/index.d.ts +0 -106
- package/out/convention/index.d.ts.map +0 -1
- package/out/convention/index.js +0 -93
- package/out/convention/index.js.map +0 -1
- package/out/fst/index.d.ts.map +0 -1
- package/out/fst/index.js.map +0 -1
- package/out/fts/index.d.ts +0 -184
- package/out/fts/index.d.ts.map +0 -1
- package/out/fts/index.js +0 -277
- package/out/fts/index.js.map +0 -1
- package/out/geonames/index.d.ts.map +0 -1
- package/out/geonames/index.js.map +0 -1
- package/out/nsul/index.d.ts.map +0 -1
- package/out/nsul/index.js.map +0 -1
- package/out/poi/index.d.ts.map +0 -1
- package/out/poi/index.js.map +0 -1
- package/out/postal/city-alias-lookup.d.ts.map +0 -1
- package/out/postal/city-alias-lookup.js +0 -62
- package/out/postal/city-alias-lookup.js.map +0 -1
- package/out/postal/city-alias-schema.d.ts.map +0 -1
- package/out/postal/city-alias-schema.js.map +0 -1
- package/out/postal/city-candidate-schema.d.ts +0 -66
- package/out/postal/city-candidate-schema.d.ts.map +0 -1
- package/out/postal/city-candidate-schema.js +0 -56
- package/out/postal/city-candidate-schema.js.map +0 -1
- package/out/postal/index.d.ts +0 -9
- package/out/postal/index.d.ts.map +0 -1
- package/out/postal/index.js +0 -9
- package/out/postal/index.js.map +0 -1
- package/out/sqlite-convention-source.d.ts +0 -29
- package/out/sqlite-convention-source.d.ts.map +0 -1
- package/out/sqlite-convention-source.js +0 -57
- package/out/sqlite-convention-source.js.map +0 -1
- package/out/sqlite-utils.d.ts +0 -45
- package/out/sqlite-utils.d.ts.map +0 -1
- package/out/sqlite-utils.js +0 -57
- package/out/sqlite-utils.js.map +0 -1
- package/out/street/centroid-schema.d.ts +0 -105
- package/out/street/centroid-schema.d.ts.map +0 -1
- package/out/street/centroid-schema.js +0 -78
- package/out/street/centroid-schema.js.map +0 -1
- package/out/street/index.d.ts.map +0 -1
- package/out/street/index.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 +0 -67
- package/out/street/morphology-fst-loader.d.ts.map +0 -1
- package/out/street/morphology-fst-loader.js.map +0 -1
- package/out/uprn/index.d.ts.map +0 -1
- package/out/uprn/index.js.map +0 -1
- /package/lib/{fst/index.ts → fst.ts} +0 -0
- /package/lib/{geonames/index.ts → geonames.ts} +0 -0
- /package/lib/{nsul/index.ts → nsul.ts} +0 -0
- /package/lib/{poi/index.ts → poi.ts} +0 -0
- /package/lib/{uprn/index.ts → uprn.ts} +0 -0
package/out/types.d.ts
CHANGED
|
@@ -2,237 +2,168 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Public surface for the WOF SQLite resolver — types only, no runtime.
|
|
7
|
-
*
|
|
8
|
-
* These mirror the conceptual model described in `docs/plan/phases/PHASE_4_2_wof_sqlite.md`. Phase
|
|
9
|
-
* 4.3 will extend `PlaceCandidate` with the resolver-decorated fields that flow into
|
|
10
|
-
* `AddressNode.source` / `sourceID` (e.g. an explicit `wofURI: "wof-admin:101751113"` form).
|
|
11
5
|
*/
|
|
6
|
+
import type { LatLon, LatLonBounds } from "@mailwoman/spatial";
|
|
12
7
|
/**
|
|
13
|
-
*
|
|
14
|
-
* https://github.com/whosonfirst/whosonfirst-placetypes for the authoritative definitions of each.
|
|
15
|
-
*
|
|
16
|
-
* Phase 4.2 only emits the ones we actually look up; the union is open enough to extend later.
|
|
8
|
+
* Lists the Who's On First placetypes this resolver looks up, ordered roughly from coarsest to finest.
|
|
17
9
|
*/
|
|
18
10
|
export type WOFPlacetype = "country" | "macroregion" | "region" | "macrocounty" | "county" | "localadmin" | "locality" | "borough" | "neighbourhood" | "microhood" | "postalcode" | "venue" | "campus" | "address";
|
|
19
11
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* `score` is the post-boost ranking number — higher is better, but the scale is implementation- defined. Callers should
|
|
23
|
-
* treat it as ordinal, not absolute.
|
|
24
|
-
*
|
|
25
|
-
* `id` is the WOF place id. It's named generically (not `wof_id`) so the shape stays structurally compatible with
|
|
26
|
-
* `@mailwoman/resolver`'s `ResolvedPlace` — `WOFSQLitePlaceLookup` satisfies the generic `ResolverBackend` contract
|
|
27
|
-
* without an adapter shim.
|
|
28
|
-
*
|
|
29
|
-
* `distanceKm` is populated only when the query carried `near` (and the place has a centroid). Useful for downstream
|
|
30
|
-
* UIs that want to show "X km from you" alongside the result.
|
|
12
|
+
* Describes one ranked match for a place lookup, with `id` as the WOF id
|
|
13
|
+
* so the shape satisfies `ResolvedPlace`.
|
|
31
14
|
*/
|
|
32
15
|
export interface PlaceCandidate {
|
|
33
16
|
id: number;
|
|
34
17
|
name: string;
|
|
35
18
|
placetype: WOFPlacetype;
|
|
36
19
|
/**
|
|
37
|
-
* ISO 3166-1 alpha-2 country code.
|
|
20
|
+
* The ISO 3166-1 alpha-2 country code.
|
|
38
21
|
*/
|
|
39
22
|
country: string;
|
|
40
23
|
lat: number;
|
|
41
24
|
lon: number;
|
|
25
|
+
/**
|
|
26
|
+
* The place's depth-1 ancestor id from the ancestors sidecar, absent when the
|
|
27
|
+
* artifact has no sidecar even for a place with a parent.
|
|
28
|
+
*/
|
|
42
29
|
parent_id?: number;
|
|
43
30
|
score: number;
|
|
44
31
|
distanceKm?: number;
|
|
45
32
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* `resolveTree`) can pin the country without crossing the tier — see the `exactMatch` field on `@mailwoman/core`'s
|
|
49
|
-
* `ResolvedPlace`.
|
|
33
|
+
* Whether the candidate's name or an alias exactly equals the query, used by a
|
|
34
|
+
* later re-rank to stay within the exact-match tier.
|
|
50
35
|
*/
|
|
51
36
|
exactMatch?: boolean;
|
|
52
37
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
38
|
+
* The population term plus the best proximity-bias term.
|
|
39
|
+
*
|
|
40
|
+
* The exact tier sorts by this value instead of population when the query has `near` or `bias`.
|
|
56
41
|
*/
|
|
57
42
|
prominence?: number;
|
|
58
43
|
/**
|
|
59
|
-
*
|
|
60
|
-
* population for ~15% of localities (mostly larger ones). Absent does NOT mean zero, just unknown.
|
|
44
|
+
* The WOF `wof:population` value, absent when the population is unknown.
|
|
61
45
|
*/
|
|
62
46
|
population?: number;
|
|
63
47
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
* It is a strictly-increasing function of {@link PlaceCandidate.population} below `REFERENTIAL_SATURATION_POPULATION`
|
|
68
|
-
* and constant above it, so ordering by it — via `compareReferential`, which restores the megacity order with a
|
|
69
|
-
* population tiebreak — is the SAME ORDER as ordering by population. That equivalence is the point: naming the
|
|
70
|
-
* ranking key costs nothing at the ranking.
|
|
71
|
-
*
|
|
72
|
-
* Absent when the candidate has no population on record, exactly as {@link PlaceCandidate.population} is.
|
|
48
|
+
* The referential likelihood in [0, 1], derived from {@link PlaceCandidate.population}
|
|
49
|
+
* and absent whenever it is.
|
|
73
50
|
*/
|
|
74
51
|
referential?: number;
|
|
75
52
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* RESERVED SLOT awaiting a strict-channel source: present only when a extract's `place_importance` table carries the
|
|
79
|
-
* split columns, and no shipped extract does — the FTS lookup's clauses emit NULL for everything today. `undefined`
|
|
80
|
-
* means either "no encyclopedia entry for this place" or "this gazetteer predates the split"; both are absence, and
|
|
81
|
-
* neither is 0. The BLENDED prior the ranking reads is {@link PlaceCandidate.importance}.
|
|
82
|
-
*
|
|
83
|
-
* Saint-Denis is why this is not a ranking key: the Seine-Saint-Denis suburb (pop 96,128) scores 0.1173 while the
|
|
84
|
-
* Aude hamlet (pop 418) scores 0.5683. Consumers that want to display salience read this; the ranking never does.
|
|
53
|
+
* The encyclopedia-evidence importance in [0, 1], used for display only and present only
|
|
54
|
+
* when the extract's `place_importance` table has the split columns.
|
|
85
55
|
*/
|
|
86
56
|
encyclopedic?: number;
|
|
87
57
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
* Emitted only by the candidate-table backend, and only when the artifact measured this place — absent is UNMEASURED,
|
|
91
|
-
* never zero. Consumed by `rankByImportance` (`resolver/toponym-prior.ts`) for the bare-toponym class. See
|
|
92
|
-
* `candidate-schema.ts` → `CandidateTable.importance` for why the blend, not the strict channel, is what ships.
|
|
58
|
+
* The blended toponym prior in [0, 1] that `rankByImportance` reads for bare toponyms,
|
|
59
|
+
* set only by the candidate-table backend.
|
|
93
60
|
*/
|
|
94
61
|
importance?: number;
|
|
95
62
|
/**
|
|
96
|
-
*
|
|
97
|
-
* is the city's full extent, a postcode's is roughly the postcode polygon's envelope. Optional because not all
|
|
98
|
-
* callers ask for it; implementations are free to omit when the underlying schema lacks the columns.
|
|
63
|
+
* The bounding box from the WOF `spr` extent columns, omitted when the schema lacks them.
|
|
99
64
|
*/
|
|
100
|
-
bbox?:
|
|
65
|
+
bbox?: LatLonBounds;
|
|
101
66
|
/**
|
|
102
|
-
* Set by the
|
|
103
|
-
*
|
|
104
|
-
* postcode). The candidate is still returned (the name wins for the locality), but the flag lets callers lower
|
|
105
|
-
* confidence / surface the conflict rather than silently mislocate. A retrieval/BM25 geocoder can't raise this — it's
|
|
106
|
-
* the falsehood-detection differentiator.
|
|
67
|
+
* Set by the postcode path when the chosen locality is far from the postcode's own
|
|
68
|
+
* locality. the candidate is still returned so callers can lower their confidence.
|
|
107
69
|
*/
|
|
108
70
|
mismatch?: boolean;
|
|
109
71
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
* qualifier on the query, or an artifact without the sidecar). Absence is required — the resolver walk reads it as
|
|
114
|
-
* `unavailable`, never as "not contained".
|
|
72
|
+
* Whether the ancestors sidecar places this candidate under the query's
|
|
73
|
+
* {@link FindPlaceQuery.regionQualifier}, with `false` meaning the check ran
|
|
74
|
+
* and an absent value meaning it did not.
|
|
115
75
|
*/
|
|
116
76
|
containedByQualifier?: boolean;
|
|
117
77
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
* it. Emitted by the candidate-table backend alone — the WASM FTS lookup never runs the ranker, and its candidates
|
|
121
|
-
* omit the field (not evaluated, never "did not fire").
|
|
78
|
+
* Set when the variant exemption spared the candidate from the cross-country
|
|
79
|
+
* alias penalty, by the candidate-table backend only.
|
|
122
80
|
*/
|
|
123
81
|
variantAliasExempted?: true;
|
|
124
82
|
}
|
|
125
83
|
/**
|
|
126
|
-
*
|
|
127
|
-
*/
|
|
128
|
-
export interface GeoPoint {
|
|
129
|
-
lat: number;
|
|
130
|
-
lon: number;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* A WGS-84 bounding box. Used as a hard filter via `FindPlaceQuery.bbox`.
|
|
134
|
-
*/
|
|
135
|
-
export interface GeoBbox {
|
|
136
|
-
minLat: number;
|
|
137
|
-
maxLat: number;
|
|
138
|
-
minLon: number;
|
|
139
|
-
maxLon: number;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Query against the resolver.
|
|
84
|
+
* Describes a place lookup.
|
|
143
85
|
*
|
|
144
|
-
* `text`
|
|
145
|
-
* `
|
|
146
|
-
*
|
|
147
|
-
* `near` and `bbox` are independent. `near` is a soft signal — candidates close to the point get a ranking boost but
|
|
148
|
-
* distant candidates aren't dropped. `bbox` is a hard filter — only candidates whose bbox intersects the query bbox are
|
|
149
|
-
* returned (uses the package-built R*Tree index when present; if the index is missing the option is silently ignored to
|
|
150
|
-
* preserve backwards compatibility).
|
|
151
|
-
*
|
|
152
|
-
* `near` may carry `maxDistanceKm` to escalate from a boost to a hard filter — candidates further than that distance
|
|
153
|
-
* from the point are dropped at the SQL level via an R*Tree pre-filter.
|
|
86
|
+
* Every field except `text` narrows or ranks the search.
|
|
87
|
+
* An extract without the R*Tree index ignores `bbox` and `near.maxDistanceKm` without an error.
|
|
154
88
|
*/
|
|
155
89
|
export interface FindPlaceQuery {
|
|
156
90
|
text: string;
|
|
157
91
|
placetype?: WOFPlacetype | WOFPlacetype[];
|
|
158
92
|
/**
|
|
159
|
-
* ISO 3166-1 alpha-2
|
|
93
|
+
* Restricts matches to one ISO 3166-1 alpha-2 country.
|
|
160
94
|
*/
|
|
161
95
|
country?: string;
|
|
162
96
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* rather than falling through to a world-fuzzy candidate. Ignored when `country` is set (already narrower).
|
|
97
|
+
* Restricts the typo-fuzzy tier to one ISO 3166-1 alpha-2 country, returning no
|
|
98
|
+
* result on a miss rather than falling back worldwide.
|
|
99
|
+
* Ignored when `country` is set.
|
|
167
100
|
*/
|
|
168
101
|
fuzzyCountry?: string;
|
|
169
102
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* `@mailwoman/core/resolver`.
|
|
103
|
+
* Whether to match only primary names, set by probes that re-read a token from
|
|
104
|
+
* a longer span because that token was never an alias.
|
|
173
105
|
*/
|
|
174
106
|
primaryOnly?: boolean;
|
|
175
107
|
/**
|
|
176
|
-
* Alias
|
|
177
|
-
*
|
|
108
|
+
* Alias name roles, such as `abbr` or `gloss`, that the probe excludes.
|
|
109
|
+
*
|
|
110
|
+
* Rows with no role and artifacts without a role column are unaffected.
|
|
178
111
|
*/
|
|
179
112
|
excludeNameRoles?: readonly string[];
|
|
180
113
|
/**
|
|
181
|
-
*
|
|
114
|
+
* Restricts matches to descendants of this WOF place id.
|
|
182
115
|
*/
|
|
183
116
|
parentID?: number;
|
|
184
117
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
118
|
+
* The sibling postcode for a `locality` query.
|
|
119
|
+
*
|
|
120
|
+
* A `postcode_locality` table adds that postcode's localities and scores them on a
|
|
121
|
+
* weighted blend so small localities a name match misses are found.
|
|
189
122
|
*/
|
|
190
123
|
postcode?: string;
|
|
191
124
|
/**
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* the rest appended in their original order. Set by the resolver from `ResolveOpts.postcodeContainmentCoherence`;
|
|
195
|
-
* absent → the population-first order is untouched (byte-identical).
|
|
125
|
+
* Whether a locality query with `postcode` moves candidates near the postcode's centroid
|
|
126
|
+
* to the front, sorted by distance, with the rest keeping their order.
|
|
196
127
|
*/
|
|
197
128
|
postcodeContainmentCoherence?: boolean;
|
|
198
129
|
/**
|
|
199
|
-
* The
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
130
|
+
* The parsed region qualifier for a locality lookup.
|
|
131
|
+
*
|
|
132
|
+
* A backend with the ancestors sidecar marks contained candidates.
|
|
133
|
+
* It ranks them first.
|
|
134
|
+
*
|
|
135
|
+
* It may add candidates hidden by a country scope.
|
|
136
|
+
* It never removes candidates.
|
|
204
137
|
*/
|
|
205
138
|
regionQualifier?: string;
|
|
206
139
|
/**
|
|
207
|
-
*
|
|
140
|
+
* A proximity hint that boosts nearby candidates and filters by radius only when `maxDistanceKm` is set.
|
|
208
141
|
*/
|
|
209
|
-
near?:
|
|
142
|
+
near?: LatLon & {
|
|
210
143
|
maxDistanceKm?: number;
|
|
211
144
|
};
|
|
212
145
|
/**
|
|
213
|
-
* Ordered proximity-bias points
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* back-compat.
|
|
146
|
+
* Ordered proximity-bias points with an optional weight defaulting to 1.
|
|
147
|
+
*
|
|
148
|
+
* The bias re-ranks exact-tier candidates by combined prominence.
|
|
149
|
+
* It keeps every candidate.
|
|
150
|
+
* It counts `near` as weight 1.
|
|
219
151
|
*/
|
|
220
|
-
bias?: Array<
|
|
152
|
+
bias?: Array<LatLon & {
|
|
221
153
|
weight?: number;
|
|
222
154
|
}>;
|
|
223
155
|
/**
|
|
224
|
-
*
|
|
156
|
+
* Returns only candidates whose bounding box intersects this box.
|
|
225
157
|
*/
|
|
226
|
-
bbox?:
|
|
158
|
+
bbox?: LatLonBounds;
|
|
227
159
|
/**
|
|
228
|
-
*
|
|
160
|
+
* The maximum number of candidates to return, defaulting to 10.
|
|
229
161
|
*/
|
|
230
162
|
limit?: number;
|
|
231
163
|
}
|
|
232
164
|
/**
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
* a public API break.
|
|
165
|
+
* Resolves a {@link FindPlaceQuery} to ranked {@link PlaceCandidate}s, asynchronously
|
|
166
|
+
* so a worker-backed implementation can share the interface.
|
|
236
167
|
*/
|
|
237
168
|
export interface PlaceLookup extends Disposable {
|
|
238
169
|
findPlace(query: FindPlaceQuery): Promise<PlaceCandidate[]>;
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAE9D;;GAEG;AACH,MAAM,MAAM,YAAY,GACrB,SAAS,GACT,aAAa,GACb,QAAQ,GACR,aAAa,GACb,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,SAAS,GACT,eAAe,GACf,WAAW,GACX,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,SAAS,CAAA;AAEZ;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,YAAY,CAAA;IAEvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IAEX;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAA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GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAA;CAC3D"}
|
package/out/types.js
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Public surface for the WOF SQLite resolver — types only, no runtime.
|
|
7
|
-
*
|
|
8
|
-
* These mirror the conceptual model described in `docs/plan/phases/PHASE_4_2_wof_sqlite.md`. Phase
|
|
9
|
-
* 4.3 will extend `PlaceCandidate` with the resolver-decorated fields that flow into
|
|
10
|
-
* `AddressNode.source` / `sourceID` (e.g. an explicit `wofURI: "wof-admin:101751113"` form).
|
|
11
5
|
*/
|
|
12
6
|
export {};
|
|
13
7
|
//# sourceMappingURL=types.js.map
|
package/out/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/out/unified-schema.d.ts
CHANGED
|
@@ -3,23 +3,19 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* table (which lookup.ts's parent-constraint subquery needs) — see `populateAncestors`. The
|
|
12
|
-
* `place_search` FTS5 + `place_bbox` R*Tree are built separately by `build-fts` (fts.ts).
|
|
6
|
+
* Schema for the unified WOF SQLite database built from cloned WOF GeoJSON repos
|
|
7
|
+
* (`scripts/build-unified-wof.ts`). The table and column names match the resolver's
|
|
8
|
+
* expectations (`lookup.ts`) so `WOFSQLitePlaceLookup` works unchanged. The `ancestors` table
|
|
9
|
+
* table is what lookup.ts's parent-constraint subquery reads (see `populateAncestors`).
|
|
10
|
+
* The `place_search` FTS5 and `place_bbox` R*Tree tables are built separately by `build-fts` (fts.ts).
|
|
13
11
|
*/
|
|
14
12
|
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
15
13
|
import type { WOFDatabase } from "#schema";
|
|
16
14
|
export declare function createUnifiedSchema(db: DatabaseClient<WOFDatabase>): Promise<void>;
|
|
17
15
|
/**
|
|
18
|
-
* Populate the `ancestors` table by walking each place's `parent_id` chain in `spr`
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Sentinel/negative parent_ids and cycles terminate the walk. ~4 rows/place average; a transaction keeps the ~5M
|
|
22
|
-
* inserts fast.
|
|
16
|
+
* Populate the `ancestors` table by walking each place's `parent_id` chain in `spr`
|
|
17
|
+
* to a transitive closure that includes the place itself.
|
|
18
|
+
* Run this after `spr` is fully ingested.
|
|
23
19
|
*/
|
|
24
20
|
export declare function populateAncestors<DB>(db: DatabaseClient<DB>): number;
|
|
25
21
|
export declare function createUnifiedIndexes(db: DatabaseClient<WOFDatabase>): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-schema.d.ts","sourceRoot":"","sources":["../lib/unified-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"unified-schema.d.ts","sourceRoot":"","sources":["../lib/unified-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFxF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,GAAG,MAAM,CAyCpE;AAED,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBzF"}
|
package/out/unified-schema.js
CHANGED
|
@@ -3,21 +3,20 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* table (which lookup.ts's parent-constraint subquery needs) — see `populateAncestors`. The
|
|
12
|
-
* `place_search` FTS5 + `place_bbox` R*Tree are built separately by `build-fts` (fts.ts).
|
|
6
|
+
* Schema for the unified WOF SQLite database built from cloned WOF GeoJSON repos
|
|
7
|
+
* (`scripts/build-unified-wof.ts`). The table and column names match the resolver's
|
|
8
|
+
* expectations (`lookup.ts`) so `WOFSQLitePlaceLookup` works unchanged. The `ancestors` table
|
|
9
|
+
* table is what lookup.ts's parent-constraint subquery reads (see `populateAncestors`).
|
|
10
|
+
* The `place_search` FTS5 and `place_bbox` R*Tree tables are built separately by `build-fts` (fts.ts).
|
|
13
11
|
*/
|
|
14
12
|
export async function createUnifiedSchema(db) {
|
|
15
|
-
// PRAGMAs
|
|
13
|
+
// PRAGMAs run raw because Kysely does not model them.
|
|
14
|
+
// They tune the bulk build.
|
|
16
15
|
db.exec("PRAGMA journal_mode = WAL");
|
|
17
16
|
db.exec("PRAGMA busy_timeout = 10000");
|
|
18
17
|
db.exec("PRAGMA synchronous = OFF");
|
|
19
|
-
//
|
|
20
|
-
//
|
|
18
|
+
// The caller owns `db`'s lifecycle, so this function does not destroy it.
|
|
19
|
+
// The bulk INSERTs (populateAncestors + build-unified-wof) run on the raw handle.
|
|
21
20
|
await db.schema
|
|
22
21
|
.createTable("spr")
|
|
23
22
|
.ifNotExists()
|
|
@@ -39,12 +38,16 @@ export async function createUnifiedSchema(db) {
|
|
|
39
38
|
.addColumn("is_superseding", "integer", (c) => c.notNull().defaultTo(0))
|
|
40
39
|
.addColumn("lastmodified", "integer", (c) => c.notNull().defaultTo(0))
|
|
41
40
|
.execute();
|
|
42
|
-
// `privateuse`
|
|
43
|
-
// ("preferred" | "").
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
//
|
|
41
|
+
// `privateuse` represents WOF's x_<variant> kind (preferred | variant) or GeoNames'
|
|
42
|
+
// isPreferredName ("preferred" | "").
|
|
43
|
+
// `official` is the ingest bit.
|
|
44
|
+
// It is 1 when the row's language is an official language of the place's country
|
|
45
|
+
// (codex OFFICIAL_LANGUAGES) and the row is a preferred form. x_variant rows
|
|
46
|
+
// tagged with an official language ("MSP", "Frisco") stay 0.
|
|
47
|
+
// Primary-name mirror rows stay 0 too.
|
|
48
|
+
// The name-exact tier already consults spr.name.
|
|
49
|
+
// `official` only marks the aliases eligible to join it.
|
|
50
|
+
// Both are ingest-time facts, never computed at query time.
|
|
48
51
|
await db.schema
|
|
49
52
|
.createTable("names")
|
|
50
53
|
.ifNotExists()
|
|
@@ -71,11 +74,12 @@ export async function createUnifiedSchema(db) {
|
|
|
71
74
|
.addColumn("id", "integer", (c) => c.primaryKey())
|
|
72
75
|
.addColumn("population", "integer", (c) => c.notNull().defaultTo(0))
|
|
73
76
|
.execute();
|
|
74
|
-
// `ancestors` maps each place to every place above it in the hierarchy (and itself).
|
|
75
|
-
// resolver's parent-constraint scopes a child lookup to a parent's descendants
|
|
76
|
-
// `spr.id IN (
|
|
77
|
-
//
|
|
78
|
-
//
|
|
77
|
+
// `ancestors` maps each place to every place above it in the hierarchy (and itself).
|
|
78
|
+
// The resolver's parent-constraint scopes a child lookup to a parent's descendants
|
|
79
|
+
// via `spr.id IN (select id from ancestors where ancestor_id = ?)`.
|
|
80
|
+
// The off-the-shelf WOF dumps ship this table.
|
|
81
|
+
// Our build derives it from the parent_id chain (see populateAncestors)
|
|
82
|
+
// since we don't capture `wof:hierarchy`.
|
|
79
83
|
await db.schema
|
|
80
84
|
.createTable("ancestors")
|
|
81
85
|
.ifNotExists()
|
|
@@ -86,11 +90,9 @@ export async function createUnifiedSchema(db) {
|
|
|
86
90
|
.execute();
|
|
87
91
|
}
|
|
88
92
|
/**
|
|
89
|
-
* Populate the `ancestors` table by walking each place's `parent_id` chain in `spr`
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* Sentinel/negative parent_ids and cycles terminate the walk. ~4 rows/place average; a transaction keeps the ~5M
|
|
93
|
-
* inserts fast.
|
|
93
|
+
* Populate the `ancestors` table by walking each place's `parent_id` chain in `spr`
|
|
94
|
+
* to a transitive closure that includes the place itself.
|
|
95
|
+
* Run this after `spr` is fully ingested.
|
|
94
96
|
*/
|
|
95
97
|
export function populateAncestors(db) {
|
|
96
98
|
db.exec("DELETE FROM ancestors");
|
|
@@ -104,7 +106,6 @@ export function populateAncestors(db) {
|
|
|
104
106
|
let count = 0;
|
|
105
107
|
for (const r of rows) {
|
|
106
108
|
insert.run(r.id, r.id, r.placetype);
|
|
107
|
-
// self
|
|
108
109
|
count++;
|
|
109
110
|
const seen = new Set([r.id]);
|
|
110
111
|
let cur = r.parent_id;
|
|
@@ -139,8 +140,7 @@ export async function createUnifiedIndexes(db) {
|
|
|
139
140
|
.on("concordances")
|
|
140
141
|
.columns(["other_source", "other_id"])
|
|
141
142
|
.execute();
|
|
142
|
-
// ancestor_id is the hot column
|
|
143
|
-
// the reverse lookup.
|
|
143
|
+
// ancestor_id is the hot column for parent-constraint queries. id supports the reverse lookup.
|
|
144
144
|
await db.schema.createIndex("ancestors_by_ancestor").ifNotExists().on("ancestors").column("ancestor_id").execute();
|
|
145
145
|
await db.schema.createIndex("ancestors_by_id").ifNotExists().on("ancestors").column("id").execute();
|
|
146
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unified-schema.js","sourceRoot":"","sources":["../lib/unified-schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"unified-schema.js","sourceRoot":"","sources":["../lib/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ructs: "callers building negative evidence must consult
|
|
6
|
-
* `readLayerCoverage`, not this reader
|
|
7
|
-
* or
|
|
6
|
+
* `readLayerCoverage`, not this reader by itself." A bare `null` from `nearestUPRN` is two different facts — no uprn here,
|
|
7
|
+
* or an unsurveyed area — and this is the only place that separates them. It answers an {@link Exclusion} or `null`,
|
|
8
8
|
* so a caller cannot read an unsurveyed cell as an empty one by accident.
|
|
9
9
|
*
|
|
10
|
-
* `radiusM` is a
|
|
11
|
-
* this coordinate" and "is this street built at all", and picking one here would bury that choice where
|
|
10
|
+
* `radiusM` is a caller'S parameter with no default. There is no radius that is correct for both "which property is
|
|
11
|
+
* this coordinate" and "is this street built at all", and picking one here would bury that choice where reviewers
|
|
12
12
|
* reviewing an exclusion can see it.
|
|
13
13
|
*/
|
|
14
|
-
import { type
|
|
14
|
+
import { type layerschemahandle } from "@mailwoman/core/layers";
|
|
15
15
|
import { type Exclusion } from "@mailwoman/evidence";
|
|
16
16
|
import type { UPRNLookup } from "#uprn/lookup";
|
|
17
17
|
/**
|
|
18
|
-
* The identity fold, on purpose: this probe keys on a
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* The identity fold, on purpose: this probe keys on a coordinate rather than a name,
|
|
19
|
+
* so there is no string folding for the builder and the probe to disagree about.
|
|
20
|
+
*
|
|
21
|
+
* The same identity in both `probeFold` and `layerFold` records that the fold axis
|
|
22
|
+
* is not in play here, rather than silently omitting the check.
|
|
23
|
+
* It is not a stub.
|
|
21
24
|
*/
|
|
22
25
|
export declare const UPRN_EXISTENCE_FOLD: string;
|
|
23
26
|
/**
|
|
24
|
-
* The countries OS Open
|
|
25
|
-
*
|
|
27
|
+
* The countries OS Open uprn covers.
|
|
28
|
+
*
|
|
29
|
+
* Northern Ireland is outside the product, so a `null` there is unknown
|
|
30
|
+
* and must never become evidence of absence.
|
|
31
|
+
* The country check is what keeps it out.
|
|
26
32
|
*/
|
|
27
33
|
export declare const UPRN_COVERED_COUNTRIES: ReadonlySet<string>;
|
|
28
34
|
export interface UPRNAbsenceInput {
|
|
29
35
|
lookup: UPRNLookup;
|
|
30
36
|
/**
|
|
31
|
-
* The same file the lookup reads
|
|
37
|
+
* The same file the lookup reads.
|
|
38
|
+
* The layer interface tables live beside the points.
|
|
32
39
|
*/
|
|
33
|
-
|
|
40
|
+
schemadb: layerschemahandle;
|
|
34
41
|
latitude: number;
|
|
35
42
|
longitude: number;
|
|
36
43
|
radiusM: number;
|
|
@@ -40,14 +47,18 @@ export interface UPRNAbsenceInput {
|
|
|
40
47
|
country?: string;
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
43
|
-
* The coverage cell a coordinate falls in, derived from its stored res-9 cell exactly
|
|
44
|
-
*
|
|
50
|
+
* The coverage cell a coordinate falls in, derived from its stored res-9 cell exactly
|
|
51
|
+
* as the builder derives it rather than from the centroid.
|
|
52
|
+
*
|
|
53
|
+
* The centroid lands in a different parent for a fraction of cells.
|
|
45
54
|
*/
|
|
46
55
|
export declare function uprnCoverageCell(latitude: number, longitude: number): number;
|
|
47
56
|
/**
|
|
48
|
-
* An {@link Exclusion} when no
|
|
49
|
-
* (presence is not this probe's business) and on every refusal
|
|
50
|
-
*
|
|
57
|
+
* An {@link Exclusion} when no uprn lies within `radiusM` and the layer's coverage licenses
|
|
58
|
+
* saying so; `null` on a hit (presence is not this probe's business) and on every refusal
|
|
59
|
+
* (unsurveyed cell, `source_present` basis, a country the product does not cover).
|
|
60
|
+
*
|
|
61
|
+
* Never throws on a refusal: the caller falls open to the ranking it already had.
|
|
51
62
|
*/
|
|
52
63
|
export declare function uprnAbsenceAt(input: UPRNAbsenceInput): Promise<Exclusion | null>;
|
|
53
64
|
//# sourceMappingURL=existence.d.ts.map
|