@mailwoman/resolver-wof-sqlite 9.2.0 → 9.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -19
- package/lib/address/index.ts +9 -0
- package/{address-point-interpolation.ts → lib/address/point-interpolation.ts} +24 -22
- package/{address-point-schema.ts → lib/address/point-schema.ts} +18 -4
- package/{address-point.ts → lib/address/point.ts} +89 -27
- package/{ancestry-backfill.ts → lib/ancestry/backfill.ts} +14 -19
- package/{ancestry.ts → lib/ancestry/index.ts} +5 -3
- package/{build-candidate.ts → lib/build-candidate.ts} +84 -77
- package/{build-slim.ts → lib/build-slim.ts} +150 -165
- package/{candidate → lib/candidate}/alias-bags.ts +8 -6
- package/{candidate → lib/candidate}/ancestors-sidecar.ts +13 -15
- package/{candidate → lib/candidate}/country-display-names.ts +2 -2
- package/{candidate/shard-fold.ts → lib/candidate/extract-fold.ts} +26 -25
- package/{candidate → lib/candidate}/name-roles.ts +17 -16
- package/{candidate → lib/candidate}/own-name.ts +1 -1
- package/{candidate → lib/candidate}/place-attrs.ts +3 -3
- package/{candidate-ancestors-schema.ts → lib/candidate-ancestors-schema.ts} +4 -4
- package/{candidate-fts.ts → lib/candidate-fts.ts} +3 -3
- package/{candidate-importance.ts → lib/candidate-importance.ts} +53 -57
- package/{candidate-lookup.ts → lib/candidate-lookup.ts} +76 -73
- package/{candidate-schema.ts → lib/candidate-schema.ts} +5 -5
- package/{candidate-scoring.ts → lib/candidate-scoring.ts} +15 -22
- package/{capital-schema.ts → lib/capital-schema.ts} +5 -6
- package/{capitals.ts → lib/capitals.ts} +2 -2
- package/{coincident-roles.ts → lib/coincident-roles.ts} +8 -11
- package/{convention.ts → lib/convention/index.ts} +3 -3
- package/{convention-schema.ts → lib/convention/schema.ts} +2 -2
- package/{coverage-manifest-schema.ts → lib/coverage-manifest-schema.ts} +9 -10
- package/{currency-backfill.ts → lib/currency-backfill.ts} +126 -41
- package/lib/env.ts +50 -0
- package/{exact-match.ts → lib/exact-match.ts} +23 -14
- package/{sharding.ts → lib/extracts.ts} +61 -58
- package/{fst-autocomplete.ts → lib/fst/autocomplete.ts} +4 -4
- package/{fst-builder.ts → lib/fst/builder.ts} +17 -16
- package/{fst-deserialize-web.ts → lib/fst/deserialize-web.ts} +27 -87
- package/lib/fst/format.ts +106 -0
- package/{fst-freshness.ts → lib/fst/freshness.ts} +41 -74
- package/lib/fst/index.ts +14 -0
- package/{fst-matcher.ts → lib/fst/matcher.ts} +1 -1
- package/{fst-serialize.ts → lib/fst/serialize.ts} +37 -115
- package/{fst-types.ts → lib/fst/types.ts} +4 -2
- package/{fts.ts → lib/fts/index.ts} +24 -19
- package/{fts-query.ts → lib/fts/query.ts} +1 -1
- package/{geonames-aliases.ts → lib/geonames/aliases.ts} +13 -13
- package/lib/geonames/index.ts +8 -0
- package/{geonames-postal.ts → lib/geonames/postal.ts} +14 -13
- package/{index.ts → lib/index.ts} +37 -37
- package/{interpolation.ts → lib/interpolation.ts} +27 -25
- package/{lookup.ts → lib/lookup.ts} +129 -141
- package/lib/nsul/index.ts +8 -0
- package/lib/nsul/lookup.ts +144 -0
- package/lib/nsul/schema.ts +130 -0
- package/{place-importance-schema.ts → lib/place-importance-schema.ts} +7 -8
- package/lib/poi/index.ts +8 -0
- package/{poi-lookup.ts → lib/poi/lookup.ts} +22 -28
- package/{poi-schema.ts → lib/poi/schema.ts} +3 -4
- package/{postal-city-alias-lookup.ts → lib/postal/city-alias-lookup.ts} +14 -20
- package/{postal-city-candidate-schema.ts → lib/postal/city-candidate-schema.ts} +2 -2
- package/lib/postal/index.ts +9 -0
- package/{postcode-point-lookup.ts → lib/postcode-point-lookup.ts} +17 -15
- package/{primary-preference.ts → lib/primary-preference.ts} +29 -10
- package/{proximity-rerank.ts → lib/proximity-rerank.ts} +2 -2
- package/{ranking-weights.ts → lib/ranking-weights.ts} +30 -4
- package/{region-keys.ts → lib/region-keys.ts} +9 -9
- package/{reverse.ts → lib/reverse.ts} +34 -46
- package/{schema.ts → lib/schema.ts} +10 -0
- package/{search-fetch.ts → lib/search-fetch.ts} +29 -28
- package/{sqlite-convention-source.ts → lib/sqlite-convention-source.ts} +9 -10
- package/{sqlite-utils.ts → lib/sqlite-utils.ts} +14 -18
- package/{street-centroid-schema.ts → lib/street/centroid-schema.ts} +5 -5
- package/{street-centroid.ts → lib/street/centroid.ts} +14 -21
- package/lib/street/index.ts +13 -0
- package/{street-morphology-fst-builder.ts → lib/street/morphology-fst-builder.ts} +24 -14
- package/{street-morphology-fst-loader.ts → lib/street/morphology-fst-loader.ts} +14 -12
- package/{street-name-lookup.ts → lib/street/name-lookup.ts} +14 -30
- package/{street-normalize.ts → lib/street/normalize.ts} +44 -19
- package/{street-segment-schema.ts → lib/street/segment-schema.ts} +7 -7
- package/{types.ts → lib/types.ts} +18 -12
- package/{unified-schema.ts → lib/unified-schema.ts} +20 -24
- package/lib/uprn/existence.ts +84 -0
- package/lib/uprn/index.ts +9 -0
- package/{uprn-lookup.ts → lib/uprn/lookup.ts} +14 -18
- package/{uprn-schema.ts → lib/uprn/schema.ts} +3 -3
- package/lib/weights-overlay-linker.ts +878 -0
- package/out/address/index.d.ts +9 -0
- package/out/address/index.d.ts.map +1 -0
- package/out/address/index.js +9 -0
- package/out/address/index.js.map +1 -0
- package/out/{address-point-interpolation.d.ts → address/point-interpolation.d.ts} +11 -10
- package/out/address/point-interpolation.d.ts.map +1 -0
- package/out/{address-point-interpolation.js → address/point-interpolation.js} +18 -18
- package/out/address/point-interpolation.js.map +1 -0
- package/out/{address-point-schema.d.ts → address/point-schema.d.ts} +16 -6
- package/out/address/point-schema.d.ts.map +1 -0
- package/out/{address-point-schema.js → address/point-schema.js} +7 -3
- package/out/address/point-schema.js.map +1 -0
- package/out/{address-point.d.ts → address/point.d.ts} +16 -8
- package/out/address/point.d.ts.map +1 -0
- package/out/{address-point.js → address/point.js} +71 -20
- package/out/address/point.js.map +1 -0
- package/out/{ancestry-backfill.d.ts → ancestry/backfill.d.ts} +7 -5
- package/out/ancestry/backfill.d.ts.map +1 -0
- package/out/{ancestry-backfill.js → ancestry/backfill.js} +12 -16
- package/out/ancestry/backfill.js.map +1 -0
- package/out/{ancestry.d.ts → ancestry/index.d.ts} +4 -3
- package/out/ancestry/index.d.ts.map +1 -0
- package/out/{ancestry.js → ancestry/index.js} +3 -2
- package/out/ancestry/index.js.map +1 -0
- package/out/build-candidate.d.ts +30 -24
- package/out/build-candidate.d.ts.map +1 -1
- package/out/build-candidate.js +50 -52
- package/out/build-candidate.js.map +1 -1
- package/out/build-slim.d.ts +4 -4
- package/out/build-slim.d.ts.map +1 -1
- package/out/build-slim.js +124 -139
- package/out/build-slim.js.map +1 -1
- package/out/candidate/alias-bags.d.ts +5 -3
- package/out/candidate/alias-bags.d.ts.map +1 -1
- package/out/candidate/alias-bags.js +2 -2
- package/out/candidate/alias-bags.js.map +1 -1
- package/out/candidate/ancestors-sidecar.d.ts +9 -10
- package/out/candidate/ancestors-sidecar.d.ts.map +1 -1
- package/out/candidate/ancestors-sidecar.js +7 -7
- package/out/candidate/ancestors-sidecar.js.map +1 -1
- package/out/candidate/country-display-names.d.ts +1 -1
- package/out/candidate/country-display-names.d.ts.map +1 -1
- package/out/candidate/country-display-names.js +1 -1
- package/out/candidate/country-display-names.js.map +1 -1
- package/out/candidate/extract-fold.d.ts +32 -0
- package/out/candidate/extract-fold.d.ts.map +1 -0
- package/out/candidate/{shard-fold.js → extract-fold.js} +20 -20
- package/out/candidate/extract-fold.js.map +1 -0
- package/out/candidate/name-roles.d.ts +13 -11
- package/out/candidate/name-roles.d.ts.map +1 -1
- package/out/candidate/name-roles.js +11 -10
- package/out/candidate/name-roles.js.map +1 -1
- package/out/candidate/own-name.d.ts +1 -1
- package/out/candidate/own-name.d.ts.map +1 -1
- package/out/candidate/own-name.js +1 -1
- package/out/candidate/own-name.js.map +1 -1
- package/out/candidate/place-attrs.d.ts +3 -3
- package/out/candidate/place-attrs.d.ts.map +1 -1
- package/out/candidate/place-attrs.js +1 -1
- package/out/candidate/place-attrs.js.map +1 -1
- package/out/candidate-ancestors-schema.d.ts +4 -4
- package/out/candidate-ancestors-schema.d.ts.map +1 -1
- package/out/candidate-ancestors-schema.js +2 -2
- package/out/candidate-ancestors-schema.js.map +1 -1
- package/out/candidate-fts.d.ts +3 -3
- package/out/candidate-fts.d.ts.map +1 -1
- package/out/candidate-fts.js +1 -1
- package/out/candidate-fts.js.map +1 -1
- package/out/candidate-importance.d.ts +16 -16
- package/out/candidate-importance.d.ts.map +1 -1
- package/out/candidate-importance.js +46 -51
- package/out/candidate-importance.js.map +1 -1
- package/out/candidate-lookup.d.ts +11 -9
- package/out/candidate-lookup.d.ts.map +1 -1
- package/out/candidate-lookup.js +61 -58
- package/out/candidate-lookup.js.map +1 -1
- package/out/candidate-schema.d.ts +5 -5
- package/out/candidate-schema.d.ts.map +1 -1
- package/out/candidate-schema.js.map +1 -1
- package/out/candidate-scoring.d.ts +7 -7
- package/out/candidate-scoring.d.ts.map +1 -1
- package/out/candidate-scoring.js +10 -14
- package/out/candidate-scoring.js.map +1 -1
- package/out/capital-schema.d.ts +3 -3
- package/out/capital-schema.d.ts.map +1 -1
- package/out/capital-schema.js +2 -2
- package/out/capital-schema.js.map +1 -1
- package/out/capitals.d.ts +1 -1
- package/out/capitals.d.ts.map +1 -1
- package/out/capitals.js +2 -2
- package/out/capitals.js.map +1 -1
- package/out/coincident-roles.d.ts +6 -5
- package/out/coincident-roles.d.ts.map +1 -1
- package/out/coincident-roles.js +2 -4
- package/out/coincident-roles.js.map +1 -1
- package/out/{convention.d.ts → convention/index.d.ts} +4 -4
- package/out/convention/index.d.ts.map +1 -0
- package/out/{convention.js → convention/index.js} +2 -2
- package/out/convention/index.js.map +1 -0
- package/out/{convention-schema.d.ts → convention/schema.d.ts} +2 -2
- package/out/convention/schema.d.ts.map +1 -0
- package/out/{convention-schema.js → convention/schema.js} +3 -3
- package/out/convention/schema.js.map +1 -0
- package/out/coverage-manifest-schema.d.ts +8 -8
- package/out/coverage-manifest-schema.d.ts.map +1 -1
- package/out/coverage-manifest-schema.js +4 -4
- package/out/coverage-manifest-schema.js.map +1 -1
- package/out/currency-backfill.d.ts +51 -7
- package/out/currency-backfill.d.ts.map +1 -1
- package/out/currency-backfill.js +65 -49
- package/out/currency-backfill.js.map +1 -1
- package/out/env.d.ts +43 -0
- package/out/env.d.ts.map +1 -0
- package/out/env.js +48 -0
- package/out/env.js.map +1 -0
- package/out/exact-match.d.ts +5 -5
- package/out/exact-match.d.ts.map +1 -1
- package/out/exact-match.js +10 -11
- package/out/exact-match.js.map +1 -1
- package/out/extracts.d.ts +114 -0
- package/out/extracts.d.ts.map +1 -0
- package/out/{sharding.js → extracts.js} +38 -38
- package/out/extracts.js.map +1 -0
- package/out/{fst-autocomplete.d.ts → fst/autocomplete.d.ts} +2 -2
- package/out/fst/autocomplete.d.ts.map +1 -0
- package/out/{fst-autocomplete.js → fst/autocomplete.js} +3 -3
- package/out/fst/autocomplete.js.map +1 -0
- package/out/{fst-builder.d.ts → fst/builder.d.ts} +5 -5
- package/out/fst/builder.d.ts.map +1 -0
- package/out/{fst-builder.js → fst/builder.js} +14 -13
- package/out/fst/builder.js.map +1 -0
- package/out/{fst-deserialize-web.d.ts → fst/deserialize-web.d.ts} +3 -3
- package/out/fst/deserialize-web.d.ts.map +1 -0
- package/out/{fst-deserialize-web.js → fst/deserialize-web.js} +10 -74
- package/out/fst/deserialize-web.js.map +1 -0
- package/out/fst/format.d.ts +80 -0
- package/out/fst/format.d.ts.map +1 -0
- package/out/fst/format.js +91 -0
- package/out/fst/format.js.map +1 -0
- package/out/{fst-freshness.d.ts → fst/freshness.d.ts} +10 -13
- package/out/fst/freshness.d.ts.map +1 -0
- package/out/{fst-freshness.js → fst/freshness.js} +41 -73
- package/out/fst/freshness.js.map +1 -0
- package/out/fst/index.d.ts +14 -0
- package/out/fst/index.d.ts.map +1 -0
- package/out/fst/index.js +14 -0
- package/out/fst/index.js.map +1 -0
- package/out/{fst-matcher.d.ts → fst/matcher.d.ts} +2 -2
- package/out/fst/matcher.d.ts.map +1 -0
- package/out/{fst-matcher.js → fst/matcher.js} +1 -1
- package/out/fst/matcher.js.map +1 -0
- package/out/{fst-serialize.d.ts → fst/serialize.d.ts} +5 -10
- package/out/fst/serialize.d.ts.map +1 -0
- package/out/{fst-serialize.js → fst/serialize.js} +18 -98
- package/out/fst/serialize.js.map +1 -0
- package/out/{fst-types.d.ts → fst/types.d.ts} +4 -3
- package/out/fst/types.d.ts.map +1 -0
- package/out/{fst-types.js → fst/types.js} +1 -1
- package/out/fst/types.js.map +1 -0
- package/out/{fts.d.ts → fts/index.d.ts} +16 -9
- package/out/fts/index.d.ts.map +1 -0
- package/out/{fts.js → fts/index.js} +16 -11
- package/out/fts/index.js.map +1 -0
- package/out/{fts-query.d.ts → fts/query.d.ts} +2 -2
- package/out/fts/query.d.ts.map +1 -0
- package/out/{fts-query.js → fts/query.js} +1 -1
- package/out/fts/query.js.map +1 -0
- package/out/{geonames-aliases.d.ts → geonames/aliases.d.ts} +8 -6
- package/out/geonames/aliases.d.ts.map +1 -0
- package/out/{geonames-aliases.js → geonames/aliases.js} +7 -7
- package/out/geonames/aliases.js.map +1 -0
- package/out/geonames/index.d.ts +8 -0
- package/out/geonames/index.d.ts.map +1 -0
- package/out/geonames/index.js +8 -0
- package/out/geonames/index.js.map +1 -0
- package/out/{geonames-postal.d.ts → geonames/postal.d.ts} +10 -8
- package/out/geonames/postal.d.ts.map +1 -0
- package/out/{geonames-postal.js → geonames/postal.js} +9 -9
- package/out/geonames/postal.js.map +1 -0
- package/out/index.d.ts +32 -32
- package/out/index.d.ts.map +1 -1
- package/out/index.js +24 -24
- package/out/index.js.map +1 -1
- package/out/interpolation.d.ts +10 -9
- package/out/interpolation.d.ts.map +1 -1
- package/out/interpolation.js +20 -20
- package/out/interpolation.js.map +1 -1
- package/out/lookup.d.ts +21 -20
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +102 -112
- package/out/lookup.js.map +1 -1
- package/out/name-score.d.ts.map +1 -1
- package/out/name-score.js.map +1 -1
- package/out/nsul/index.d.ts +8 -0
- package/out/nsul/index.d.ts.map +1 -0
- package/out/nsul/index.js +8 -0
- package/out/nsul/index.js.map +1 -0
- package/out/nsul/lookup.d.ts +83 -0
- package/out/nsul/lookup.d.ts.map +1 -0
- package/out/nsul/lookup.js +80 -0
- package/out/nsul/lookup.js.map +1 -0
- package/out/nsul/schema.d.ts +100 -0
- package/out/nsul/schema.d.ts.map +1 -0
- package/out/nsul/schema.js +78 -0
- package/out/nsul/schema.js.map +1 -0
- package/out/place-importance-schema.d.ts +5 -5
- package/out/place-importance-schema.d.ts.map +1 -1
- package/out/place-importance-schema.js +3 -3
- package/out/place-importance-schema.js.map +1 -1
- package/out/poi/index.d.ts +8 -0
- package/out/poi/index.d.ts.map +1 -0
- package/out/poi/index.js +8 -0
- package/out/poi/index.js.map +1 -0
- package/out/{poi-lookup.d.ts → poi/lookup.d.ts} +8 -10
- package/out/poi/lookup.d.ts.map +1 -0
- package/out/{poi-lookup.js → poi/lookup.js} +14 -18
- package/out/poi/lookup.js.map +1 -0
- package/out/{poi-schema.d.ts → poi/schema.d.ts} +4 -4
- package/out/poi/schema.d.ts.map +1 -0
- package/out/{poi-schema.js → poi/schema.js} +1 -1
- package/out/poi/schema.js.map +1 -0
- package/out/polygon-schema.d.ts.map +1 -1
- package/out/polygon-schema.js.map +1 -1
- package/out/{postal-city-alias-lookup.d.ts → postal/city-alias-lookup.d.ts} +6 -5
- package/out/postal/city-alias-lookup.d.ts.map +1 -0
- package/out/{postal-city-alias-lookup.js → postal/city-alias-lookup.js} +11 -15
- package/out/postal/city-alias-lookup.js.map +1 -0
- package/out/{postal-city-alias-schema.d.ts → postal/city-alias-schema.d.ts} +1 -1
- package/out/{postal-city-alias-schema.d.ts.map → postal/city-alias-schema.d.ts.map} +1 -1
- package/out/{postal-city-alias-schema.js → postal/city-alias-schema.js} +1 -1
- package/out/{postal-city-alias-schema.js.map → postal/city-alias-schema.js.map} +1 -1
- package/out/{postal-city-candidate-schema.d.ts → postal/city-candidate-schema.d.ts} +3 -3
- package/out/{postal-city-candidate-schema.d.ts.map → postal/city-candidate-schema.d.ts.map} +1 -1
- package/out/{postal-city-candidate-schema.js → postal/city-candidate-schema.js} +2 -2
- package/out/{postal-city-candidate-schema.js.map → postal/city-candidate-schema.js.map} +1 -1
- package/out/postal/index.d.ts +9 -0
- package/out/postal/index.d.ts.map +1 -0
- package/out/postal/index.js +9 -0
- package/out/postal/index.js.map +1 -0
- package/out/postcode-point-lookup.d.ts +10 -10
- package/out/postcode-point-lookup.d.ts.map +1 -1
- package/out/postcode-point-lookup.js +13 -13
- package/out/postcode-point-lookup.js.map +1 -1
- package/out/primary-preference.d.ts +13 -5
- package/out/primary-preference.d.ts.map +1 -1
- package/out/primary-preference.js +16 -8
- package/out/primary-preference.js.map +1 -1
- package/out/proximity-rerank.d.ts +2 -2
- package/out/proximity-rerank.d.ts.map +1 -1
- package/out/proximity-rerank.js +2 -2
- package/out/proximity-rerank.js.map +1 -1
- package/out/ranking-weights.d.ts +15 -3
- package/out/ranking-weights.d.ts.map +1 -1
- package/out/ranking-weights.js +21 -3
- package/out/ranking-weights.js.map +1 -1
- package/out/region-keys.d.ts +8 -8
- package/out/region-keys.d.ts.map +1 -1
- package/out/region-keys.js +9 -9
- package/out/region-keys.js.map +1 -1
- package/out/reverse.d.ts +6 -6
- package/out/reverse.d.ts.map +1 -1
- package/out/reverse.js +20 -29
- package/out/reverse.js.map +1 -1
- package/out/schema.d.ts +9 -0
- package/out/schema.d.ts.map +1 -1
- package/out/schema.js.map +1 -1
- package/out/search-fetch.d.ts +12 -10
- package/out/search-fetch.d.ts.map +1 -1
- package/out/search-fetch.js +21 -20
- package/out/search-fetch.js.map +1 -1
- package/out/sqlite-convention-source.d.ts +7 -7
- package/out/sqlite-convention-source.d.ts.map +1 -1
- package/out/sqlite-convention-source.js +5 -5
- package/out/sqlite-convention-source.js.map +1 -1
- package/out/sqlite-utils.d.ts +8 -8
- package/out/sqlite-utils.d.ts.map +1 -1
- package/out/sqlite-utils.js +7 -8
- package/out/sqlite-utils.js.map +1 -1
- package/out/{street-centroid-schema.d.ts → street/centroid-schema.d.ts} +6 -6
- package/out/{street-centroid-schema.d.ts.map → street/centroid-schema.d.ts.map} +1 -1
- package/out/{street-centroid-schema.js → street/centroid-schema.js} +5 -5
- package/out/{street-centroid-schema.js.map → street/centroid-schema.js.map} +1 -1
- package/out/{street-centroid.d.ts → street/centroid.d.ts} +6 -6
- package/out/street/centroid.d.ts.map +1 -0
- package/out/{street-centroid.js → street/centroid.js} +13 -19
- package/out/street/centroid.js.map +1 -0
- package/out/street/index.d.ts +13 -0
- package/out/street/index.d.ts.map +1 -0
- package/out/street/index.js +13 -0
- package/out/street/index.js.map +1 -0
- package/out/{street-morphology-fst-builder.d.ts → street/morphology-fst-builder.d.ts} +4 -4
- package/out/street/morphology-fst-builder.d.ts.map +1 -0
- package/out/{street-morphology-fst-builder.js → street/morphology-fst-builder.js} +18 -13
- package/out/street/morphology-fst-builder.js.map +1 -0
- package/out/{street-morphology-fst-loader.d.ts → street/morphology-fst-loader.d.ts} +5 -5
- package/out/street/morphology-fst-loader.d.ts.map +1 -0
- package/out/{street-morphology-fst-loader.js → street/morphology-fst-loader.js} +11 -10
- package/out/street/morphology-fst-loader.js.map +1 -0
- package/out/{street-name-lookup.d.ts → street/name-lookup.d.ts} +4 -7
- package/out/street/name-lookup.d.ts.map +1 -0
- package/out/{street-name-lookup.js → street/name-lookup.js} +9 -23
- package/out/street/name-lookup.js.map +1 -0
- package/out/{street-normalize.d.ts → street/normalize.d.ts} +25 -14
- package/out/street/normalize.d.ts.map +1 -0
- package/out/{street-normalize.js → street/normalize.js} +36 -17
- package/out/street/normalize.js.map +1 -0
- package/out/{street-segment-schema.d.ts → street/segment-schema.d.ts} +8 -8
- package/out/{street-segment-schema.d.ts.map → street/segment-schema.d.ts.map} +1 -1
- package/out/{street-segment-schema.js → street/segment-schema.js} +4 -4
- package/out/{street-segment-schema.js.map → street/segment-schema.js.map} +1 -1
- package/out/types.d.ts +18 -12
- package/out/types.d.ts.map +1 -1
- package/out/types.js.map +1 -1
- package/out/unified-schema.d.ts +5 -4
- package/out/unified-schema.d.ts.map +1 -1
- package/out/unified-schema.js +15 -18
- package/out/unified-schema.js.map +1 -1
- package/out/uprn/existence.d.ts +53 -0
- package/out/uprn/existence.d.ts.map +1 -0
- package/out/uprn/existence.js +61 -0
- package/out/uprn/existence.js.map +1 -0
- package/out/uprn/index.d.ts +9 -0
- package/out/uprn/index.d.ts.map +1 -0
- package/out/uprn/index.js +9 -0
- package/out/uprn/index.js.map +1 -0
- package/out/{uprn-lookup.d.ts → uprn/lookup.d.ts} +4 -4
- package/out/uprn/lookup.d.ts.map +1 -0
- package/out/{uprn-lookup.js → uprn/lookup.js} +11 -14
- package/out/uprn/lookup.js.map +1 -0
- package/out/{uprn-schema.d.ts → uprn/schema.d.ts} +4 -4
- package/out/uprn/schema.d.ts.map +1 -0
- package/out/{uprn-schema.js → uprn/schema.js} +4 -4
- package/out/uprn/schema.js.map +1 -0
- package/out/weights-overlay-linker.d.ts +184 -26
- package/out/weights-overlay-linker.d.ts.map +1 -1
- package/out/weights-overlay-linker.js +338 -86
- package/out/weights-overlay-linker.js.map +1 -1
- package/package.json +465 -269
- package/out/address-point-interpolation.d.ts.map +0 -1
- package/out/address-point-interpolation.js.map +0 -1
- package/out/address-point-schema.d.ts.map +0 -1
- package/out/address-point-schema.js.map +0 -1
- package/out/address-point.d.ts.map +0 -1
- package/out/address-point.js.map +0 -1
- package/out/ancestry-backfill.d.ts.map +0 -1
- package/out/ancestry-backfill.js.map +0 -1
- package/out/ancestry.d.ts.map +0 -1
- package/out/ancestry.js.map +0 -1
- package/out/candidate/shard-fold.d.ts +0 -31
- package/out/candidate/shard-fold.d.ts.map +0 -1
- package/out/candidate/shard-fold.js.map +0 -1
- package/out/convention-schema.d.ts.map +0 -1
- package/out/convention-schema.js.map +0 -1
- package/out/convention.d.ts.map +0 -1
- package/out/convention.js.map +0 -1
- package/out/fst-autocomplete.d.ts.map +0 -1
- package/out/fst-autocomplete.js.map +0 -1
- package/out/fst-builder.d.ts.map +0 -1
- package/out/fst-builder.js.map +0 -1
- package/out/fst-deserialize-web.d.ts.map +0 -1
- package/out/fst-deserialize-web.js.map +0 -1
- package/out/fst-freshness.d.ts.map +0 -1
- package/out/fst-freshness.js.map +0 -1
- package/out/fst-matcher.d.ts.map +0 -1
- package/out/fst-matcher.js.map +0 -1
- package/out/fst-serialize.d.ts.map +0 -1
- package/out/fst-serialize.js.map +0 -1
- package/out/fst-types.d.ts.map +0 -1
- package/out/fst-types.js.map +0 -1
- package/out/fts-query.d.ts.map +0 -1
- package/out/fts-query.js.map +0 -1
- package/out/fts.d.ts.map +0 -1
- package/out/fts.js.map +0 -1
- package/out/geonames-aliases.d.ts.map +0 -1
- package/out/geonames-aliases.js.map +0 -1
- package/out/geonames-postal.d.ts.map +0 -1
- package/out/geonames-postal.js.map +0 -1
- package/out/poi-lookup.d.ts.map +0 -1
- package/out/poi-lookup.js.map +0 -1
- package/out/poi-schema.d.ts.map +0 -1
- package/out/poi-schema.js.map +0 -1
- package/out/postal-city-alias-lookup.d.ts.map +0 -1
- package/out/postal-city-alias-lookup.js.map +0 -1
- package/out/sharding.d.ts +0 -114
- package/out/sharding.d.ts.map +0 -1
- package/out/sharding.js.map +0 -1
- package/out/street-centroid.d.ts.map +0 -1
- package/out/street-centroid.js.map +0 -1
- package/out/street-morphology-fst-builder.d.ts.map +0 -1
- package/out/street-morphology-fst-builder.js.map +0 -1
- package/out/street-morphology-fst-loader.d.ts.map +0 -1
- package/out/street-morphology-fst-loader.js.map +0 -1
- package/out/street-name-lookup.d.ts.map +0 -1
- package/out/street-name-lookup.js.map +0 -1
- package/out/street-normalize.d.ts.map +0 -1
- package/out/street-normalize.js.map +0 -1
- package/out/uprn-lookup.d.ts.map +0 -1
- package/out/uprn-lookup.js.map +0 -1
- package/out/uprn-schema.d.ts.map +0 -1
- package/out/uprn-schema.js.map +0 -1
- package/weights-overlay-linker.ts +0 -377
- /package/{name-score.ts → lib/name-score.ts} +0 -0
- /package/{polygon-schema.ts → lib/polygon-schema.ts} +0 -0
- /package/{postal-city-alias-schema.ts → lib/postal/city-alias-schema.ts} +0 -0
|
@@ -2,21 +2,23 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
* @file Pass 3c of the candidate build — the `name_role` detectors and the
|
|
5
|
+
* @file Pass 3c of the candidate build — the `name_role` detectors and the thresholds they are judged by.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { DatabaseSync } from "node:sqlite"
|
|
9
|
-
|
|
10
8
|
import { isOfficialLanguage } from "@mailwoman/codex/country"
|
|
9
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client"
|
|
10
|
+
import { tableExists } from "@mailwoman/sqlite/introspection"
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import { isOwnNameVariant } from "
|
|
14
|
-
import type { PlaceAttrs } from "
|
|
12
|
+
import type { CandidateDatabase } from "#candidate-schema"
|
|
13
|
+
import { isOwnNameVariant } from "#candidate/own-name"
|
|
14
|
+
import type { PlaceAttrs } from "#candidate/place-attrs"
|
|
15
|
+
import type { WOFDatabase } from "#schema"
|
|
16
|
+
import { normalizeLocalityForKey } from "#street/normalize"
|
|
15
17
|
|
|
16
18
|
/**
|
|
17
|
-
* Key-count
|
|
18
|
-
* a legitimate famous place at that count (New York, 176 keys) is separated by the PROMINENCE
|
|
19
|
-
* number alone.
|
|
19
|
+
* Key-count threshold for the gloss anomaly detector (#1730) — the sweep's own boundary: 4,000 places carried >= 50
|
|
20
|
+
* keys, and a legitimate famous place at that count (New York, 176 keys) is separated by the PROMINENCE check, never by
|
|
21
|
+
* this number alone.
|
|
20
22
|
*/
|
|
21
23
|
export const GLOSS_KEY_THRESHOLD = 50
|
|
22
24
|
|
|
@@ -39,9 +41,9 @@ export const GLOSS_EXCLUDED_PLACETYPES: ReadonlySet<string> = new Set([
|
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
43
|
* Pass 3c — the #1730 name-role prototype: two independent detectors over the staged rows, WRITE-ONLY in this
|
|
42
|
-
* generation (no ranking consumer; the rank penalty is its own D-rule-
|
|
43
|
-
*
|
|
44
|
-
* are never a gloss or a variant.
|
|
44
|
+
* generation (no ranking consumer; the rank penalty is its own D-rule-conditional step with the `gloss_key` board as
|
|
45
|
+
* regression check). Both stamp `is_primary = 0` rows only — a place's canonical name and the `place_abbr` region
|
|
46
|
+
* abbreviations are never a gloss or a variant.
|
|
45
47
|
*
|
|
46
48
|
* - `gloss` is ANOMALY-based, and stamps only the certain core: key volume at/over the threshold + a non-admin placetype
|
|
47
49
|
*
|
|
@@ -55,8 +57,8 @@ export const GLOSS_EXCLUDED_PLACETYPES: ReadonlySet<string> = new Set([
|
|
|
55
57
|
* any role.
|
|
56
58
|
*/
|
|
57
59
|
export function stampNameRoles(ctx: {
|
|
58
|
-
src:
|
|
59
|
-
out:
|
|
60
|
+
src: DatabaseClient<WOFDatabase>
|
|
61
|
+
out: DatabaseClient<CandidateDatabase>
|
|
60
62
|
attrs: Map<number, PlaceAttrs>
|
|
61
63
|
keyCounts: Map<number, number>
|
|
62
64
|
glossThreshold: number
|
|
@@ -94,8 +96,7 @@ export function stampNameRoles(ctx: {
|
|
|
94
96
|
const insRoleKey = out.prepare("INSERT OR IGNORE INTO role_key VALUES (?, ?)")
|
|
95
97
|
|
|
96
98
|
// Zero abbr stamps from a skipped detector is a different fact from zero variants found.
|
|
97
|
-
const hasSourceNames =
|
|
98
|
-
src.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='names'").get() !== undefined
|
|
99
|
+
const hasSourceNames = tableExists(src, "names")
|
|
99
100
|
|
|
100
101
|
if (hasSourceNames) {
|
|
101
102
|
out.exec("BEGIN")
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* — rather than a different name that merely shares the folded key?
|
|
10
10
|
*
|
|
11
11
|
* The comparator is `levenshteinSimilarity`, NOT Jaro-Winkler: JW's common-prefix bonus scores
|
|
12
|
-
* the
|
|
12
|
+
* the required NEGATIVE case (`chanchun` vs `cancun`, 0.925) above real positives
|
|
13
13
|
* (`saint george s` vs `st georges` expanded, 0.914), so no JW threshold separates them.
|
|
14
14
|
* Measured on the #1882 census contests, edit similarity separates every case with margin:
|
|
15
15
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @file The per-place record every candidate-staging pass writes its rows from.
|
|
6
6
|
*
|
|
7
7
|
* Pass 1 reduces each current `spr` row to one {@link PlaceAttrs}; every later pass (alias bags,
|
|
8
|
-
* region abbreviations, country display names, the currency backfill, the
|
|
8
|
+
* region abbreviations, country display names, the currency backfill, the extract folds) discovers
|
|
9
9
|
* ADDITIONAL name keys for a place already in that map and stages a row against the same record.
|
|
10
10
|
* That is what keeps each candidate row denormalized without re-reading the source, and it is why
|
|
11
11
|
* a pass needs exactly four things to stage: the key it found, the place, the id the row hangs on,
|
|
@@ -38,7 +38,7 @@ export interface PlaceAttrs {
|
|
|
38
38
|
* Stage one candidate row: a normalized name key, the place it belongs to, the source id the row hangs on, and whether
|
|
39
39
|
* the key is that place's canonical name (`is_primary`).
|
|
40
40
|
*
|
|
41
|
-
* `sid` is passed separately rather than read off the place because a
|
|
42
|
-
* the admin `attrs` map never held.
|
|
41
|
+
* `sid` is passed separately rather than read off the place because a extract fold and the alias pass stage rows for
|
|
42
|
+
* ids the admin `attrs` map never held.
|
|
43
43
|
*/
|
|
44
44
|
export type StageRow = (k: string, a: PlaceAttrs, sid: number, isPrimary: number) => void
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
* "contained along the canonical hierarchy", never "not contained at all".
|
|
51
51
|
*
|
|
52
52
|
* ABSENCE SEMANTICS (meaning-of-zero): a place with no `candidate_interval` row has no recorded
|
|
53
|
-
* ancestry in the source (
|
|
53
|
+
* ancestry in the source (extract-fed postcodes and localities, isolated places, cycle-skipped
|
|
54
54
|
* rows). Absence is UNVERIFIABLE, never a containment verdict.
|
|
55
55
|
*/
|
|
56
56
|
|
|
@@ -59,8 +59,8 @@ import { sql, type Kysely } from "kysely"
|
|
|
59
59
|
// Type-only and circular on purpose (candidate-schema extends CandidateAncestorsDatabase): Kysely's
|
|
60
60
|
// DB parameter is invariant, so the DDL functions must take the FULL database type their caller
|
|
61
61
|
// holds. Erased at runtime.
|
|
62
|
-
import type { CandidateDatabase } from "
|
|
63
|
-
import type { NameKey } from "
|
|
62
|
+
import type { CandidateDatabase } from "#candidate-schema"
|
|
63
|
+
import type { NameKey } from "#street/normalize"
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* The deepest chain the sidecar stores per place. WOF containment within the resolvable placetypes (country …
|
|
@@ -76,7 +76,7 @@ export const MAX_ANCESTOR_DEPTH = 8
|
|
|
76
76
|
export const CANDIDATE_ANCESTOR_TABLE = "candidate_ancestor"
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
* The interval-label table's name — the closure table's seal-time sibling; existence-
|
|
79
|
+
* The interval-label table's name — the closure table's seal-time sibling; existence-restricted the same way.
|
|
80
80
|
*/
|
|
81
81
|
export const CANDIDATE_INTERVAL_TABLE = "candidate_interval"
|
|
82
82
|
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
* fallback only needs to recover the name_key, then re-probes the B-tree for its rows).
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
-
import type {
|
|
28
|
+
import type { DatabaseClient } from "@mailwoman/sqlite/client"
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* Name of the FTS5 trigram virtual table this module owns. The reader
|
|
31
|
+
* Name of the FTS5 trigram virtual table this module owns. The reader conditions its fuzzy fallback on it.
|
|
32
32
|
*/
|
|
33
33
|
export const CANDIDATE_FTS_TABLE = "candidate_fts"
|
|
34
34
|
|
|
@@ -36,7 +36,7 @@ export const CANDIDATE_FTS_TABLE = "candidate_fts"
|
|
|
36
36
|
* Build (or rebuild) {@link CANDIDATE_FTS_TABLE} from the materialized `candidate` table. Call after the candidate
|
|
37
37
|
* B-tree is populated (build pipeline) or against an existing candidate DB (migration).
|
|
38
38
|
*/
|
|
39
|
-
export function createCandidateFTS(db:
|
|
39
|
+
export function createCandidateFTS<DB>(db: DatabaseClient<DB>): void {
|
|
40
40
|
db.exec(`DROP TABLE IF EXISTS ${CANDIDATE_FTS_TABLE}`)
|
|
41
41
|
db.exec(`CREATE VIRTUAL TABLE ${CANDIDATE_FTS_TABLE} USING fts5(name_key, tokenize='trigram')`)
|
|
42
42
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* Warwick in America the fame of Warwick, Rhode Island, which is the fan-out defect
|
|
28
28
|
* `importance-fanout.ts` documents one layer up, re-introduced at the join. So the group is
|
|
29
29
|
* disambiguated GEOGRAPHICALLY: the nearest centroid wins, and only within
|
|
30
|
-
* {@link
|
|
30
|
+
* {@link IMPORTANCE_JOIN_RADIUS_KM}. Two artifacts describing the same settlement put its centroid in
|
|
31
31
|
* almost the same place; two same-named towns in one country do not.
|
|
32
32
|
*
|
|
33
33
|
* ## What lands in the column
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
* (`resolver/toponym-prior.ts`) leaves an unmeasured candidate exactly where population put it.
|
|
42
42
|
*/
|
|
43
43
|
|
|
44
|
-
import { DatabaseSync } from "node:sqlite"
|
|
45
|
-
|
|
46
44
|
import { haversineKm } from "@mailwoman/spatial"
|
|
45
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client"
|
|
47
46
|
|
|
48
|
-
import {
|
|
47
|
+
import type { CandidateDatabase } from "#candidate-schema"
|
|
48
|
+
import { normalizeLocalityForKey } from "#street/normalize"
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* How far apart two artifacts may put the same place's centroid and still be read as the same place.
|
|
@@ -55,18 +55,18 @@ import { normalizeLocalityForKey } from "./street-normalize.ts"
|
|
|
55
55
|
* country, placetype)`). The nearest-centroid distance is **exactly 0.00 km for 577,080 of them (56.6%)** — the two
|
|
56
56
|
* snapshots agree to the bit — and 656,755 (64.4%) are inside 500 m.
|
|
57
57
|
*
|
|
58
|
-
* What sets the
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
58
|
+
* What sets the radius is where that mode ENDS, and the per-kilometre density states. It falls from 1,076 places/km
|
|
59
|
+
* over 3–5 km to a trough of **441 places/km over 7–10 km**, then climbs back and flattens onto a plateau of 760–780
|
|
60
|
+
* places/km from 30 km out to 100 km and beyond. That plateau is the background rate of two DIFFERENT towns wearing one
|
|
61
|
+
* name in one country, and it does not decay with distance because there is no reason it should. 10 km is the floor
|
|
62
|
+
* between the two populations. Admitting it scores 679,163 places (66.6% of the matched set); pushing the radius to 25
|
|
63
|
+
* km buys 8,722 more, and by then better than half of each additional kilometre is the wrong town.
|
|
64
64
|
*
|
|
65
65
|
* The four-row bare-GB board is insensitive across this whole range — 5 km and 25 km were both measured and select
|
|
66
|
-
* identical rows — so the value is chosen by what the join MEANS, not by what it scores. The
|
|
67
|
-
* "this is the same place"; widening it past the floor starts handing one town's fame to another.
|
|
66
|
+
* identical rows — so the value is chosen by what the join MEANS, not by what it scores. The radius is the definition
|
|
67
|
+
* of "this is the same place"; widening it past the floor starts handing one town's fame to another.
|
|
68
68
|
*/
|
|
69
|
-
export const
|
|
69
|
+
export const IMPORTANCE_JOIN_RADIUS_KM = 10
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* One scored place from the source: where it is, and what it scored.
|
|
@@ -111,17 +111,17 @@ export class ImportanceIndex {
|
|
|
111
111
|
readonly #groups: Map<string, ScoredPlace[]>
|
|
112
112
|
readonly stats: ImportanceIndexStats
|
|
113
113
|
/**
|
|
114
|
-
* Places {@link find} matched inside the
|
|
114
|
+
* Places {@link find} matched inside the radius.
|
|
115
115
|
*/
|
|
116
116
|
matched = 0
|
|
117
117
|
/**
|
|
118
|
-
* Places {@link find} REFUSED — the key matched a scored group, but the nearest member of it was outside the
|
|
119
|
-
* it is a different place wearing the same name.
|
|
118
|
+
* Places {@link find} REFUSED — the key matched a scored group, but the nearest member of it was outside the radius,
|
|
119
|
+
* so it is a different place wearing the same name.
|
|
120
120
|
*
|
|
121
121
|
* This is the number worth watching across rebuilds. A jump means the score source and the admin source have drifted
|
|
122
|
-
* apart and the join is being asked to guess; it does not mean the
|
|
122
|
+
* apart and the join is being asked to guess; it does not mean the radius is too tight.
|
|
123
123
|
*/
|
|
124
|
-
|
|
124
|
+
refused = 0
|
|
125
125
|
|
|
126
126
|
constructor(groups: Map<string, ScoredPlace[]>, stats: ImportanceIndexStats) {
|
|
127
127
|
this.#groups = groups
|
|
@@ -130,7 +130,7 @@ export class ImportanceIndex {
|
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* The importance of the scored place nearest `(lat, lon)` sharing `name`'s folded key, `country` and `placetype`, or
|
|
133
|
-
* null when there is no such place within {@link
|
|
133
|
+
* null when there is no such place within {@link IMPORTANCE_JOIN_RADIUS_KM}.
|
|
134
134
|
*
|
|
135
135
|
* Null is UNMEASURED. Never substitute a zero, and never fall back to a population-derived value here — the source
|
|
136
136
|
* column already carries that fallback where it has one, and inventing a second one would make an absence
|
|
@@ -157,8 +157,8 @@ export class ImportanceIndex {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
if (!best || bestKm >
|
|
161
|
-
this.
|
|
160
|
+
if (!best || bestKm > IMPORTANCE_JOIN_RADIUS_KM) {
|
|
161
|
+
this.refused++
|
|
162
162
|
|
|
163
163
|
return null
|
|
164
164
|
}
|
|
@@ -182,47 +182,43 @@ export class ImportanceIndex {
|
|
|
182
182
|
* 25 s.
|
|
183
183
|
*/
|
|
184
184
|
export function loadImportanceIndex(databasePath: string): ImportanceIndex {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
try {
|
|
188
|
-
const groups = new Map<string, ScoredPlace[]>()
|
|
189
|
-
let places = 0
|
|
190
|
-
let unkeyable = 0
|
|
191
|
-
|
|
192
|
-
for (const row of db
|
|
193
|
-
.prepare(
|
|
194
|
-
`SELECT s.name AS name, s.country AS country, s.placetype AS placetype,
|
|
195
|
-
s.latitude AS latitude, s.longitude AS longitude, i.importance AS importance
|
|
196
|
-
FROM place_importance i JOIN spr s ON s.id = i.id
|
|
197
|
-
WHERE s.is_current != 0 AND s.is_deprecated = 0`
|
|
198
|
-
)
|
|
199
|
-
.iterate()) {
|
|
200
|
-
const importance = Number(row.importance)
|
|
201
|
-
|
|
202
|
-
if (!Number.isFinite(importance)) continue
|
|
203
|
-
const nameKey = normalizeLocalityForKey(String(row.name ?? ""))
|
|
204
|
-
|
|
205
|
-
if (!nameKey) {
|
|
206
|
-
unkeyable++
|
|
207
|
-
|
|
208
|
-
continue
|
|
209
|
-
}
|
|
185
|
+
using db = new DatabaseClient<CandidateDatabase>(databasePath, { readOnly: true })
|
|
210
186
|
|
|
211
|
-
|
|
212
|
-
|
|
187
|
+
const groups = new Map<string, ScoredPlace[]>()
|
|
188
|
+
let places = 0
|
|
189
|
+
let unkeyable = 0
|
|
213
190
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
191
|
+
for (const row of db
|
|
192
|
+
.prepare(
|
|
193
|
+
`SELECT s.name AS name, s.country AS country, s.placetype AS placetype,
|
|
194
|
+
s.latitude AS latitude, s.longitude AS longitude, i.importance AS importance
|
|
195
|
+
FROM place_importance i JOIN spr s ON s.id = i.id
|
|
196
|
+
WHERE s.is_current != 0 AND s.is_deprecated = 0`
|
|
197
|
+
)
|
|
198
|
+
.iterate()) {
|
|
199
|
+
const importance = Number(row.importance)
|
|
218
200
|
|
|
219
|
-
|
|
201
|
+
if (!Number.isFinite(importance)) continue
|
|
202
|
+
const nameKey = normalizeLocalityForKey(String(row.name ?? ""))
|
|
220
203
|
|
|
221
|
-
|
|
204
|
+
if (!nameKey) {
|
|
205
|
+
unkeyable++
|
|
206
|
+
|
|
207
|
+
continue
|
|
222
208
|
}
|
|
223
209
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
210
|
+
const key = groupKey(nameKey, row.country as string | null, row.placetype as string | null)
|
|
211
|
+
let group = groups.get(key)
|
|
212
|
+
|
|
213
|
+
if (!group) {
|
|
214
|
+
group = []
|
|
215
|
+
groups.set(key, group)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
group.push({ lat: Number(row.latitude), lon: Number(row.longitude), importance })
|
|
219
|
+
|
|
220
|
+
places++
|
|
227
221
|
}
|
|
222
|
+
|
|
223
|
+
return new ImportanceIndex(groups, { places, keys: groups.size, unkeyable })
|
|
228
224
|
}
|