@mailwoman/resolver-wof-sqlite 9.2.0 → 9.4.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} +25 -24
- package/{address-point-schema.ts → lib/address/point-schema.ts} +18 -4
- package/lib/address/point.ts +328 -0
- package/{ancestry-backfill.ts → lib/ancestry/backfill.ts} +14 -19
- package/{ancestry.ts → lib/ancestry/index.ts} +5 -4
- package/{build-candidate.ts → lib/build-candidate.ts} +99 -79
- 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/lib/candidate/extract-fold.ts +219 -0
- package/{candidate → lib/candidate}/name-roles.ts +17 -16
- package/{candidate → lib/candidate}/own-name.ts +2 -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} +84 -80
- package/{candidate-schema.ts → lib/candidate-schema.ts} +6 -6
- 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} +9 -13
- 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} +10 -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} +40 -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} +28 -26
- package/{lookup.ts → lib/lookup.ts} +130 -142
- 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 -16
- package/lib/poi/index.ts +8 -0
- package/{poi-lookup.ts → lib/poi/lookup.ts} +22 -29
- 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} +43 -14
- 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 -47
- package/{schema.ts → lib/schema.ts} +10 -0
- package/{search-fetch.ts → lib/search-fetch.ts} +29 -29
- package/{sqlite-convention-source.ts → lib/sqlite-convention-source.ts} +9 -10
- package/{sqlite-utils.ts → lib/sqlite-utils.ts} +14 -19
- package/{street-centroid-schema.ts → lib/street/centroid-schema.ts} +5 -5
- package/{street-centroid.ts → lib/street/centroid.ts} +15 -22
- 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} +86 -20
- 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 -19
- package/{uprn-schema.ts → lib/uprn/schema.ts} +3 -3
- package/lib/weights-overlay-linker.ts +879 -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} +12 -11
- 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} +19 -9
- package/out/address/point.d.ts.map +1 -0
- package/out/address/point.js +222 -0
- 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 +32 -24
- package/out/build-candidate.d.ts.map +1 -1
- package/out/build-candidate.js +60 -54
- 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 +41 -0
- package/out/candidate/extract-fold.d.ts.map +1 -0
- package/out/candidate/extract-fold.js +153 -0
- 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 +2 -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 +16 -14
- package/out/candidate-lookup.d.ts.map +1 -1
- package/out/candidate-lookup.js +67 -63
- package/out/candidate-lookup.js.map +1 -1
- package/out/candidate-schema.d.ts +6 -6
- package/out/candidate-schema.d.ts.map +1 -1
- package/out/candidate-schema.js +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 +7 -6
- 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 +5 -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} +9 -13
- package/out/fst/freshness.d.ts.map +1 -0
- package/out/{fst-freshness.js → fst/freshness.js} +40 -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 +11 -10
- 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 +22 -21
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +103 -113
- 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 -6
- package/out/place-importance-schema.d.ts.map +1 -1
- package/out/place-importance-schema.js +3 -4
- 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 +15 -7
- package/out/primary-preference.d.ts.map +1 -1
- package/out/primary-preference.js +28 -12
- 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 -9
- package/out/sqlite-utils.d.ts.map +1 -1
- package/out/sqlite-utils.js +6 -10
- 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} +7 -7
- 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} +38 -15
- package/out/street/normalize.d.ts.map +1 -0
- package/out/{street-normalize.js → street/normalize.js} +73 -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 +339 -86
- package/out/weights-overlay-linker.js.map +1 -1
- package/package.json +465 -269
- package/address-point.ts +0 -218
- package/candidate/shard-fold.ts +0 -137
- 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 +0 -140
- 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 +0 -104
- 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
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
* Output: an `FSTMatcher` ready to serialize via `serializeFST` to e.g.
|
|
23
23
|
* `fst-street-morphology.bin`.
|
|
24
24
|
*/
|
|
25
|
-
import {
|
|
26
|
-
import { join } from "
|
|
25
|
+
import { isDirectory, readDirectory, readLocalTextFile, statPath } from "@mailwoman/core/fs/readers";
|
|
26
|
+
import { join } from "path-ts";
|
|
27
27
|
import { TextSpliterator } from "spliterator";
|
|
28
|
-
import { FSTMatcher, normalizeTokens } from "
|
|
28
|
+
import { FSTMatcher, normalizeTokens } from "#fst/matcher";
|
|
29
29
|
/**
|
|
30
30
|
* Reserved synthetic wofID base for street-morphology entries. 32-bit unsigned, well above any realistic WOF
|
|
31
31
|
* allocation. Reusing the same base across rebuilds keeps IDs stable for any consumer that caches them. See
|
|
@@ -51,7 +51,7 @@ function parseLine(line) {
|
|
|
51
51
|
return null;
|
|
52
52
|
return { canonical: parts[0], variants: parts };
|
|
53
53
|
}
|
|
54
|
-
export function buildStreetMorphologyFST(opts) {
|
|
54
|
+
export async function buildStreetMorphologyFST(opts) {
|
|
55
55
|
const progress = opts.onProgress ?? (() => { });
|
|
56
56
|
const minVariantLength = opts.minVariantLength ?? 3;
|
|
57
57
|
// Discover locales — either provided explicitly, or all directories containing street_types.txt.
|
|
@@ -61,18 +61,23 @@ export function buildStreetMorphologyFST(opts) {
|
|
|
61
61
|
locales = opts.locales;
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
|
|
64
|
+
const entries = await readDirectory(opts.dictionariesDir);
|
|
65
|
+
const localeProbes = [];
|
|
66
|
+
for (const entry of entries) {
|
|
65
67
|
const localePath = join(opts.dictionariesDir, entry);
|
|
66
|
-
if (!
|
|
67
|
-
|
|
68
|
+
if (!(await isDirectory(localePath))) {
|
|
69
|
+
localeProbes.push([entry, false]);
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
68
72
|
try {
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
await statPath(join(localePath, STREET_TYPES_FILENAME));
|
|
74
|
+
localeProbes.push([entry, true]);
|
|
71
75
|
}
|
|
72
76
|
catch {
|
|
73
|
-
|
|
77
|
+
localeProbes.push([entry, false]);
|
|
74
78
|
}
|
|
75
|
-
}
|
|
79
|
+
}
|
|
80
|
+
locales = localeProbes.filter(([, hasFile]) => hasFile).map(([entry]) => entry);
|
|
76
81
|
}
|
|
77
82
|
progress("discover", `Found ${locales.length} locales with ${STREET_TYPES_FILENAME}`);
|
|
78
83
|
// Collect canonical → set-of-variants across all locales. Same canonical form may appear in
|
|
@@ -80,7 +85,7 @@ export function buildStreetMorphologyFST(opts) {
|
|
|
80
85
|
const canonicalToVariants = new Map();
|
|
81
86
|
for (const locale of locales) {
|
|
82
87
|
const filePath = join(opts.dictionariesDir, locale, STREET_TYPES_FILENAME);
|
|
83
|
-
const content =
|
|
88
|
+
const content = await readLocalTextFile(filePath);
|
|
84
89
|
for (const line of TextSpliterator.from(content)) {
|
|
85
90
|
const parsed = parseLine(line);
|
|
86
91
|
if (!parsed)
|
|
@@ -175,4 +180,4 @@ export function buildStreetMorphologyFST(opts) {
|
|
|
175
180
|
locales,
|
|
176
181
|
};
|
|
177
182
|
}
|
|
178
|
-
//# sourceMappingURL=
|
|
183
|
+
//# sourceMappingURL=morphology-fst-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morphology-fst-builder.js","sourceRoot":"","sources":["../../lib/street/morphology-fst-builder.ts"],"names":[],"mappings":"AAAA;;;;;;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SAAS;QACT,cAAc,EAAE,WAAW;QAC3B,iBAAiB,EAAE,CAAC,EAAE,uDAAuD;QAC7E,QAAQ,EAAE,IAAI,CAAC,eAAe;KAC9B,CAAA;IAED,OAAO;QACN,OAAO;QACP,UAAU;QACV,cAAc,EAAE,gBAAgB,CAAC,MAAM;QACvC,YAAY;QACZ,WAAW;QACX,OAAO;KACP,CAAA;AACF,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Unified runtime loader for the street-morphology FST — the #1315 street-context
|
|
6
|
+
* Unified runtime loader for the street-morphology FST — the #1315 street-context check's signal
|
|
7
7
|
* source, previously rebuilt from the libpostal dictionaries per process at three duplicate call
|
|
8
8
|
* sites (runtime pipeline / parity eval / neural harness). The sealed artifact
|
|
9
9
|
* (`fst-street-morphology.bin`, built by `mailwoman gazetteer build street-morphology`) replaces
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
* Browsers can't take the fallback (no fs) — they deserialize the same artifact via
|
|
21
21
|
* `fst-deserialize-web.ts` (see the docs demo loader).
|
|
22
22
|
*/
|
|
23
|
-
import type { FSTMatcher } from "
|
|
24
|
-
import type { FSTProvenance } from "
|
|
23
|
+
import type { FSTMatcher } from "#fst/matcher";
|
|
24
|
+
import type { FSTProvenance } from "#fst/types";
|
|
25
25
|
/**
|
|
26
26
|
* The sealed artifact's canonical filename — identical in the data-root staging dir and as a weights-package sibling.
|
|
27
27
|
*/
|
|
@@ -63,5 +63,5 @@ export interface LoadedStreetMorphologyFST {
|
|
|
63
63
|
/**
|
|
64
64
|
* Load the street-morphology matcher: sealed artifact first, per-process dictionary build as the degrade path.
|
|
65
65
|
*/
|
|
66
|
-
export declare function loadStreetMorphologyFST(opts?: LoadStreetMorphologyFSTOpts): LoadedStreetMorphologyFST
|
|
67
|
-
//# sourceMappingURL=
|
|
66
|
+
export declare function loadStreetMorphologyFST(opts?: LoadStreetMorphologyFSTOpts): Promise<LoadedStreetMorphologyFST>;
|
|
67
|
+
//# sourceMappingURL=morphology-fst-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morphology-fst-loader.d.ts","sourceRoot":"","sources":["../../lib/street/morphology-fst-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C;;GAEG;AACH,eAAO,MAAM,mCAAmC,8BAA8B,CAAA;AAE9E;;GAEG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,CAE5D;AAED,MAAM,WAAW,2BAA2B;IAC3C;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAClC;AAED,MAAM,WAAW,yBAAyB;IACzC,OAAO,EAAE,UAAU,CAAA;IACnB;;OAEG;IACH,MAAM,EAAE,UAAU,GAAG,OAAO,CAAA;IAC5B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC5C,IAAI,GAAE,2BAAgC,GACpC,OAAO,CAAC,yBAAyB,CAAC,CAuBpC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Unified runtime loader for the street-morphology FST — the #1315 street-context
|
|
6
|
+
* Unified runtime loader for the street-morphology FST — the #1315 street-context check's signal
|
|
7
7
|
* source, previously rebuilt from the libpostal dictionaries per process at three duplicate call
|
|
8
8
|
* sites (runtime pipeline / parity eval / neural harness). The sealed artifact
|
|
9
9
|
* (`fst-street-morphology.bin`, built by `mailwoman gazetteer build street-morphology`) replaces
|
|
@@ -20,10 +20,11 @@
|
|
|
20
20
|
* Browsers can't take the fallback (no fs) — they deserialize the same artifact via
|
|
21
21
|
* `fst-deserialize-web.ts` (see the docs demo loader).
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
23
|
+
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
24
|
+
import { pathExists, readLocalBuffer } from "@mailwoman/core/fs/readers";
|
|
25
|
+
import { resourceDictionaryPath } from "@mailwoman/core/paths";
|
|
26
|
+
import { deserializeFST, readFSTProvenance } from "#fst/serialize";
|
|
27
|
+
import { buildStreetMorphologyFST } from "#street/morphology-fst-builder";
|
|
27
28
|
/**
|
|
28
29
|
* The sealed artifact's canonical filename — identical in the data-root staging dir and as a weights-package sibling.
|
|
29
30
|
*/
|
|
@@ -37,12 +38,12 @@ export function defaultStreetMorphologyArtifactPath() {
|
|
|
37
38
|
/**
|
|
38
39
|
* Load the street-morphology matcher: sealed artifact first, per-process dictionary build as the degrade path.
|
|
39
40
|
*/
|
|
40
|
-
export function loadStreetMorphologyFST(opts = {}) {
|
|
41
|
+
export async function loadStreetMorphologyFST(opts = {}) {
|
|
41
42
|
const warn = opts.onWarn ?? (() => { });
|
|
42
43
|
const artifactPath = opts.artifactPath ?? defaultStreetMorphologyArtifactPath();
|
|
43
|
-
if (
|
|
44
|
+
if (await pathExists(artifactPath)) {
|
|
44
45
|
try {
|
|
45
|
-
const buf =
|
|
46
|
+
const buf = await readLocalBuffer(artifactPath);
|
|
46
47
|
const matcher = deserializeFST(buf);
|
|
47
48
|
const provenance = readFSTProvenance(buf);
|
|
48
49
|
return { matcher, source: "artifact", path: artifactPath, ...(provenance ? { provenance } : {}) };
|
|
@@ -51,9 +52,9 @@ export function loadStreetMorphologyFST(opts = {}) {
|
|
|
51
52
|
warn(`street-morphology artifact at ${artifactPath} unreadable (${error.message}) — falling back to the dictionary build`);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
const built = buildStreetMorphologyFST({
|
|
55
|
+
const built = await buildStreetMorphologyFST({
|
|
55
56
|
dictionariesDir: opts.dictionariesDir ?? resourceDictionaryPath("libpostal"),
|
|
56
57
|
});
|
|
57
58
|
return { matcher: built.matcher, source: "built", provenance: built.provenance };
|
|
58
59
|
}
|
|
59
|
-
//# sourceMappingURL=
|
|
60
|
+
//# sourceMappingURL=morphology-fst-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"morphology-fst-loader.js","sourceRoot":"","sources":["../../lib/street/morphology-fst-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAG9D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAElE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AAEzE;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,2BAA2B,CAAA;AAE9E;;GAEG;AACH,MAAM,UAAU,mCAAmC;IAClD,OAAO,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,mCAAmC,CAAC,CAAC,CAAA;AACxE,CAAC;AAkCD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC5C,OAAoC,EAAE;IAEtC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;IACtC,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,IAAI,mCAAmC,EAAE,CAAA;IAE/E,IAAI,MAAM,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC;YACJ,MAAM,GAAG,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,CAAA;YAC/C,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,CAAC,CAAA;YACnC,MAAM,UAAU,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAA;YAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAA;QAClG,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,CACH,iCAAiC,YAAY,gBAAiB,KAAe,CAAC,OAAO,0CAA0C,CAC/H,CAAA;QACF,CAAC;IACF,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,wBAAwB,CAAC;QAC5C,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,sBAAsB,CAAC,WAAW,CAAC;KAC5E,CAAC,CAAA;IAEF,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAA;AACjF,CAAC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Reads a street-name index (the FR instance = BAN `street-centroids-fr.db`, a `street_centroid`
|
|
9
9
|
* table of `street_norm × locality_base × postcode` rows) and answers "does this street surface
|
|
10
10
|
* exist as a name" for the k-best rerank. Sync-by-interface, `readOnly`, prepared statements,
|
|
11
|
-
* graceful-degrade on a tableless
|
|
11
|
+
* graceful-degrade on a tableless extract — the same reader discipline as `AddressPointSqliteLookup`.
|
|
12
12
|
*
|
|
13
13
|
* THE FOLD CONTRACT: the surface is folded with {@link foldStreetSurface} (the shared function),
|
|
14
14
|
* and the DB's `street_norm` column MUST have been built with that SAME fold or every hyphenated /
|
|
@@ -33,14 +33,11 @@ export interface SQLiteStreetNameLookupOpts {
|
|
|
33
33
|
* A {@link StreetLocalityEvidence} backed by a street-name SQLite index. Positive evidence only: any doubt (missing
|
|
34
34
|
* table, read miss) returns `false`, so the rerank fails open to the model's ranking.
|
|
35
35
|
*/
|
|
36
|
-
export declare class SQLiteStreetNameLookup implements StreetLocalityEvidence {
|
|
36
|
+
export declare class SQLiteStreetNameLookup implements StreetLocalityEvidence, Disposable {
|
|
37
37
|
#private;
|
|
38
38
|
readonly countries: ReadonlySet<string>;
|
|
39
39
|
constructor(dbPath: string, opts?: SQLiteStreetNameLookupOpts);
|
|
40
40
|
hasStreetName(streetSurface: string, scope?: StreetEvidenceScope): boolean;
|
|
41
|
-
|
|
42
|
-
* Close the underlying handle.
|
|
43
|
-
*/
|
|
44
|
-
close(): void;
|
|
41
|
+
[Symbol.dispose](): void;
|
|
45
42
|
}
|
|
46
|
-
//# sourceMappingURL=
|
|
43
|
+
//# sourceMappingURL=name-lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-lookup.d.ts","sourceRoot":"","sources":["../../lib/street/name-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAqB,KAAK,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAM9G,MAAM,WAAW,0BAA0B;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;GAGG;AACH,qBAAa,sBAAuB,YAAW,sBAAsB,EAAE,UAAU;;IAChF,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;gBAM3B,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,0BAA+B;IAqBjE,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,mBAAmB,GAAG,OAAO;IAuB1E,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI;CAGxB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Reads a street-name index (the FR instance = BAN `street-centroids-fr.db`, a `street_centroid`
|
|
9
9
|
* table of `street_norm × locality_base × postcode` rows) and answers "does this street surface
|
|
10
10
|
* exist as a name" for the k-best rerank. Sync-by-interface, `readOnly`, prepared statements,
|
|
11
|
-
* graceful-degrade on a tableless
|
|
11
|
+
* graceful-degrade on a tableless extract — the same reader discipline as `AddressPointSqliteLookup`.
|
|
12
12
|
*
|
|
13
13
|
* THE FOLD CONTRACT: the surface is folded with {@link foldStreetSurface} (the shared function),
|
|
14
14
|
* and the DB's `street_norm` column MUST have been built with that SAME fold or every hyphenated /
|
|
@@ -18,20 +18,9 @@
|
|
|
18
18
|
* then this class is correct-by-construction against a fixture built with the contract fold, and
|
|
19
19
|
* the production rebuild is a tracked BAN-sdk follow-up.
|
|
20
20
|
*/
|
|
21
|
-
import { DatabaseSync } from "node:sqlite";
|
|
22
21
|
import { foldStreetSurface } from "@mailwoman/resolver";
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return row !== undefined;
|
|
26
|
-
}
|
|
27
|
-
function hasColumn(db, table, column) {
|
|
28
|
-
// `table` is a caller-controlled identifier (default `street_centroid`), not user input — safe to interpolate.
|
|
29
|
-
for (const row of db.prepare(`PRAGMA table_info(${table})`).all()) {
|
|
30
|
-
if (row.name === column)
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
22
|
+
import { DatabaseClient } from "@mailwoman/sqlite/client";
|
|
23
|
+
import { hasColumn, hasTable } from "#sqlite-utils";
|
|
35
24
|
/**
|
|
36
25
|
* A {@link StreetLocalityEvidence} backed by a street-name SQLite index. Positive evidence only: any doubt (missing
|
|
37
26
|
* table, read miss) returns `false`, so the rerank fails open to the model's ranking.
|
|
@@ -44,12 +33,12 @@ export class SQLiteStreetNameLookup {
|
|
|
44
33
|
#byNamePostcode;
|
|
45
34
|
constructor(dbPath, opts = {}) {
|
|
46
35
|
this.countries = new Set([...(opts.countries ?? ["FR"])].map((c) => c.toUpperCase()));
|
|
47
|
-
this.#db = new
|
|
36
|
+
this.#db = new DatabaseClient(dbPath, { readOnly: true });
|
|
48
37
|
const table = opts.table ?? "street_centroid";
|
|
49
|
-
// Degrade gracefully on an empty/tableless
|
|
38
|
+
// Degrade gracefully on an empty/tableless extract — a no-op miss, never a crash (#568 discipline).
|
|
50
39
|
if (hasTable(this.#db, table)) {
|
|
51
40
|
// Prefer the #727 phase-4c `name_key` column (foldStreetSurface, indexed by `idx_sc_name` for a direct seek);
|
|
52
|
-
// fall back to `street_norm` on a pre-rebuild
|
|
41
|
+
// fall back to `street_norm` on a pre-rebuild extract (a skip-scan, but correct). The fold used to build
|
|
53
42
|
// `name_key` MUST match `foldStreetSurface` here (the fold-parity contract).
|
|
54
43
|
const keyCol = hasColumn(this.#db, table, "name_key") ? "name_key" : "street_norm";
|
|
55
44
|
this.#byName = this.#db.prepare(`SELECT 1 FROM ${table} WHERE ${keyCol} = ? LIMIT 1`);
|
|
@@ -75,11 +64,8 @@ export class SQLiteStreetNameLookup {
|
|
|
75
64
|
}
|
|
76
65
|
return this.#byName.get(norm) !== undefined;
|
|
77
66
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*/
|
|
81
|
-
close() {
|
|
82
|
-
this.#db.close();
|
|
67
|
+
[Symbol.dispose]() {
|
|
68
|
+
this.#db[Symbol.dispose]();
|
|
83
69
|
}
|
|
84
70
|
}
|
|
85
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=name-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-lookup.js","sourceRoot":"","sources":["../../lib/street/name-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;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1E,CAAA;YAED,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,iBAAiB,KAAK,UAAU,MAAM,+BAA+B,CAAC,CAAA;QAC/G,CAAC;IACF,CAAC;IAED,aAAa,CAAC,aAAqB,EAAE,KAA2B;QAC/D,IAAI,CAAC,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAA;QAC/B,MAAM,IAAI,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAA;QAE7C,IAAI,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QAEvB,oHAAoH;QACpH,iHAAiH;QACjH,IACC,KAAK,EAAE,QAAQ;YACf,IAAI,CAAC,eAAe;YACpB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,SAAS,EAC9E,CAAC;YACF,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,IAAI,KAAK,EAAE,QAAQ,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,SAAS,EAAE,CAAC;YAC7G,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,SAAS,CAAA;IAC5C,CAAC;IAED,CAAC,MAAM,CAAC,OAAO,CAAC;QACf,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAA;IAC3B,CAAC;CACD"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* THE street normalizer for the address-point tier (#476). One function, used by BOTH the
|
|
7
|
-
* builder (`scripts/build-address-point-
|
|
6
|
+
* THE street normalizer for the address-point tier (#476). One function, used by BOTH the extract
|
|
7
|
+
* builder (`scripts/build-address-point-extract.ts`) and the lookup tier (`address-point.ts`) —
|
|
8
8
|
* never two implementations (the PLACETYPE_ORDER lesson: parallel copies silently corrupt).
|
|
9
9
|
*
|
|
10
10
|
* Normalization contract (deliberately aggressive — both sides apply the same function, so
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
import type { Tagged } from "type-fest";
|
|
25
25
|
/**
|
|
26
26
|
* A place name folded by {@link normalizeLocalityForKey} — the value stored in, and required to probe, every
|
|
27
|
-
* `name_key`-style column: the candidate gazetteer, the postal-city side-index, the street-centroid
|
|
28
|
-
* chain's `parent_name_key`, and the address-point locality scope.
|
|
27
|
+
* `name_key`-style column: the candidate gazetteer, the postal-city side-index, the street-centroid extract, an
|
|
28
|
+
* ancestor chain's `parent_name_key`, and the address-point locality scope.
|
|
29
29
|
*
|
|
30
30
|
* The brand is here because the fold is applied at BUILD time and is therefore mandatory at QUERY time, while a
|
|
31
31
|
* near-miss approximation of it (`toLowerCase()`, `trim()`) is still a `string`: it binds to the parameter, returns
|
|
32
32
|
* fewer rows, and the shortfall reads as a coverage gap in the data rather than a defect in the probe. Requiring the
|
|
33
|
-
* brand at the
|
|
33
|
+
* brand at the boundary turns that silent under-match into a compile error. Mint one only by calling the fold.
|
|
34
34
|
*/
|
|
35
35
|
export type NameKey = Tagged<string, "NameKey">;
|
|
36
36
|
/**
|
|
@@ -62,7 +62,18 @@ export declare function normalizeStreetForKey(street: string): StreetKey;
|
|
|
62
62
|
* article, so no salient-token / multi-key index is built yet (deferred until probing shows the normalizer can't absorb
|
|
63
63
|
* the false-negatives).
|
|
64
64
|
*/
|
|
65
|
-
export type StreetLocale = "us" | "en" | "fr" | "de" | "nl" | "pl" | "vn" | "id";
|
|
65
|
+
export type StreetLocale = "us" | "en" | "fr" | "de" | "nl" | "pl" | "vn" | "id" | "zh";
|
|
66
|
+
/**
|
|
67
|
+
* Country → street-locale registry surface for the acquisition SDKs (BAN, OSM). Each SDK keeps its own map — membership
|
|
68
|
+
* is a per-register decision — and this factory owns the lookup discipline: throw for an unsupported country rather
|
|
69
|
+
* than silently folding with the wrong rules, because a extract built with the wrong normalizer keys every street
|
|
70
|
+
* incorrectly and looks fine until a probe misses. `label` is the SDK's own registration instructions, appended to the
|
|
71
|
+
* error verbatim.
|
|
72
|
+
*/
|
|
73
|
+
export declare function createStreetLocaleRegistry(registry: ReadonlyMap<string, StreetLocale>, label: string): {
|
|
74
|
+
localeFor: (countryCode: string) => StreetLocale;
|
|
75
|
+
supported: () => string[];
|
|
76
|
+
};
|
|
66
77
|
/**
|
|
67
78
|
* Normalize a street name for the address-point key in a non-US locale. Same function build-side and probe-side (the
|
|
68
79
|
* one-function discipline). US delegates to {@link normalizeStreetForKey}.
|
|
@@ -77,7 +88,7 @@ export type StreetLocale = "us" | "en" | "fr" | "de" | "nl" | "pl" | "vn" | "id"
|
|
|
77
88
|
* {@link PL_LEADING_TYPE} for the measured reason expansion was wrong for this source.
|
|
78
89
|
* - **vn** — fold + đ→d AND ð→d (both non-decomposing, and OSM mixes the two codepoints inside single values — see the
|
|
79
90
|
* branch comment). Deliberately NO type-abbreviation map yet: the common abbreviation is the single letter "Đ." for
|
|
80
|
-
* Đường, and expanding a bare folded "d" token would rewrite initials — measure the miss rate on the built
|
|
91
|
+
* Đường, and expanding a bare folded "d" token would rewrite initials — measure the miss rate on the built extract
|
|
81
92
|
* before adding anything.
|
|
82
93
|
* - **id** — fold + expand leading type abbreviations (jl/jln→jalan, gg→gang); Indonesian street surfaces are otherwise
|
|
83
94
|
* ASCII-clean.
|
|
@@ -88,7 +99,19 @@ export declare function normalizeStreetForKeyLocale(street: string, locale: Stre
|
|
|
88
99
|
*/
|
|
89
100
|
export declare function normalizeLocalityForKey(locality: string): NameKey;
|
|
90
101
|
/**
|
|
91
|
-
*
|
|
102
|
+
* The locality key under a street locale: the Han fold for `zh`, {@link normalizeLocalityForKey} for every other.
|
|
103
|
+
* Separate from the shared fold on purpose — the candidate gazetteer's `name_key` column is the shared fold, and a Han
|
|
104
|
+
* rule inside it would re-key every 臺 name under an extract built without the rule.
|
|
105
|
+
*/
|
|
106
|
+
export declare function normalizeLocalityForKeyLocale(locality: string, locale: StreetLocale): NameKey;
|
|
107
|
+
/**
|
|
108
|
+
* The house-number key under a street locale. Every Latin register stores a lower-cased, trimmed number and the reader
|
|
109
|
+
* probes the same; `zh` additionally folds width and drops the trailing 號 the Taiwanese registers write on the number
|
|
110
|
+
* itself (`122號`), which a parse also carries on the `house_number` span (`122號`). Both sides key `122`.
|
|
111
|
+
*/
|
|
112
|
+
export declare function normalizeHouseNumberForKey(number: string, locale: StreetLocale): string;
|
|
113
|
+
/**
|
|
114
|
+
* Surface-driven street-locale ROUTER for bilingual extracts — the Québec finishing move on the CA rooftop extract.
|
|
92
115
|
*
|
|
93
116
|
* A country registers ONE street locale, but Canada's street surfaces are two languages: under the `en` rules a French
|
|
94
117
|
* surface passes through mostly unchanged (both sides fold identically, so those rows stay reachable), and what breaks
|
|
@@ -96,11 +119,11 @@ export declare function normalizeLocalityForKey(locality: string): NameKey;
|
|
|
96
119
|
* misses a full-word row and vice versa. Routing on the SURFACE (not the province) also carries bilingual NB and the
|
|
97
120
|
* French street names outside Québec for free.
|
|
98
121
|
*
|
|
99
|
-
* ONE function, called by the
|
|
122
|
+
* ONE function, called by the extract BUILDER and the query PROBE alike — the #861 discipline: routing is part of the
|
|
100
123
|
* fold contract, and two transcriptions of this predicate would diverge exactly where it matters. Only an `en` base
|
|
101
|
-
* re-routes: a `fr`/`de`/`nl`
|
|
124
|
+
* re-routes: a `fr`/`de`/`nl` extract already speaks its own rules, and the US pipeline stays untouched.
|
|
102
125
|
*
|
|
103
|
-
* Measured basis (CA
|
|
126
|
+
* Measured basis (CA extract, 2026-08-19): 183,963 distinct surfaces, 43,762 French-lead; 29,682 fold differently under
|
|
104
127
|
* fr-vs-en (888,265 rows), and the non-French half of those are English surfaces this router keeps on `en` unchanged.
|
|
105
128
|
*/
|
|
106
129
|
export declare function streetLocaleForSurface(street: string, base: StreetLocale): StreetLocale;
|
|
@@ -138,9 +161,9 @@ export declare function stripLocalityQualifier(locality: string): string;
|
|
|
138
161
|
* (the state abbreviation form) fold to `state route N…`. Only digit-leading route numbers fold — `State Street` and
|
|
139
162
|
* friends never match.
|
|
140
163
|
*
|
|
141
|
-
* Used by BOTH the segment-
|
|
142
|
-
* one-function discipline as {@link normalizeStreetForKey}. The address-point tier (#476) does NOT apply it yet:
|
|
143
|
-
* adopting it there requires a
|
|
164
|
+
* Used by BOTH the segment-extract builder (`scripts/build-interpolation-extract.ts`) and the interpolation lookup —
|
|
165
|
+
* same one-function discipline as {@link normalizeStreetForKey}. The address-point tier (#476) does NOT apply it yet:
|
|
166
|
+
* adopting it there requires a extract rebuild (noted on #483).
|
|
144
167
|
*
|
|
145
168
|
* A same-numbered US and state route stay DISTINCT keys (`us route 5` vs `state route 5`); only the BARE `route N` form
|
|
146
169
|
* is ambiguous (designator unknown) and it stays unfolded — a bare-route query therefore misses rather than guessing a
|
|
@@ -165,4 +188,4 @@ export declare function canonicalizeRouteKey(streetNorm: StreetKey): RouteKey;
|
|
|
165
188
|
* Deduplicated and ordered most-literal-first, so probing the list in order preserves the primary key's precedence.
|
|
166
189
|
*/
|
|
167
190
|
export declare function streetKeyVariants(street: string, locale?: StreetLocale): StreetKey[];
|
|
168
|
-
//# sourceMappingURL=
|
|
191
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../lib/street/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;;;;;;GASG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM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;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA+C/D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,CASpE;AAWD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,YAAmB,GAAG,SAAS,EAAE,CA8C1F"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* THE street normalizer for the address-point tier (#476). One function, used by BOTH the
|
|
7
|
-
* builder (`scripts/build-address-point-
|
|
6
|
+
* THE street normalizer for the address-point tier (#476). One function, used by BOTH the extract
|
|
7
|
+
* builder (`scripts/build-address-point-extract.ts`) and the lookup tier (`address-point.ts`) —
|
|
8
8
|
* never two implementations (the PLACETYPE_ORDER lesson: parallel copies silently corrupt).
|
|
9
9
|
*
|
|
10
10
|
* Normalization contract (deliberately aggressive — both sides apply the same function, so
|
|
@@ -30,8 +30,8 @@ const MIN_TOKENS_FOR_TAIL_MERGE = 3;
|
|
|
30
30
|
/**
|
|
31
31
|
* Spelled ordinal street names → their digit-ordinal form ("tenth" → "10th"), applied ONLY when a street-type suffix
|
|
32
32
|
* follows (#723 admin-tail) — so the ordinal cross-streets common in grid cities ("Tenth Street", "Fifth Avenue") match
|
|
33
|
-
* the
|
|
34
|
-
* Bank Rd" stays "first national …"). Digit-source
|
|
33
|
+
* the extracts' digit keys, WITHOUT rewriting ordinal-WORD names where the next token is not a suffix ("First National
|
|
34
|
+
* Bank Rd" stays "first national …"). Digit-source extracts are unaffected (a digit token isn't in this map), so the
|
|
35
35
|
* existing keys need no rebuild; a future rebuild folds any spelled-source key the same way (the one-function
|
|
36
36
|
* discipline).
|
|
37
37
|
*/
|
|
@@ -86,7 +86,7 @@ export function normalizeStreetForKey(street) {
|
|
|
86
86
|
if (!tokens.length)
|
|
87
87
|
return "";
|
|
88
88
|
// Spelled-ordinal street names → digit form when a street suffix follows ("Tenth Street" →
|
|
89
|
-
// "10th street", #723).
|
|
89
|
+
// "10th street", #723). Conditioned on the next token being a suffix so ordinal-WORD names are untouched.
|
|
90
90
|
for (let i = 0; i < tokens.length - 1; i++) {
|
|
91
91
|
const digit = SPELLED_ORDINAL_TO_DIGIT.get(tokens[i]);
|
|
92
92
|
if (digit && US_STREET_SUFFIX_LOOKUP.has(tokens[i + 1])) {
|
|
@@ -131,6 +131,34 @@ export function normalizeStreetForKey(street) {
|
|
|
131
131
|
}
|
|
132
132
|
return tokens.join(" ");
|
|
133
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* The Han fold shared by every `zh` key: NFKC so a full-width digit or letter keys as its ASCII form (the Taiwanese
|
|
136
|
+
* civil-affairs registers write `122`, a person types `122`), 臺 → 台 (the register writes 臺北市, the common hand writes
|
|
137
|
+
* 台北市), and no whitespace at all, because a Han surface carries none and a stray space would split one key into two.
|
|
138
|
+
* Kanji numerals stay as written: the register spells a road section `一段`, and so does a query.
|
|
139
|
+
*/
|
|
140
|
+
function foldHan(input) {
|
|
141
|
+
return input.normalize("NFKC").replaceAll("臺", "台").replaceAll(/\s+/g, "").toLowerCase();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Country → street-locale registry surface for the acquisition SDKs (BAN, OSM). Each SDK keeps its own map — membership
|
|
145
|
+
* is a per-register decision — and this factory owns the lookup discipline: throw for an unsupported country rather
|
|
146
|
+
* than silently folding with the wrong rules, because a extract built with the wrong normalizer keys every street
|
|
147
|
+
* incorrectly and looks fine until a probe misses. `label` is the SDK's own registration instructions, appended to the
|
|
148
|
+
* error verbatim.
|
|
149
|
+
*/
|
|
150
|
+
export function createStreetLocaleRegistry(registry, label) {
|
|
151
|
+
return {
|
|
152
|
+
localeFor: (countryCode) => {
|
|
153
|
+
const locale = registry.get(countryCode.toLowerCase());
|
|
154
|
+
if (!locale) {
|
|
155
|
+
throw new Error(`No street-normalization locale registered for country "${countryCode}". ${label}`);
|
|
156
|
+
}
|
|
157
|
+
return locale;
|
|
158
|
+
},
|
|
159
|
+
supported: () => [...registry.keys()],
|
|
160
|
+
};
|
|
161
|
+
}
|
|
134
162
|
/**
|
|
135
163
|
* French street-type abbreviations → canonical full form, applied per token after {@link fold}. French address types
|
|
136
164
|
* LEAD the name ("Av. de…", "Bd …", "Pl. …") and "St"/"Ste" abbreviate Saint/Sainte inside names ("Rue St-Honoré" →
|
|
@@ -158,7 +186,7 @@ const FR_STREET_ABBREV = new Map([
|
|
|
158
186
|
["sts", "saints"],
|
|
159
187
|
]);
|
|
160
188
|
/**
|
|
161
|
-
* Polish leading street-type tokens, STRIPPED rather than expanded. Measured on the 5.56M-row PL OSM
|
|
189
|
+
* Polish leading street-type tokens, STRIPPED rather than expanded. Measured on the 5.56M-row PL OSM extract
|
|
162
190
|
* (2026-08-19): OSM Poland tags `addr:street` BARE — `ulica%` covers 22 rows and `ul.%` eight, so an EXPANSION rule
|
|
163
191
|
* makes a typed query ("ul. Świętokrzyska" → "ulica swietokrzyska") miss the 3,846 bare "swietokrzyska" rows. Stripping
|
|
164
192
|
* the leading type on BOTH sides keys typed and bare surfaces identically. The full words are stripped too: the
|
|
@@ -188,7 +216,7 @@ const ID_STREET_ABBREV = new Map([
|
|
|
188
216
|
* {@link PL_LEADING_TYPE} for the measured reason expansion was wrong for this source.
|
|
189
217
|
* - **vn** — fold + đ→d AND ð→d (both non-decomposing, and OSM mixes the two codepoints inside single values — see the
|
|
190
218
|
* branch comment). Deliberately NO type-abbreviation map yet: the common abbreviation is the single letter "Đ." for
|
|
191
|
-
* Đường, and expanding a bare folded "d" token would rewrite initials — measure the miss rate on the built
|
|
219
|
+
* Đường, and expanding a bare folded "d" token would rewrite initials — measure the miss rate on the built extract
|
|
192
220
|
* before adding anything.
|
|
193
221
|
* - **id** — fold + expand leading type abbreviations (jl/jln→jalan, gg→gang); Indonesian street surfaces are otherwise
|
|
194
222
|
* ASCII-clean.
|
|
@@ -196,12 +224,16 @@ const ID_STREET_ABBREV = new Map([
|
|
|
196
224
|
export function normalizeStreetForKeyLocale(street, locale) {
|
|
197
225
|
if (locale === "us" || locale === "en")
|
|
198
226
|
return normalizeStreetForKey(street);
|
|
227
|
+
// A Han street name has no tokens, no type abbreviation and no diacritics; the Latin pipeline below would only
|
|
228
|
+
// split it on whitespace it never carries. `zh` keys are the Han fold and nothing else.
|
|
229
|
+
if (locale === "zh")
|
|
230
|
+
return foldHan(street);
|
|
199
231
|
// Hyphen → space so a compound name keys the same whether the source or the query writes the
|
|
200
232
|
// hyphen ("Champs-Élysées", "St-Honoré") or a space — both sides fold identically, so this is pure
|
|
201
233
|
// robustness. It also splits a hyphenated abbreviation ("St-Honoré" → "st honore") into tokens the
|
|
202
234
|
// per-locale type/Saint map can see. Letter maps for non-decomposing letters (ß, ł, đ) live in the
|
|
203
235
|
// per-locale branches, NEVER here: widening the shared pipeline would silently change keys under
|
|
204
|
-
// every already-built
|
|
236
|
+
// every already-built extract of the other locales.
|
|
205
237
|
const tokens = fold(street)
|
|
206
238
|
.replaceAll("ß", "ss")
|
|
207
239
|
.replaceAll("-", " ")
|
|
@@ -246,7 +278,7 @@ export function normalizeStreetForKeyLocale(street, locale) {
|
|
|
246
278
|
break;
|
|
247
279
|
case "vn":
|
|
248
280
|
// đ (U+0111, d-with-stroke) AND ð (U+00F0, eth): OSM Vietnamese data mixes the two visually
|
|
249
|
-
// identical codepoints inside single values — the 2026-08-19
|
|
281
|
+
// identical codepoints inside single values — the 2026-08-19 extract measured `Đường Trần Hưng
|
|
250
282
|
// Đạo` carrying d-with-stroke at the front and ETH in `Đạo`, splitting the country's most
|
|
251
283
|
// common street into two keys with the MAJORITY variant (630 vs 421 rows) unreachable by a
|
|
252
284
|
// correctly-typed query. No abbreviation map — see the locale table.
|
|
@@ -263,6 +295,30 @@ export function normalizeStreetForKeyLocale(street, locale) {
|
|
|
263
295
|
export function normalizeLocalityForKey(locality) {
|
|
264
296
|
return fold(locality);
|
|
265
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* The locality key under a street locale: the Han fold for `zh`, {@link normalizeLocalityForKey} for every other.
|
|
300
|
+
* Separate from the shared fold on purpose — the candidate gazetteer's `name_key` column is the shared fold, and a Han
|
|
301
|
+
* rule inside it would re-key every 臺 name under an extract built without the rule.
|
|
302
|
+
*/
|
|
303
|
+
export function normalizeLocalityForKeyLocale(locality, locale) {
|
|
304
|
+
return locale === "zh" ? foldHan(locality) : normalizeLocalityForKey(locality);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* The house-number key under a street locale. Every Latin register stores a lower-cased, trimmed number and the reader
|
|
308
|
+
* probes the same; `zh` additionally folds width and drops the trailing 號 the Taiwanese registers write on the number
|
|
309
|
+
* itself (`122號`), which a parse also carries on the `house_number` span (`122號`). Both sides key `122`.
|
|
310
|
+
*/
|
|
311
|
+
export function normalizeHouseNumberForKey(number, locale) {
|
|
312
|
+
// The sub-number is written two ways — `30之19號` and `30號之19` — and an attached number a third (`30附40號`,
|
|
313
|
+
// `55之23附1號`); the register stores the base `30` with the rest in `unit`. Every form keys with the 號 dropped and
|
|
314
|
+
// the base number first, which the reader's sub-number rung then falls from.
|
|
315
|
+
if (locale === "zh") {
|
|
316
|
+
return foldHan(number)
|
|
317
|
+
.replace(/^(\d+)號([之附]\d+)$/u, "$1$2")
|
|
318
|
+
.replace(/號$/u, "");
|
|
319
|
+
}
|
|
320
|
+
return number.trim().toLowerCase();
|
|
321
|
+
}
|
|
266
322
|
/**
|
|
267
323
|
* Leading French street-type token. French types LEAD the name ("avenue du Parc", "boul Saint-Laurent") while English
|
|
268
324
|
* types TRAIL ("Fifth Avenue", "Grosvenor Place"), so a leading type-token is the discriminating signal — "1 Avenue NE"
|
|
@@ -271,7 +327,7 @@ export function normalizeLocalityForKey(locality) {
|
|
|
271
327
|
*/
|
|
272
328
|
const FRENCH_LEAD_TYPE = /^(?:rue|ruelle|av|ave|avenue|boul|bd|boulevard|ch|che|chemin|all[ée]e|imp|impasse|mont[ée]e|c[ôo]te|pl|place|prom|promenade|rang|rte|route|autoroute|carr[eé]|croissant|terrasse|sentier)(?=[\s.-]|$)/i;
|
|
273
329
|
/**
|
|
274
|
-
* Surface-driven street-locale ROUTER for bilingual
|
|
330
|
+
* Surface-driven street-locale ROUTER for bilingual extracts — the Québec finishing move on the CA rooftop extract.
|
|
275
331
|
*
|
|
276
332
|
* A country registers ONE street locale, but Canada's street surfaces are two languages: under the `en` rules a French
|
|
277
333
|
* surface passes through mostly unchanged (both sides fold identically, so those rows stay reachable), and what breaks
|
|
@@ -279,11 +335,11 @@ const FRENCH_LEAD_TYPE = /^(?:rue|ruelle|av|ave|avenue|boul|bd|boulevard|ch|che|
|
|
|
279
335
|
* misses a full-word row and vice versa. Routing on the SURFACE (not the province) also carries bilingual NB and the
|
|
280
336
|
* French street names outside Québec for free.
|
|
281
337
|
*
|
|
282
|
-
* ONE function, called by the
|
|
338
|
+
* ONE function, called by the extract BUILDER and the query PROBE alike — the #861 discipline: routing is part of the
|
|
283
339
|
* fold contract, and two transcriptions of this predicate would diverge exactly where it matters. Only an `en` base
|
|
284
|
-
* re-routes: a `fr`/`de`/`nl`
|
|
340
|
+
* re-routes: a `fr`/`de`/`nl` extract already speaks its own rules, and the US pipeline stays untouched.
|
|
285
341
|
*
|
|
286
|
-
* Measured basis (CA
|
|
342
|
+
* Measured basis (CA extract, 2026-08-19): 183,963 distinct surfaces, 43,762 French-lead; 29,682 fold differently under
|
|
287
343
|
* fr-vs-en (888,265 rows), and the non-French half of those are English surfaces this router keeps on `en` unchanged.
|
|
288
344
|
*/
|
|
289
345
|
export function streetLocaleForSurface(street, base) {
|
|
@@ -358,9 +414,9 @@ export function stripLocalityQualifier(locality) {
|
|
|
358
414
|
* (the state abbreviation form) fold to `state route N…`. Only digit-leading route numbers fold — `State Street` and
|
|
359
415
|
* friends never match.
|
|
360
416
|
*
|
|
361
|
-
* Used by BOTH the segment-
|
|
362
|
-
* one-function discipline as {@link normalizeStreetForKey}. The address-point tier (#476) does NOT apply it yet:
|
|
363
|
-
* adopting it there requires a
|
|
417
|
+
* Used by BOTH the segment-extract builder (`scripts/build-interpolation-extract.ts`) and the interpolation lookup —
|
|
418
|
+
* same one-function discipline as {@link normalizeStreetForKey}. The address-point tier (#476) does NOT apply it yet:
|
|
419
|
+
* adopting it there requires a extract rebuild (noted on #483).
|
|
364
420
|
*
|
|
365
421
|
* A same-numbered US and state route stay DISTINCT keys (`us route 5` vs `state route 5`); only the BARE `route N` form
|
|
366
422
|
* is ambiguous (designator unknown) and it stays unfolded — a bare-route query therefore misses rather than guessing a
|
|
@@ -435,4 +491,4 @@ export function streetKeyVariants(street, locale = "us") {
|
|
|
435
491
|
}
|
|
436
492
|
return variants;
|
|
437
493
|
}
|
|
438
|
-
//# sourceMappingURL=
|
|
494
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../lib/street/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAiCxF;;;GAGG;AACH,MAAM,yBAAyB,GAAG,CAAC,CAAA;AAEnC;;;;;;;GAOG;AACH,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAiB;IACxD,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjB,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACjB,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,OAAO,EAAE,KAAK,CAAC;IAChB,CAAC,SAAS,EAAE,KAAK,CAAC;IAClB,CAAC,QAAQ,EAAE,K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