@mailwoman/resolver-wof-sqlite 11.0.0 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/lib/address/duplicate.ts +133 -0
- package/lib/address/keys/attribution.ts +119 -0
- package/lib/address/keys/build.ts +768 -0
- package/lib/address/keys/layout.ts +166 -0
- package/lib/address/keys/local-runner.ts +18 -0
- package/lib/address/keys/lookup.ts +205 -0
- package/lib/address/keys/open.ts +33 -0
- package/lib/address/keys/point-lookup.ts +130 -0
- package/lib/address/keys/postcode.ts +27 -0
- package/lib/address/keys/schema.ts +264 -0
- package/lib/address/number-forms.ts +61 -0
- package/lib/address/point/interpolation.ts +28 -23
- package/lib/address/point/schema.ts +2 -5
- package/lib/address/point/spine-schema.ts +4 -4
- package/lib/address/point.ts +12 -79
- package/lib/address/record.ts +155 -0
- package/lib/address/stack.ts +20 -0
- package/lib/address/subdivision-bounds.ts +81 -0
- package/lib/address.ts +2 -5
- package/lib/ancestry/backfill.ts +18 -47
- package/lib/ancestry.ts +10 -10
- package/lib/build/candidate.ts +44 -48
- package/lib/build/population-corrections.ts +4 -4
- package/lib/build/slim.ts +3 -6
- package/lib/candidate/alias-bags.ts +58 -18
- package/lib/candidate/ancestors/schema.ts +63 -43
- package/lib/candidate/ancestors/sidecar.ts +3 -3
- package/lib/candidate/bare-admin-names.ts +3 -3
- package/lib/candidate/country-display-names.ts +2 -5
- package/lib/candidate/extract-fold.ts +2 -5
- package/lib/candidate/fts.ts +5 -5
- package/lib/candidate/importance.ts +30 -24
- package/lib/candidate/key-fold.ts +132 -0
- package/lib/candidate/lookup.ts +25 -18
- package/lib/candidate/name-roles.ts +4 -4
- package/lib/candidate/nickname-namesakes.ts +140 -0
- package/lib/candidate/own-name.ts +12 -10
- package/lib/candidate/place-attrs.ts +4 -4
- package/lib/candidate/schema.ts +2 -5
- package/lib/candidate/scoring.ts +3 -6
- package/lib/capital-schema.ts +11 -10
- package/lib/capitals.ts +15 -12
- package/lib/convention/schema.ts +7 -7
- package/lib/convention.ts +3 -3
- package/lib/coverage-manifest-schema.ts +4 -4
- package/lib/env.ts +7 -6
- package/lib/exact-match.ts +6 -7
- package/lib/extracts.ts +11 -9
- package/lib/fst/autocomplete.ts +19 -15
- package/lib/fst/binary-matcher.ts +36 -50
- package/lib/fst/builder.ts +32 -11
- package/lib/fst/deserialize-web.ts +9 -8
- package/lib/fst/format.ts +153 -14
- package/lib/fst/freshness.ts +3 -4
- package/lib/fst/matcher.ts +6 -6
- package/lib/fst/serialize.ts +94 -69
- package/lib/fst/types.ts +4 -4
- package/lib/fst.ts +2 -5
- package/lib/fts/query.ts +3 -4
- package/lib/fts.ts +2 -5
- package/lib/geonames/aliases.ts +189 -46
- package/lib/geonames/postal.ts +17 -15
- package/lib/geonames.ts +2 -5
- package/lib/importance-source.ts +210 -0
- package/lib/index.ts +4 -5
- package/lib/interpolation.ts +7 -6
- package/lib/landmark/rows.ts +5 -5
- package/lib/landmark.ts +6 -6
- package/lib/lookup.ts +8 -8
- package/lib/name-score.ts +7 -6
- package/lib/nsul/lookup.ts +19 -15
- package/lib/nsul/schema.ts +4 -5
- package/lib/nsul.ts +2 -5
- package/lib/paths.ts +7 -7
- package/lib/place-importance-schema.ts +5 -8
- package/lib/poi/lookup.ts +11 -10
- package/lib/poi/schema.ts +16 -10
- package/lib/poi.ts +2 -5
- package/lib/polygon-schema.ts +10 -9
- package/lib/postal/city/alias/lookup.ts +14 -13
- package/lib/postal/city/alias/schema.ts +12 -12
- package/lib/postal/city/candidate-schema.ts +15 -12
- package/lib/postal.ts +2 -5
- package/lib/postcode-point-lookup.ts +2 -5
- package/lib/primary-preference.ts +42 -7
- package/lib/proximity-rerank.ts +23 -19
- package/lib/ranking-weights.ts +8 -7
- package/lib/region-keys.ts +15 -14
- package/lib/reverse.ts +16 -17
- package/lib/schema.ts +20 -6
- package/lib/search-fetch.ts +15 -11
- package/lib/sqlite/convention-source.ts +2 -5
- package/lib/sqlite/utils.ts +4 -4
- package/lib/street/centroid/schema.ts +6 -6
- package/lib/street/centroid.ts +3 -3
- package/lib/street/locale.ts +64 -0
- package/lib/street/morphology/fst/builder.ts +21 -19
- package/lib/street/morphology/fst/loader.ts +15 -13
- package/lib/street/name-lookup.ts +15 -14
- package/lib/street/normalize.ts +62 -17
- package/lib/street/segment-schema.ts +16 -14
- package/lib/street/table.ts +276 -0
- package/lib/street.ts +3 -5
- package/lib/types.ts +3 -6
- package/lib/unified-schema.ts +31 -9
- package/lib/uprn/existence.ts +10 -10
- package/lib/uprn/lookup.ts +7 -8
- package/lib/uprn/schema.ts +5 -5
- package/lib/uprn.ts +2 -5
- package/lib/weights-overlay-linker.ts +5 -8
- package/out/address/duplicate.d.ts +74 -0
- package/out/address/duplicate.d.ts.map +1 -0
- package/out/address/duplicate.js +79 -0
- package/out/address/duplicate.js.map +1 -0
- package/out/address/keys/attribution.d.ts +56 -0
- package/out/address/keys/attribution.d.ts.map +1 -0
- package/out/address/keys/attribution.js +64 -0
- package/out/address/keys/attribution.js.map +1 -0
- package/out/address/keys/build.d.ts +154 -0
- package/out/address/keys/build.d.ts.map +1 -0
- package/out/address/keys/build.js +423 -0
- package/out/address/keys/build.js.map +1 -0
- package/out/address/keys/layout.d.ts +92 -0
- package/out/address/keys/layout.d.ts.map +1 -0
- package/out/address/keys/layout.js +87 -0
- package/out/address/keys/layout.js.map +1 -0
- package/out/address/keys/local-runner.d.ts +9 -0
- package/out/address/keys/local-runner.d.ts.map +1 -0
- package/out/address/keys/local-runner.js +13 -0
- package/out/address/keys/local-runner.js.map +1 -0
- package/out/address/keys/lookup.d.ts +80 -0
- package/out/address/keys/lookup.d.ts.map +1 -0
- package/out/address/keys/lookup.js +104 -0
- package/out/address/keys/lookup.js.map +1 -0
- package/out/address/keys/open.d.ts +10 -0
- package/out/address/keys/open.d.ts.map +1 -0
- package/out/address/keys/open.js +28 -0
- package/out/address/keys/open.js.map +1 -0
- package/out/address/keys/point-lookup.d.ts +25 -0
- package/out/address/keys/point-lookup.d.ts.map +1 -0
- package/out/address/keys/point-lookup.js +100 -0
- package/out/address/keys/point-lookup.js.map +1 -0
- package/out/address/keys/postcode.d.ts +9 -0
- package/out/address/keys/postcode.d.ts.map +1 -0
- package/out/address/keys/postcode.js +25 -0
- package/out/address/keys/postcode.js.map +1 -0
- package/out/address/keys/schema.d.ts +156 -0
- package/out/address/keys/schema.d.ts.map +1 -0
- package/out/address/keys/schema.js +119 -0
- package/out/address/keys/schema.js.map +1 -0
- package/out/address/number-forms.d.ts +19 -0
- package/out/address/number-forms.d.ts.map +1 -0
- package/out/address/number-forms.js +50 -0
- package/out/address/number-forms.js.map +1 -0
- package/out/address/point/interpolation.d.ts +24 -22
- package/out/address/point/interpolation.d.ts.map +1 -1
- package/out/address/point/interpolation.js +3 -31
- package/out/address/point/interpolation.js.map +1 -1
- package/out/address/point/schema.d.ts +0 -5
- package/out/address/point/schema.d.ts.map +1 -1
- package/out/address/point/schema.js +2 -5
- package/out/address/point/schema.js.map +1 -1
- package/out/address/point/spine-schema.d.ts +1 -4
- package/out/address/point/spine-schema.d.ts.map +1 -1
- package/out/address/point/spine-schema.js +3 -4
- package/out/address/point/spine-schema.js.map +1 -1
- package/out/address/point.d.ts +0 -3
- package/out/address/point.d.ts.map +1 -1
- package/out/address/point.js +12 -71
- package/out/address/point.js.map +1 -1
- package/out/address/record.d.ts +125 -0
- package/out/address/record.d.ts.map +1 -0
- package/out/address/record.js +49 -0
- package/out/address/record.js.map +1 -0
- package/out/address/stack.d.ts +14 -0
- package/out/address/stack.d.ts.map +1 -0
- package/out/address/stack.js +19 -0
- package/out/address/stack.js.map +1 -0
- package/out/address/subdivision-bounds.d.ts +32 -0
- package/out/address/subdivision-bounds.d.ts.map +1 -0
- package/out/address/subdivision-bounds.js +48 -0
- package/out/address/subdivision-bounds.js.map +1 -0
- package/out/address.d.ts +0 -5
- package/out/address.d.ts.map +1 -1
- package/out/address.js +2 -5
- package/out/address.js.map +1 -1
- package/out/ancestry/backfill.d.ts +11 -13
- package/out/ancestry/backfill.d.ts.map +1 -1
- package/out/ancestry/backfill.js +6 -44
- package/out/ancestry/backfill.js.map +1 -1
- package/out/ancestry.d.ts +0 -14
- package/out/ancestry.d.ts.map +1 -1
- package/out/ancestry.js +9 -10
- package/out/ancestry.js.map +1 -1
- package/out/build/candidate.d.ts +20 -22
- package/out/build/candidate.d.ts.map +1 -1
- package/out/build/candidate.js +16 -28
- package/out/build/candidate.js.map +1 -1
- package/out/build/population-corrections.d.ts +1 -4
- package/out/build/population-corrections.d.ts.map +1 -1
- package/out/build/population-corrections.js +2 -19
- package/out/build/population-corrections.js.map +1 -1
- package/out/build/slim.d.ts +0 -5
- package/out/build/slim.d.ts.map +1 -1
- package/out/build/slim.js +3 -6
- package/out/build/slim.js.map +1 -1
- package/out/candidate/alias-bags.d.ts +9 -4
- package/out/candidate/alias-bags.d.ts.map +1 -1
- package/out/candidate/alias-bags.js +46 -19
- package/out/candidate/alias-bags.js.map +1 -1
- package/out/candidate/ancestors/schema.d.ts +60 -43
- package/out/candidate/ancestors/schema.d.ts.map +1 -1
- package/out/candidate/ancestors/schema.js +62 -43
- package/out/candidate/ancestors/schema.js.map +1 -1
- package/out/candidate/ancestors/sidecar.d.ts +0 -3
- package/out/candidate/ancestors/sidecar.d.ts.map +1 -1
- package/out/candidate/ancestors/sidecar.js +2 -6
- package/out/candidate/ancestors/sidecar.js.map +1 -1
- package/out/candidate/bare-admin-names.d.ts +0 -6
- package/out/candidate/bare-admin-names.d.ts.map +1 -1
- package/out/candidate/bare-admin-names.js +2 -3
- package/out/candidate/bare-admin-names.js.map +1 -1
- package/out/candidate/country-display-names.d.ts +0 -5
- package/out/candidate/country-display-names.d.ts.map +1 -1
- package/out/candidate/country-display-names.js +2 -5
- package/out/candidate/country-display-names.js.map +1 -1
- package/out/candidate/extract-fold.d.ts +0 -5
- package/out/candidate/extract-fold.d.ts.map +1 -1
- package/out/candidate/extract-fold.js +2 -5
- package/out/candidate/extract-fold.js.map +1 -1
- package/out/candidate/fts.d.ts +2 -5
- package/out/candidate/fts.d.ts.map +1 -1
- package/out/candidate/fts.js +2 -7
- package/out/candidate/fts.js.map +1 -1
- package/out/candidate/importance.d.ts +3 -33
- package/out/candidate/importance.d.ts.map +1 -1
- package/out/candidate/importance.js +29 -24
- package/out/candidate/importance.js.map +1 -1
- package/out/candidate/key-fold.d.ts +55 -0
- package/out/candidate/key-fold.d.ts.map +1 -0
- package/out/candidate/key-fold.js +80 -0
- package/out/candidate/key-fold.js.map +1 -0
- package/out/candidate/lookup.d.ts +0 -5
- package/out/candidate/lookup.d.ts.map +1 -1
- package/out/candidate/lookup.js +24 -17
- package/out/candidate/lookup.js.map +1 -1
- package/out/candidate/name-roles.d.ts +0 -6
- package/out/candidate/name-roles.d.ts.map +1 -1
- package/out/candidate/name-roles.js +3 -4
- package/out/candidate/name-roles.js.map +1 -1
- package/out/candidate/nickname-namesakes.d.ts +32 -0
- package/out/candidate/nickname-namesakes.d.ts.map +1 -0
- package/out/candidate/nickname-namesakes.js +98 -0
- package/out/candidate/nickname-namesakes.js.map +1 -0
- package/out/candidate/own-name.d.ts +0 -18
- package/out/candidate/own-name.d.ts.map +1 -1
- package/out/candidate/own-name.js +11 -10
- package/out/candidate/own-name.js.map +1 -1
- package/out/candidate/place-attrs.d.ts +1 -4
- package/out/candidate/place-attrs.d.ts.map +1 -1
- package/out/candidate/place-attrs.js +2 -12
- package/out/candidate/place-attrs.js.map +1 -1
- package/out/candidate/schema.d.ts +0 -5
- package/out/candidate/schema.d.ts.map +1 -1
- package/out/candidate/schema.js +2 -5
- package/out/candidate/schema.js.map +1 -1
- package/out/candidate/scoring.d.ts +0 -5
- package/out/candidate/scoring.d.ts.map +1 -1
- package/out/candidate/scoring.js +3 -6
- package/out/candidate/scoring.js.map +1 -1
- package/out/capital-schema.d.ts +0 -14
- package/out/capital-schema.d.ts.map +1 -1
- package/out/capital-schema.js +10 -10
- package/out/capital-schema.js.map +1 -1
- package/out/capitals.d.ts +0 -16
- package/out/capitals.d.ts.map +1 -1
- package/out/capitals.js +14 -12
- package/out/capitals.js.map +1 -1
- package/out/convention/schema.d.ts +4 -7
- package/out/convention/schema.d.ts.map +1 -1
- package/out/convention/schema.js +2 -10
- package/out/convention/schema.js.map +1 -1
- package/out/convention.d.ts +0 -3
- package/out/convention.d.ts.map +1 -1
- package/out/convention.js +2 -8
- package/out/convention.js.map +1 -1
- package/out/coverage-manifest-schema.d.ts +1 -4
- package/out/coverage-manifest-schema.d.ts.map +1 -1
- package/out/coverage-manifest-schema.js +2 -3
- package/out/coverage-manifest-schema.js.map +1 -1
- package/out/env.d.ts +0 -8
- package/out/env.d.ts.map +1 -1
- package/out/env.js +6 -6
- package/out/env.js.map +1 -1
- package/out/exact-match.d.ts +2 -6
- package/out/exact-match.d.ts.map +1 -1
- package/out/exact-match.js +3 -9
- package/out/exact-match.js.map +1 -1
- package/out/extracts.d.ts +8 -9
- package/out/extracts.d.ts.map +1 -1
- package/out/extracts.js +9 -8
- package/out/extracts.js.map +1 -1
- package/out/fst/autocomplete.d.ts +1 -19
- package/out/fst/autocomplete.d.ts.map +1 -1
- package/out/fst/autocomplete.js +2 -18
- package/out/fst/autocomplete.js.map +1 -1
- package/out/fst/binary-matcher.d.ts +6 -8
- package/out/fst/binary-matcher.d.ts.map +1 -1
- package/out/fst/binary-matcher.js +12 -43
- package/out/fst/binary-matcher.js.map +1 -1
- package/out/fst/builder.d.ts +0 -12
- package/out/fst/builder.d.ts.map +1 -1
- package/out/fst/builder.js +23 -11
- package/out/fst/builder.js.map +1 -1
- package/out/fst/deserialize-web.d.ts +1 -12
- package/out/fst/deserialize-web.d.ts.map +1 -1
- package/out/fst/deserialize-web.js +8 -8
- package/out/fst/deserialize-web.js.map +1 -1
- package/out/fst/format.d.ts +66 -16
- package/out/fst/format.d.ts.map +1 -1
- package/out/fst/format.js +100 -16
- package/out/fst/format.js.map +1 -1
- package/out/fst/freshness.d.ts +0 -7
- package/out/fst/freshness.d.ts.map +1 -1
- package/out/fst/freshness.js +2 -4
- package/out/fst/freshness.js.map +1 -1
- package/out/fst/matcher.d.ts +3 -6
- package/out/fst/matcher.d.ts.map +1 -1
- package/out/fst/matcher.js +2 -9
- package/out/fst/matcher.js.map +1 -1
- package/out/fst/serialize.d.ts +0 -23
- package/out/fst/serialize.d.ts.map +1 -1
- package/out/fst/serialize.js +68 -60
- package/out/fst/serialize.js.map +1 -1
- package/out/fst/types.d.ts +1 -4
- package/out/fst/types.d.ts.map +1 -1
- package/out/fst/types.js +2 -6
- package/out/fst/types.js.map +1 -1
- package/out/fst.d.ts +0 -5
- package/out/fst.d.ts.map +1 -1
- package/out/fst.js +2 -5
- package/out/fst.js.map +1 -1
- package/out/fts/query.d.ts +0 -4
- package/out/fts/query.d.ts.map +1 -1
- package/out/fts/query.js +2 -7
- package/out/fts/query.js.map +1 -1
- package/out/fts.d.ts +0 -5
- package/out/fts.d.ts.map +1 -1
- package/out/fts.js +2 -5
- package/out/fts.js.map +1 -1
- package/out/geonames/aliases.d.ts +43 -5
- package/out/geonames/aliases.d.ts.map +1 -1
- package/out/geonames/aliases.js +108 -44
- package/out/geonames/aliases.js.map +1 -1
- package/out/geonames/postal.d.ts +1 -25
- package/out/geonames/postal.d.ts.map +1 -1
- package/out/geonames/postal.js +15 -14
- package/out/geonames/postal.js.map +1 -1
- package/out/geonames.d.ts +0 -5
- package/out/geonames.d.ts.map +1 -1
- package/out/geonames.js +2 -5
- package/out/geonames.js.map +1 -1
- package/out/importance-source.d.ts +90 -0
- package/out/importance-source.d.ts.map +1 -0
- package/out/importance-source.js +133 -0
- package/out/importance-source.js.map +1 -0
- package/out/index.d.ts +2 -5
- package/out/index.d.ts.map +1 -1
- package/out/index.js +4 -5
- package/out/index.js.map +1 -1
- package/out/interpolation.d.ts +0 -7
- package/out/interpolation.d.ts.map +1 -1
- package/out/interpolation.js +6 -6
- package/out/interpolation.js.map +1 -1
- package/out/landmark/rows.d.ts +2 -5
- package/out/landmark/rows.d.ts.map +1 -1
- package/out/landmark/rows.js +2 -8
- package/out/landmark/rows.js.map +1 -1
- package/out/landmark.d.ts +3 -6
- package/out/landmark.d.ts.map +1 -1
- package/out/landmark.js +2 -8
- package/out/landmark.js.map +1 -1
- package/out/lookup.d.ts +0 -7
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +7 -8
- package/out/lookup.js.map +1 -1
- package/out/name-score.d.ts +4 -6
- package/out/name-score.d.ts.map +1 -1
- package/out/name-score.js +6 -6
- package/out/name-score.js.map +1 -1
- package/out/nsul/lookup.d.ts +16 -15
- package/out/nsul/lookup.d.ts.map +1 -1
- package/out/nsul/lookup.js +2 -25
- package/out/nsul/lookup.js.map +1 -1
- package/out/nsul/schema.d.ts +1 -5
- package/out/nsul/schema.d.ts.map +1 -1
- package/out/nsul/schema.js +3 -8
- package/out/nsul/schema.js.map +1 -1
- package/out/nsul.d.ts +0 -5
- package/out/nsul.d.ts.map +1 -1
- package/out/nsul.js +2 -5
- package/out/nsul.js.map +1 -1
- package/out/paths.d.ts +1 -13
- package/out/paths.d.ts.map +1 -1
- package/out/paths.js +6 -7
- package/out/paths.js.map +1 -1
- package/out/place-importance-schema.d.ts +3 -8
- package/out/place-importance-schema.d.ts.map +1 -1
- package/out/place-importance-schema.js +3 -6
- package/out/place-importance-schema.js.map +1 -1
- package/out/poi/lookup.d.ts +0 -13
- package/out/poi/lookup.d.ts.map +1 -1
- package/out/poi/lookup.js +10 -10
- package/out/poi/lookup.js.map +1 -1
- package/out/poi/schema.d.ts +13 -10
- package/out/poi/schema.d.ts.map +1 -1
- package/out/poi/schema.js +2 -13
- package/out/poi/schema.js.map +1 -1
- package/out/poi.d.ts +0 -5
- package/out/poi.d.ts.map +1 -1
- package/out/poi.js +2 -5
- package/out/poi.js.map +1 -1
- package/out/polygon-schema.d.ts +7 -9
- package/out/polygon-schema.d.ts.map +1 -1
- package/out/polygon-schema.js +2 -12
- package/out/polygon-schema.js.map +1 -1
- package/out/postal/city/alias/lookup.d.ts +11 -13
- package/out/postal/city/alias/lookup.d.ts.map +1 -1
- package/out/postal/city/alias/lookup.js +13 -13
- package/out/postal/city/alias/lookup.js.map +1 -1
- package/out/postal/city/alias/schema.d.ts +9 -12
- package/out/postal/city/alias/schema.d.ts.map +1 -1
- package/out/postal/city/alias/schema.js +2 -17
- package/out/postal/city/alias/schema.js.map +1 -1
- package/out/postal/city/candidate-schema.d.ts +12 -12
- package/out/postal/city/candidate-schema.d.ts.map +1 -1
- package/out/postal/city/candidate-schema.js +14 -12
- package/out/postal/city/candidate-schema.js.map +1 -1
- package/out/postal.d.ts +0 -5
- package/out/postal.d.ts.map +1 -1
- package/out/postal.js +2 -5
- package/out/postal.js.map +1 -1
- package/out/postcode-point-lookup.d.ts +0 -5
- package/out/postcode-point-lookup.d.ts.map +1 -1
- package/out/postcode-point-lookup.js +2 -5
- package/out/postcode-point-lookup.js.map +1 -1
- package/out/primary-preference.d.ts +20 -6
- package/out/primary-preference.d.ts.map +1 -1
- package/out/primary-preference.js +33 -6
- package/out/primary-preference.js.map +1 -1
- package/out/proximity-rerank.d.ts +2 -26
- package/out/proximity-rerank.d.ts.map +1 -1
- package/out/proximity-rerank.js +22 -19
- package/out/proximity-rerank.js.map +1 -1
- package/out/ranking-weights.d.ts +5 -7
- package/out/ranking-weights.d.ts.map +1 -1
- package/out/ranking-weights.js +2 -9
- package/out/ranking-weights.js.map +1 -1
- package/out/region-keys.d.ts +0 -15
- package/out/region-keys.d.ts.map +1 -1
- package/out/region-keys.js +14 -14
- package/out/region-keys.js.map +1 -1
- package/out/reverse.d.ts +1 -24
- package/out/reverse.d.ts.map +1 -1
- package/out/reverse.js +14 -16
- package/out/reverse.js.map +1 -1
- package/out/schema.d.ts +17 -6
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js +2 -15
- package/out/schema.js.map +1 -1
- package/out/search-fetch.d.ts +0 -13
- package/out/search-fetch.d.ts.map +1 -1
- package/out/search-fetch.js +14 -11
- package/out/search-fetch.js.map +1 -1
- package/out/sqlite/convention-source.d.ts +0 -5
- package/out/sqlite/convention-source.d.ts.map +1 -1
- package/out/sqlite/convention-source.js +2 -5
- package/out/sqlite/convention-source.js.map +1 -1
- package/out/sqlite/utils.d.ts +1 -7
- package/out/sqlite/utils.d.ts.map +1 -1
- package/out/sqlite/utils.js +3 -4
- package/out/sqlite/utils.js.map +1 -1
- package/out/street/centroid/schema.d.ts +3 -6
- package/out/street/centroid/schema.d.ts.map +1 -1
- package/out/street/centroid/schema.js +2 -7
- package/out/street/centroid/schema.js.map +1 -1
- package/out/street/centroid.d.ts +0 -3
- package/out/street/centroid.d.ts.map +1 -1
- package/out/street/centroid.js +2 -6
- package/out/street/centroid.js.map +1 -1
- package/out/street/locale.d.ts +12 -0
- package/out/street/locale.d.ts.map +1 -0
- package/out/street/locale.js +54 -0
- package/out/street/locale.js.map +1 -0
- package/out/street/morphology/fst/builder.d.ts +1 -26
- package/out/street/morphology/fst/builder.d.ts.map +1 -1
- package/out/street/morphology/fst/builder.js +19 -18
- package/out/street/morphology/fst/builder.js.map +1 -1
- package/out/street/morphology/fst/loader.d.ts +0 -20
- package/out/street/morphology/fst/loader.d.ts.map +1 -1
- package/out/street/morphology/fst/loader.js +14 -13
- package/out/street/morphology/fst/loader.js.map +1 -1
- package/out/street/name-lookup.d.ts +11 -13
- package/out/street/name-lookup.d.ts.map +1 -1
- package/out/street/name-lookup.js +14 -14
- package/out/street/name-lookup.js.map +1 -1
- package/out/street/normalize.d.ts +29 -12
- package/out/street/normalize.d.ts.map +1 -1
- package/out/street/normalize.js +53 -13
- package/out/street/normalize.js.map +1 -1
- package/out/street/segment-schema.d.ts +11 -12
- package/out/street/segment-schema.d.ts.map +1 -1
- package/out/street/segment-schema.js +13 -12
- package/out/street/segment-schema.js.map +1 -1
- package/out/street/table.d.ts +154 -0
- package/out/street/table.d.ts.map +1 -0
- package/out/street/table.js +122 -0
- package/out/street/table.js.map +1 -0
- package/out/street.d.ts +1 -5
- package/out/street.d.ts.map +1 -1
- package/out/street.js +3 -5
- package/out/street.js.map +1 -1
- package/out/types.d.ts +1 -6
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -5
- package/out/types.js.map +1 -1
- package/out/unified-schema.d.ts +18 -7
- package/out/unified-schema.d.ts.map +1 -1
- package/out/unified-schema.js +14 -10
- package/out/unified-schema.js.map +1 -1
- package/out/uprn/existence.d.ts +7 -10
- package/out/uprn/existence.d.ts.map +1 -1
- package/out/uprn/existence.js +9 -10
- package/out/uprn/existence.js.map +1 -1
- package/out/uprn/lookup.d.ts +1 -8
- package/out/uprn/lookup.d.ts.map +1 -1
- package/out/uprn/lookup.js +6 -8
- package/out/uprn/lookup.js.map +1 -1
- package/out/uprn/schema.d.ts +2 -5
- package/out/uprn/schema.d.ts.map +1 -1
- package/out/uprn/schema.js +2 -7
- package/out/uprn/schema.js.map +1 -1
- package/out/uprn.d.ts +0 -5
- package/out/uprn.d.ts.map +1 -1
- package/out/uprn.js +2 -5
- package/out/uprn.js.map +1 -1
- package/out/weights-overlay-linker.d.ts +3 -8
- package/out/weights-overlay-linker.d.ts.map +1 -1
- package/out/weights-overlay-linker.js +5 -8
- package/out/weights-overlay-linker.js.map +1 -1
- package/package.json +12 -12
- package/lib/currency-backfill.ts +0 -289
- package/out/currency-backfill.d.ts +0 -68
- package/out/currency-backfill.d.ts.map +0 -1
- package/out/currency-backfill.js +0 -169
- package/out/currency-backfill.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/resolver-wof-sqlite",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.2.0",
|
|
4
4
|
"description": "Who's On First SQLite resolver — FTS5-backed PlaceLookup that resolves text queries to WOF place IDs + coordinates. Optional dependency for callers who want geocoding.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -215,17 +215,17 @@
|
|
|
215
215
|
}
|
|
216
216
|
},
|
|
217
217
|
"dependencies": {
|
|
218
|
-
"@mailwoman/ancestrie": "11.
|
|
219
|
-
"@mailwoman/codex": "11.
|
|
220
|
-
"@mailwoman/core": "11.
|
|
221
|
-
"@mailwoman/dictionaries": "11.
|
|
222
|
-
"@mailwoman/evidence": "11.
|
|
223
|
-
"@mailwoman/gazetteer": "11.
|
|
224
|
-
"@mailwoman/match": "11.
|
|
225
|
-
"@mailwoman/postcode": "11.
|
|
226
|
-
"@mailwoman/resolver": "11.
|
|
227
|
-
"@mailwoman/spatial": "11.
|
|
228
|
-
"@mailwoman/sqlite": "11.
|
|
218
|
+
"@mailwoman/ancestrie": "11.2.0",
|
|
219
|
+
"@mailwoman/codex": "11.2.0",
|
|
220
|
+
"@mailwoman/core": "11.2.0",
|
|
221
|
+
"@mailwoman/dictionaries": "11.2.0",
|
|
222
|
+
"@mailwoman/evidence": "11.2.0",
|
|
223
|
+
"@mailwoman/gazetteer": "11.2.0",
|
|
224
|
+
"@mailwoman/match": "11.2.0",
|
|
225
|
+
"@mailwoman/postcode": "11.2.0",
|
|
226
|
+
"@mailwoman/resolver": "11.2.0",
|
|
227
|
+
"@mailwoman/spatial": "11.2.0",
|
|
228
|
+
"@mailwoman/sqlite": "11.2.0",
|
|
229
229
|
"@sister.software/h3": "^1.1.0",
|
|
230
230
|
"kysely": "^0.29.7",
|
|
231
231
|
"path-ts": "^2.5.0",
|
package/lib/currency-backfill.ts
DELETED
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Restores deprecated WOF localities only when an independent source attests them.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { pathExists } from "@mailwoman/core/fs/readers/stat"
|
|
10
|
-
import { isStrictlyFiner } from "@mailwoman/gazetteer/whosonfirst"
|
|
11
|
-
import { haversine } from "@mailwoman/spatial/geometries/point/distance"
|
|
12
|
-
import type { DatabaseClient } from "@mailwoman/sqlite/client"
|
|
13
|
-
import { type PathBuilderLike, resolvePath } from "path-ts"
|
|
14
|
-
import { TSVSpliterator } from "spliterator"
|
|
15
|
-
|
|
16
|
-
import type { loadImportanceIndex } from "#candidate/importance"
|
|
17
|
-
import type { PlaceAttrs, StageRow } from "#candidate/place-attrs"
|
|
18
|
-
import type { CandidateDatabase } from "#candidate/schema"
|
|
19
|
-
import type { WOFDatabase } from "#schema"
|
|
20
|
-
import { normalizeLocalityForKey } from "#street/normalize"
|
|
21
|
-
|
|
22
|
-
const CURRENCY_BACKFILL_RADIUS_KM = 10
|
|
23
|
-
|
|
24
|
-
const CURRENCY_BACKFILL_POP_FLOOR = 1000
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Restore a deprecated locality only when no live namesake exists within CURRENCY_BACKFILL_RADIUS_KM
|
|
28
|
-
* and GeoNames attests the same folded name above {@link CURRENCY_BACKFILL_POP_FLOOR}.
|
|
29
|
-
*/
|
|
30
|
-
export interface CurrencyBackfillResults {
|
|
31
|
-
judged: number
|
|
32
|
-
blocked: number
|
|
33
|
-
unattested: number
|
|
34
|
-
floored: number
|
|
35
|
-
resurrected: number
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* One country's read of the check — every dead name judged, by result and by the dead
|
|
40
|
-
* row's placetype — so a census can say what a wider query admits.
|
|
41
|
-
*/
|
|
42
|
-
export interface CurrencyBackfillCountryReport extends CurrencyBackfillResults {
|
|
43
|
-
country: string
|
|
44
|
-
deadPlacetypes: readonly string[]
|
|
45
|
-
dumpPresent: boolean
|
|
46
|
-
byDeadPlacetype: Record<string, CurrencyBackfillResults>
|
|
47
|
-
/**
|
|
48
|
-
* The first resurrected names, `placetype:name`, capped because the report is a receipt and not the table.
|
|
49
|
-
*/
|
|
50
|
-
sample: string[]
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const REPORT_SAMPLE_SIZE = 25
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* The placetypes a dead row may have to be judged at all; `locality` is the shipped default.
|
|
57
|
-
*/
|
|
58
|
-
export const DEFAULT_DEAD_PLACETYPES: readonly string[] = ["locality"]
|
|
59
|
-
|
|
60
|
-
function emptyResults(): CurrencyBackfillResults {
|
|
61
|
-
return { judged: 0, blocked: 0, unattested: 0, floored: 0, resurrected: 0 }
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export async function resurrectCurrencyHoles(ctx: {
|
|
65
|
-
src: DatabaseClient<WOFDatabase>
|
|
66
|
-
/**
|
|
67
|
-
* The candidate build's transaction, required unless `dryRun`.
|
|
68
|
-
*/
|
|
69
|
-
tx?: DatabaseClient<CandidateDatabase>
|
|
70
|
-
geonamesDir: PathBuilderLike
|
|
71
|
-
countries: readonly string[]
|
|
72
|
-
attrs: Map<number, PlaceAttrs>
|
|
73
|
-
ccID: (code: string | null) => number
|
|
74
|
-
ptID: (pt: string | null) => number
|
|
75
|
-
regionOf: Map<number, number>
|
|
76
|
-
importance: ReturnType<typeof loadImportanceIndex> | null
|
|
77
|
-
stageRow: StageRow
|
|
78
|
-
progress: (phase: string, message: string) => void
|
|
79
|
-
|
|
80
|
-
deadPlacetypes?: readonly string[]
|
|
81
|
-
/**
|
|
82
|
-
* Judge and count while staging no row and opening no transaction.
|
|
83
|
-
*/
|
|
84
|
-
dryRun?: boolean
|
|
85
|
-
/**
|
|
86
|
-
* Receives one report per country judged (a country with no dump or no dead rows reports zero results).
|
|
87
|
-
*/
|
|
88
|
-
onCountry?: (report: CurrencyBackfillCountryReport) => void
|
|
89
|
-
}): Promise<number> {
|
|
90
|
-
const deadPlacetypes = ctx.deadPlacetypes ?? DEFAULT_DEAD_PLACETYPES
|
|
91
|
-
const dryRun = ctx.dryRun === true
|
|
92
|
-
|
|
93
|
-
if (!dryRun && !ctx.tx) {
|
|
94
|
-
throw new Error(
|
|
95
|
-
"resurrectCurrencyHoles: a build run needs the candidate transaction (tx); pass dryRun to judge only"
|
|
96
|
-
)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const deadStmt = ctx.src.prepare(
|
|
100
|
-
`SELECT id, name, placetype, latitude, longitude, min_latitude, min_longitude, max_latitude, max_longitude
|
|
101
|
-
FROM spr
|
|
102
|
-
WHERE country = ? AND placetype IN (${deadPlacetypes.map(() => "?").join(", ")})
|
|
103
|
-
AND is_current = 0 AND is_deprecated = 1 AND is_superseded = 0`
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
const liveStmt = ctx.src.prepare(
|
|
107
|
-
`SELECT latitude, longitude, placetype FROM spr WHERE country = ? AND name = ? AND is_current != 0`
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
let total = 0
|
|
111
|
-
|
|
112
|
-
for (const country of ctx.countries) {
|
|
113
|
-
const cc = country.toUpperCase()
|
|
114
|
-
const dumpPath = resolvePath(ctx.geonamesDir, `${cc}.txt`)
|
|
115
|
-
|
|
116
|
-
const report: CurrencyBackfillCountryReport = {
|
|
117
|
-
country: cc,
|
|
118
|
-
deadPlacetypes,
|
|
119
|
-
dumpPresent: await pathExists(dumpPath),
|
|
120
|
-
...emptyResults(),
|
|
121
|
-
byDeadPlacetype: {},
|
|
122
|
-
sample: [],
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (!report.dumpPresent) {
|
|
126
|
-
ctx.progress("currency-backfill", `${cc}: no GeoNames dump at ${dumpPath} — holes stay dead`)
|
|
127
|
-
ctx.onCountry?.(report)
|
|
128
|
-
|
|
129
|
-
continue
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// Read dead rows first.
|
|
133
|
-
// A country with no dead names then avoids loading its national dump.
|
|
134
|
-
// That avoids heap pressure on a build near its limit.
|
|
135
|
-
const dead = deadStmt.all(cc, ...deadPlacetypes)
|
|
136
|
-
|
|
137
|
-
if (!dead.length) {
|
|
138
|
-
ctx.progress("currency-backfill", `${cc}: 0 dead names — dump not loaded`)
|
|
139
|
-
ctx.onCountry?.(report)
|
|
140
|
-
|
|
141
|
-
continue
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Only the dead names' own folded keys can ever be probed, so the rest of the
|
|
145
|
-
// national dump streams through without residency.
|
|
146
|
-
const deadKeys = new Set<string>()
|
|
147
|
-
|
|
148
|
-
for (const d of dead) {
|
|
149
|
-
const k = normalizeLocalityForKey(String(d.name ?? ""))
|
|
150
|
-
|
|
151
|
-
if (k) {
|
|
152
|
-
deadKeys.add(k)
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// GeoNames columns by index: 1 name, 2 ascii, 4 lat, 5 lon, 6 feature_class, 14 population.
|
|
157
|
-
const attestors = new Map<string, { lat: number; lon: number; pop: number }[]>()
|
|
158
|
-
|
|
159
|
-
for await (const f of TSVSpliterator.fromAsync(dumpPath, { header: false })) {
|
|
160
|
-
if (f[6] !== "P") continue
|
|
161
|
-
|
|
162
|
-
const keys = [normalizeLocalityForKey(String(f[1] ?? "")), normalizeLocalityForKey(String(f[2] ?? ""))].filter(
|
|
163
|
-
(key) => key && deadKeys.has(key)
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
if (!keys.length) continue
|
|
167
|
-
|
|
168
|
-
const row = { lat: Number(f[4]), lon: Number(f[5]), pop: Number(f[14]) || 0 }
|
|
169
|
-
|
|
170
|
-
for (const key of new Set(keys)) {
|
|
171
|
-
const bag = attestors.get(key)
|
|
172
|
-
|
|
173
|
-
if (bag) {
|
|
174
|
-
bag.push(row)
|
|
175
|
-
} else {
|
|
176
|
-
attestors.set(key, [row])
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const seen = new Set<string>()
|
|
182
|
-
|
|
183
|
-
const count = (deadPlacetype: string, result: keyof CurrencyBackfillResults): void => {
|
|
184
|
-
report[result] += 1
|
|
185
|
-
const bucket = (report.byDeadPlacetype[deadPlacetype] ??= emptyResults())
|
|
186
|
-
|
|
187
|
-
bucket[result] += 1
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
if (!dryRun) {
|
|
191
|
-
ctx.tx!.exec("BEGIN")
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
for (const d of dead) {
|
|
195
|
-
const name = String(d.name ?? "")
|
|
196
|
-
const pkey = normalizeLocalityForKey(name)
|
|
197
|
-
|
|
198
|
-
if (!pkey || seen.has(pkey)) continue
|
|
199
|
-
seen.add(pkey)
|
|
200
|
-
// The query admits whatever `deadPlacetypes` names, so the rank comparison
|
|
201
|
-
// judges each candidate against its own dead rung.
|
|
202
|
-
const deadPlacetype = String(d.placetype ?? "locality")
|
|
203
|
-
|
|
204
|
-
count(deadPlacetype, "judged")
|
|
205
|
-
const dLat = Number(d.latitude)
|
|
206
|
-
const dLon = Number(d.longitude)
|
|
207
|
-
|
|
208
|
-
// A live row blocks unless it is strictly finer than the dead one.
|
|
209
|
-
// An unranked placetype also blocks because the failure mode is inventing a place.
|
|
210
|
-
const liveNear = liveStmt.all(cc, name).some((row) => {
|
|
211
|
-
if (haversine(dLat, dLon, Number(row.latitude), Number(row.longitude)) > CURRENCY_BACKFILL_RADIUS_KM) {
|
|
212
|
-
return false
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
return isStrictlyFiner(String(row.placetype ?? ""), deadPlacetype) !== true
|
|
216
|
-
})
|
|
217
|
-
|
|
218
|
-
if (liveNear) {
|
|
219
|
-
count(deadPlacetype, "blocked")
|
|
220
|
-
|
|
221
|
-
continue
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
const near = (attestors.get(pkey) ?? []).filter(
|
|
225
|
-
(g) => haversine(dLat, dLon, g.lat, g.lon) <= CURRENCY_BACKFILL_RADIUS_KM
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
if (!near.length) {
|
|
229
|
-
count(deadPlacetype, "unattested")
|
|
230
|
-
|
|
231
|
-
continue
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const pop = Math.max(...near.map((g) => g.pop))
|
|
235
|
-
|
|
236
|
-
if (pop < CURRENCY_BACKFILL_POP_FLOOR) {
|
|
237
|
-
count(deadPlacetype, "floored")
|
|
238
|
-
|
|
239
|
-
continue
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
count(deadPlacetype, "resurrected")
|
|
243
|
-
|
|
244
|
-
if (report.sample.length < REPORT_SAMPLE_SIZE) {
|
|
245
|
-
report.sample.push(`${deadPlacetype}:${name}`)
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
if (dryRun) continue
|
|
249
|
-
|
|
250
|
-
const sid = Number(d.id)
|
|
251
|
-
|
|
252
|
-
const a: PlaceAttrs = {
|
|
253
|
-
cid: ctx.ccID(cc),
|
|
254
|
-
rid: ctx.regionOf.get(sid) ?? 0,
|
|
255
|
-
ptid: ctx.ptID(deadPlacetype),
|
|
256
|
-
name,
|
|
257
|
-
lat: dLat,
|
|
258
|
-
lon: dLon,
|
|
259
|
-
mnLat: Number(d.min_latitude),
|
|
260
|
-
mnLon: Number(d.min_longitude),
|
|
261
|
-
mxLat: Number(d.max_latitude),
|
|
262
|
-
mxLon: Number(d.max_longitude),
|
|
263
|
-
pop,
|
|
264
|
-
neg: -Math.log10(pop + 1),
|
|
265
|
-
pkey,
|
|
266
|
-
imp: ctx.importance?.find(name, cc, deadPlacetype, dLat, dLon) ?? null,
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
ctx.attrs.set(sid, a)
|
|
270
|
-
ctx.stageRow(pkey, a, sid, 1)
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
if (!dryRun) {
|
|
274
|
-
ctx.tx!.exec("COMMIT")
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
ctx.progress(
|
|
278
|
-
"currency-backfill",
|
|
279
|
-
`${cc}: ${report.resurrected} resurrected of ${report.judged} dead names ` +
|
|
280
|
-
`(${report.blocked} blocked by a live near row, ${report.unattested} unattested, ` +
|
|
281
|
-
`${report.floored} under the population floor)${dryRun ? " — dry run, nothing staged" : ""}`
|
|
282
|
-
)
|
|
283
|
-
|
|
284
|
-
ctx.onCountry?.(report)
|
|
285
|
-
total += report.resurrected
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return total
|
|
289
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Restores deprecated WOF localities only when an independent source attests them.
|
|
7
|
-
*/
|
|
8
|
-
import type { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
9
|
-
import { type PathBuilderLike } from "path-ts";
|
|
10
|
-
import type { loadImportanceIndex } from "#candidate/importance";
|
|
11
|
-
import type { PlaceAttrs, StageRow } from "#candidate/place-attrs";
|
|
12
|
-
import type { CandidateDatabase } from "#candidate/schema";
|
|
13
|
-
import type { WOFDatabase } from "#schema";
|
|
14
|
-
/**
|
|
15
|
-
* Restore a deprecated locality only when no live namesake exists within CURRENCY_BACKFILL_RADIUS_KM
|
|
16
|
-
* and GeoNames attests the same folded name above {@link CURRENCY_BACKFILL_POP_FLOOR}.
|
|
17
|
-
*/
|
|
18
|
-
export interface CurrencyBackfillResults {
|
|
19
|
-
judged: number;
|
|
20
|
-
blocked: number;
|
|
21
|
-
unattested: number;
|
|
22
|
-
floored: number;
|
|
23
|
-
resurrected: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* One country's read of the check — every dead name judged, by result and by the dead
|
|
27
|
-
* row's placetype — so a census can say what a wider query admits.
|
|
28
|
-
*/
|
|
29
|
-
export interface CurrencyBackfillCountryReport extends CurrencyBackfillResults {
|
|
30
|
-
country: string;
|
|
31
|
-
deadPlacetypes: readonly string[];
|
|
32
|
-
dumpPresent: boolean;
|
|
33
|
-
byDeadPlacetype: Record<string, CurrencyBackfillResults>;
|
|
34
|
-
/**
|
|
35
|
-
* The first resurrected names, `placetype:name`, capped because the report is a receipt and not the table.
|
|
36
|
-
*/
|
|
37
|
-
sample: string[];
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* The placetypes a dead row may have to be judged at all; `locality` is the shipped default.
|
|
41
|
-
*/
|
|
42
|
-
export declare const DEFAULT_DEAD_PLACETYPES: readonly string[];
|
|
43
|
-
export declare function resurrectCurrencyHoles(ctx: {
|
|
44
|
-
src: DatabaseClient<WOFDatabase>;
|
|
45
|
-
/**
|
|
46
|
-
* The candidate build's transaction, required unless `dryRun`.
|
|
47
|
-
*/
|
|
48
|
-
tx?: DatabaseClient<CandidateDatabase>;
|
|
49
|
-
geonamesDir: PathBuilderLike;
|
|
50
|
-
countries: readonly string[];
|
|
51
|
-
attrs: Map<number, PlaceAttrs>;
|
|
52
|
-
ccID: (code: string | null) => number;
|
|
53
|
-
ptID: (pt: string | null) => number;
|
|
54
|
-
regionOf: Map<number, number>;
|
|
55
|
-
importance: ReturnType<typeof loadImportanceIndex> | null;
|
|
56
|
-
stageRow: StageRow;
|
|
57
|
-
progress: (phase: string, message: string) => void;
|
|
58
|
-
deadPlacetypes?: readonly string[];
|
|
59
|
-
/**
|
|
60
|
-
* Judge and count while staging no row and opening no transaction.
|
|
61
|
-
*/
|
|
62
|
-
dryRun?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Receives one report per country judged (a country with no dump or no dead rows reports zero results).
|
|
65
|
-
*/
|
|
66
|
-
onCountry?: (report: CurrencyBackfillCountryReport) => void;
|
|
67
|
-
}): Promise<number>;
|
|
68
|
-
//# sourceMappingURL=currency-backfill.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"currency-backfill.d.ts","sourceRoot":"","sources":["../lib/currency-backfill.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,E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AG,IAAI,KAAK,MAAM,CAAA;IACnC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,UAAU,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,GAAG,IAAI,CAAA;IACzD,QAAQ,EAAE,QAAQ,CAAA;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAElD,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,6BAA6B,KAAK,IAAI,CAAA;CAC3D,GAAG,OAAO,CAAC,MAAM,CAAC,CAwMlB"}
|
package/out/currency-backfill.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Restores deprecated WOF localities only when an independent source attests them.
|
|
7
|
-
*/
|
|
8
|
-
import { pathExists } from "@mailwoman/core/fs/readers/stat";
|
|
9
|
-
import { isStrictlyFiner } from "@mailwoman/gazetteer/whosonfirst";
|
|
10
|
-
import { haversine } from "@mailwoman/spatial/geometries/point/distance";
|
|
11
|
-
import { resolvePath } from "path-ts";
|
|
12
|
-
import { TSVSpliterator } from "spliterator";
|
|
13
|
-
import { normalizeLocalityForKey } from "#street/normalize";
|
|
14
|
-
const CURRENCY_BACKFILL_RADIUS_KM = 10;
|
|
15
|
-
const CURRENCY_BACKFILL_POP_FLOOR = 1000;
|
|
16
|
-
const REPORT_SAMPLE_SIZE = 25;
|
|
17
|
-
/**
|
|
18
|
-
* The placetypes a dead row may have to be judged at all; `locality` is the shipped default.
|
|
19
|
-
*/
|
|
20
|
-
export const DEFAULT_DEAD_PLACETYPES = ["locality"];
|
|
21
|
-
function emptyResults() {
|
|
22
|
-
return { judged: 0, blocked: 0, unattested: 0, floored: 0, resurrected: 0 };
|
|
23
|
-
}
|
|
24
|
-
export async function resurrectCurrencyHoles(ctx) {
|
|
25
|
-
const deadPlacetypes = ctx.deadPlacetypes ?? DEFAULT_DEAD_PLACETYPES;
|
|
26
|
-
const dryRun = ctx.dryRun === true;
|
|
27
|
-
if (!dryRun && !ctx.tx) {
|
|
28
|
-
throw new Error("resurrectCurrencyHoles: a build run needs the candidate transaction (tx); pass dryRun to judge only");
|
|
29
|
-
}
|
|
30
|
-
const deadStmt = ctx.src.prepare(`SELECT id, name, placetype, latitude, longitude, min_latitude, min_longitude, max_latitude, max_longitude
|
|
31
|
-
FROM spr
|
|
32
|
-
WHERE country = ? AND placetype IN (${deadPlacetypes.map(() => "?").join(", ")})
|
|
33
|
-
AND is_current = 0 AND is_deprecated = 1 AND is_superseded = 0`);
|
|
34
|
-
const liveStmt = ctx.src.prepare(`SELECT latitude, longitude, placetype FROM spr WHERE country = ? AND name = ? AND is_current != 0`);
|
|
35
|
-
let total = 0;
|
|
36
|
-
for (const country of ctx.countries) {
|
|
37
|
-
const cc = country.toUpperCase();
|
|
38
|
-
const dumpPath = resolvePath(ctx.geonamesDir, `${cc}.txt`);
|
|
39
|
-
const report = {
|
|
40
|
-
country: cc,
|
|
41
|
-
deadPlacetypes,
|
|
42
|
-
dumpPresent: await pathExists(dumpPath),
|
|
43
|
-
...emptyResults(),
|
|
44
|
-
byDeadPlacetype: {},
|
|
45
|
-
sample: [],
|
|
46
|
-
};
|
|
47
|
-
if (!report.dumpPresent) {
|
|
48
|
-
ctx.progress("currency-backfill", `${cc}: no GeoNames dump at ${dumpPath} — holes stay dead`);
|
|
49
|
-
ctx.onCountry?.(report);
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
// Read dead rows first.
|
|
53
|
-
// A country with no dead names then avoids loading its national dump.
|
|
54
|
-
// That avoids heap pressure on a build near its limit.
|
|
55
|
-
const dead = deadStmt.all(cc, ...deadPlacetypes);
|
|
56
|
-
if (!dead.length) {
|
|
57
|
-
ctx.progress("currency-backfill", `${cc}: 0 dead names — dump not loaded`);
|
|
58
|
-
ctx.onCountry?.(report);
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
// Only the dead names' own folded keys can ever be probed, so the rest of the
|
|
62
|
-
// national dump streams through without residency.
|
|
63
|
-
const deadKeys = new Set();
|
|
64
|
-
for (const d of dead) {
|
|
65
|
-
const k = normalizeLocalityForKey(String(d.name ?? ""));
|
|
66
|
-
if (k) {
|
|
67
|
-
deadKeys.add(k);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
// GeoNames columns by index: 1 name, 2 ascii, 4 lat, 5 lon, 6 feature_class, 14 population.
|
|
71
|
-
const attestors = new Map();
|
|
72
|
-
for await (const f of TSVSpliterator.fromAsync(dumpPath, { header: false })) {
|
|
73
|
-
if (f[6] !== "P")
|
|
74
|
-
continue;
|
|
75
|
-
const keys = [normalizeLocalityForKey(String(f[1] ?? "")), normalizeLocalityForKey(String(f[2] ?? ""))].filter((key) => key && deadKeys.has(key));
|
|
76
|
-
if (!keys.length)
|
|
77
|
-
continue;
|
|
78
|
-
const row = { lat: Number(f[4]), lon: Number(f[5]), pop: Number(f[14]) || 0 };
|
|
79
|
-
for (const key of new Set(keys)) {
|
|
80
|
-
const bag = attestors.get(key);
|
|
81
|
-
if (bag) {
|
|
82
|
-
bag.push(row);
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
attestors.set(key, [row]);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
const seen = new Set();
|
|
90
|
-
const count = (deadPlacetype, result) => {
|
|
91
|
-
report[result] += 1;
|
|
92
|
-
const bucket = (report.byDeadPlacetype[deadPlacetype] ??= emptyResults());
|
|
93
|
-
bucket[result] += 1;
|
|
94
|
-
};
|
|
95
|
-
if (!dryRun) {
|
|
96
|
-
ctx.tx.exec("BEGIN");
|
|
97
|
-
}
|
|
98
|
-
for (const d of dead) {
|
|
99
|
-
const name = String(d.name ?? "");
|
|
100
|
-
const pkey = normalizeLocalityForKey(name);
|
|
101
|
-
if (!pkey || seen.has(pkey))
|
|
102
|
-
continue;
|
|
103
|
-
seen.add(pkey);
|
|
104
|
-
// The query admits whatever `deadPlacetypes` names, so the rank comparison
|
|
105
|
-
// judges each candidate against its own dead rung.
|
|
106
|
-
const deadPlacetype = String(d.placetype ?? "locality");
|
|
107
|
-
count(deadPlacetype, "judged");
|
|
108
|
-
const dLat = Number(d.latitude);
|
|
109
|
-
const dLon = Number(d.longitude);
|
|
110
|
-
// A live row blocks unless it is strictly finer than the dead one.
|
|
111
|
-
// An unranked placetype also blocks because the failure mode is inventing a place.
|
|
112
|
-
const liveNear = liveStmt.all(cc, name).some((row) => {
|
|
113
|
-
if (haversine(dLat, dLon, Number(row.latitude), Number(row.longitude)) > CURRENCY_BACKFILL_RADIUS_KM) {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
return isStrictlyFiner(String(row.placetype ?? ""), deadPlacetype) !== true;
|
|
117
|
-
});
|
|
118
|
-
if (liveNear) {
|
|
119
|
-
count(deadPlacetype, "blocked");
|
|
120
|
-
continue;
|
|
121
|
-
}
|
|
122
|
-
const near = (attestors.get(pkey) ?? []).filter((g) => haversine(dLat, dLon, g.lat, g.lon) <= CURRENCY_BACKFILL_RADIUS_KM);
|
|
123
|
-
if (!near.length) {
|
|
124
|
-
count(deadPlacetype, "unattested");
|
|
125
|
-
continue;
|
|
126
|
-
}
|
|
127
|
-
const pop = Math.max(...near.map((g) => g.pop));
|
|
128
|
-
if (pop < CURRENCY_BACKFILL_POP_FLOOR) {
|
|
129
|
-
count(deadPlacetype, "floored");
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
count(deadPlacetype, "resurrected");
|
|
133
|
-
if (report.sample.length < REPORT_SAMPLE_SIZE) {
|
|
134
|
-
report.sample.push(`${deadPlacetype}:${name}`);
|
|
135
|
-
}
|
|
136
|
-
if (dryRun)
|
|
137
|
-
continue;
|
|
138
|
-
const sid = Number(d.id);
|
|
139
|
-
const a = {
|
|
140
|
-
cid: ctx.ccID(cc),
|
|
141
|
-
rid: ctx.regionOf.get(sid) ?? 0,
|
|
142
|
-
ptid: ctx.ptID(deadPlacetype),
|
|
143
|
-
name,
|
|
144
|
-
lat: dLat,
|
|
145
|
-
lon: dLon,
|
|
146
|
-
mnLat: Number(d.min_latitude),
|
|
147
|
-
mnLon: Number(d.min_longitude),
|
|
148
|
-
mxLat: Number(d.max_latitude),
|
|
149
|
-
mxLon: Number(d.max_longitude),
|
|
150
|
-
pop,
|
|
151
|
-
neg: -Math.log10(pop + 1),
|
|
152
|
-
pkey,
|
|
153
|
-
imp: ctx.importance?.find(name, cc, deadPlacetype, dLat, dLon) ?? null,
|
|
154
|
-
};
|
|
155
|
-
ctx.attrs.set(sid, a);
|
|
156
|
-
ctx.stageRow(pkey, a, sid, 1);
|
|
157
|
-
}
|
|
158
|
-
if (!dryRun) {
|
|
159
|
-
ctx.tx.exec("COMMIT");
|
|
160
|
-
}
|
|
161
|
-
ctx.progress("currency-backfill", `${cc}: ${report.resurrected} resurrected of ${report.judged} dead names ` +
|
|
162
|
-
`(${report.blocked} blocked by a live near row, ${report.unattested} unattested, ` +
|
|
163
|
-
`${report.floored} under the population floor)${dryRun ? " — dry run, nothing staged" : ""}`);
|
|
164
|
-
ctx.onCountry?.(report);
|
|
165
|
-
total += report.resurrected;
|
|
166
|
-
}
|
|
167
|
-
return total;
|
|
168
|
-
}
|
|
169
|
-
//# sourceMappingURL=currency-backfill.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"currency-backfill.js","sourceRoot":"","sources":["../lib/currency-backfill.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,M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