@mailwoman/resolver 9.1.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -0
- package/admin-coherence-passes.ts +435 -0
- package/admin-containment.ts +101 -0
- package/admin-winner.ts +178 -0
- package/backend-capabilities.ts +88 -0
- package/bare-toponym-race.ts +129 -0
- package/decorate-node.ts +127 -0
- package/fold-name.ts +19 -3
- package/index.ts +14 -0
- package/out/admin-coherence-passes.d.ts +70 -0
- package/out/admin-coherence-passes.d.ts.map +1 -0
- package/out/admin-coherence-passes.js +327 -0
- package/out/admin-coherence-passes.js.map +1 -0
- package/out/admin-containment.d.ts +48 -0
- package/out/admin-containment.d.ts.map +1 -0
- package/out/admin-containment.js +82 -0
- package/out/admin-containment.js.map +1 -0
- package/out/admin-winner.d.ts +109 -0
- package/out/admin-winner.d.ts.map +1 -0
- package/out/admin-winner.js +119 -0
- package/out/admin-winner.js.map +1 -0
- package/out/backend-capabilities.d.ts +37 -0
- package/out/backend-capabilities.d.ts.map +1 -0
- package/out/backend-capabilities.js +75 -0
- package/out/backend-capabilities.js.map +1 -0
- package/out/bare-toponym-race.d.ts +55 -0
- package/out/bare-toponym-race.d.ts.map +1 -0
- package/out/bare-toponym-race.js +110 -0
- package/out/bare-toponym-race.js.map +1 -0
- package/out/decorate-node.d.ts +24 -0
- package/out/decorate-node.d.ts.map +1 -0
- package/out/decorate-node.js +103 -0
- package/out/decorate-node.js.map +1 -0
- package/out/fold-name.d.ts +18 -3
- package/out/fold-name.d.ts.map +1 -1
- package/out/fold-name.js +19 -3
- package/out/fold-name.js.map +1 -1
- package/out/index.d.ts +4 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/postcode-country-coherence.d.ts +31 -10
- package/out/postcode-country-coherence.d.ts.map +1 -1
- package/out/postcode-country-coherence.js +137 -56
- package/out/postcode-country-coherence.js.map +1 -1
- package/out/postcode-prefix.d.ts.map +1 -1
- package/out/postcode-prefix.js +3 -2
- package/out/postcode-prefix.js.map +1 -1
- package/out/postcode-shape-coherence.js.map +1 -1
- package/out/resolve.d.ts +1 -1
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +461 -416
- package/out/resolve.js.map +1 -1
- package/out/span-rescore.d.ts.map +1 -1
- package/out/span-rescore.js +55 -13
- package/out/span-rescore.js.map +1 -1
- package/out/street-evidence.js +1 -1
- package/out/street-evidence.js.map +1 -1
- package/out/street-tier.d.ts.map +1 -1
- package/out/street-tier.js +26 -5
- package/out/street-tier.js.map +1 -1
- package/out/toponym-prior.d.ts +42 -18
- package/out/toponym-prior.d.ts.map +1 -1
- package/out/toponym-prior.js +75 -7
- package/out/toponym-prior.js.map +1 -1
- package/package.json +98 -7
- package/postcode-country-coherence.ts +150 -58
- package/postcode-prefix.ts +3 -2
- package/postcode-shape-coherence.ts +1 -1
- package/resolve.ts +626 -531
- package/span-rescore.ts +64 -15
- package/street-evidence.ts +1 -1
- package/street-tier.ts +29 -5
- package/toponym-prior.ts +96 -7
package/out/fold-name.js
CHANGED
|
@@ -3,16 +3,32 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* One shared name fold, used by the resolver's commune reconciliation
|
|
7
|
-
* locality comparison. Its own module because
|
|
6
|
+
* One shared name fold, used by the resolver's commune reconciliation, by the street tier's
|
|
7
|
+
* locality comparison and by span-rescore's key guards. Its own module because those would
|
|
8
|
+
* otherwise import each other for it.
|
|
9
|
+
*
|
|
10
|
+
* `@mailwoman/codex`'s `foldName` (`packages/codex/normalize.ts`) is a near twin and is also
|
|
11
|
+
* correct; it differs in collapsing every non-alphanumeric RUN, whitespace included. The two are
|
|
12
|
+
* equivalent on the inputs either sees today. They are kept apart because this one answers to a
|
|
13
|
+
* comparison contract the resolver owns, not because the codex copy is wrong.
|
|
8
14
|
*/
|
|
9
15
|
/**
|
|
10
|
-
* Case/diacritic-insensitive fold for commune-name comparison (#1058)
|
|
16
|
+
* Case/diacritic-insensitive fold for commune-name comparison (#1058).
|
|
17
|
+
*
|
|
18
|
+
* Marks are DELETED, never spaced. `[^a-z0-9 ]` alone maps the combining cedilla that NFD has just produced to a SPACE,
|
|
19
|
+
* so `Besançon` keys as `besanc on` and matches nothing it should. The gazetteer side of the same comparison deletes
|
|
20
|
+
* them — 0 of 32,539 distinct `locality_base` keys in `street-centroids-fr.db` carry a mark — so spacing puts the two
|
|
21
|
+
* halves of one comparison on different keys. Order is load-bearing: after the class filter the strip is a no-op.
|
|
22
|
+
*
|
|
23
|
+
* Not fixed here, and worth knowing before trusting the fold on a non-Latin-1 name: a letter with no decomposition is
|
|
24
|
+
* DROPPED rather than folded (`Łódź` → `odz`, `Đà Nẵng` → `a nang`). That needs a transliteration table, not a regex,
|
|
25
|
+
* and it is shared with every other fold in the repo.
|
|
11
26
|
*/
|
|
12
27
|
export function foldName(s) {
|
|
13
28
|
return s
|
|
14
29
|
.toLowerCase()
|
|
15
30
|
.normalize("NFD")
|
|
31
|
+
.replaceAll(/\p{M}/gu, "")
|
|
16
32
|
.replaceAll(/[^a-z0-9 ]/g, " ")
|
|
17
33
|
.replaceAll(/\s+/g, " ")
|
|
18
34
|
.trim();
|
package/out/fold-name.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fold-name.js","sourceRoot":"","sources":["../fold-name.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fold-name.js","sourceRoot":"","sources":["../fold-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;SACzB,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;SAC9B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC;SACvB,IAAI,EAAE,CAAA;AACT,CAAC"}
|
package/out/index.d.ts
CHANGED
|
@@ -17,10 +17,13 @@ export { COUNTRY_BBOX, finestResolvedCoordinate, isImplausibleResolution, outsid
|
|
|
17
17
|
export type { PlausibilityOpts, PlausibilityVerdict, ResolvedCoordinate } from "./plausibility.ts";
|
|
18
18
|
export { foldStreetSurface, isPureTypeVocabulary, pickByStreetEvidence } from "./street-evidence.ts";
|
|
19
19
|
export type { PickByStreetEvidenceOpts, StreetCandidate, StreetEvidencePick, StreetEvidenceScope, StreetLocalityEvidence, } from "./street-evidence.ts";
|
|
20
|
-
export { findPostcodeCountryScope, firstLocalityValue, POSTCODE_COUNTRY_COHERENCE_GATE_KM, stampPostcodeCountryScope, } from "./postcode-country-coherence.ts";
|
|
20
|
+
export { findPostcodeCountryScope, firstLocalityValue, localityValuesInDocumentOrder, POSTCODE_COUNTRY_COHERENCE_GATE_KM, stampPostcodeCountryScope, } from "./postcode-country-coherence.ts";
|
|
21
21
|
export type { PostcodeCountryScope, PostcodeCountryScopeOpts } from "./postcode-country-coherence.ts";
|
|
22
22
|
export { findRescoreCandidate, hasResolvedPlace } from "./span-rescore.ts";
|
|
23
23
|
export type { RescoreCandidate, SpanRescoreOptions } from "./span-rescore.ts";
|
|
24
|
+
export { adminContainmentVerdict, partitionByContainment } from "./admin-containment.ts";
|
|
25
|
+
export { ADMIN_LADDER_LOCALITY_FIRST, ADMIN_LADDER_POSTCODE_FIRST, adminLadderFor, adminLadderForNodes, AREA_GRADE_POSTALCODE_SPECIFICITY, mostSpecificResolved, resolvedSpecificity, } from "./admin-winner.ts";
|
|
26
|
+
export type { ResolvedPostcodeHit, ResolvedSpecificityInput } from "./admin-winner.ts";
|
|
24
27
|
export * from "@mailwoman/core/resolver";
|
|
25
28
|
export * from "./rerank.ts";
|
|
26
29
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EACN,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAA;AAE1B,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAClG,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEpG,YAAY,EACX,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACtB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAClB,kCAAkC,EAClC,yBAAyB,GACzB,MAAM,iCAAiC,CAAA;AAExC,YAAY,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AACrG,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EACN,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAA;AAE1B,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAClG,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEpG,YAAY,EACX,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACtB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,kCAAkC,EAClC,yBAAyB,GACzB,MAAM,iCAAiC,CAAA;AAExC,YAAY,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AACrG,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAC1E,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC7E,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAExF,OAAO,EACN,2BAA2B,EAC3B,2BAA2B,EAC3B,cAAc,EACd,mBAAmB,EACnB,iCAAiC,EACjC,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,mBAAmB,CAAA;AAE1B,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAItF,cAAc,0BAA0B,CAAA;AAExC,cAAc,aAAa,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -14,8 +14,10 @@ export { RemoteResolver, serializableResolveOpts } from "./remote-resolver.js";
|
|
|
14
14
|
export { createWOFResolver } from "./resolve.js";
|
|
15
15
|
export { COUNTRY_BBOX, finestResolvedCoordinate, isImplausibleResolution, outsideExpectedCountry, } from "./plausibility.js";
|
|
16
16
|
export { foldStreetSurface, isPureTypeVocabulary, pickByStreetEvidence } from "./street-evidence.js";
|
|
17
|
-
export { findPostcodeCountryScope, firstLocalityValue, POSTCODE_COUNTRY_COHERENCE_GATE_KM, stampPostcodeCountryScope, } from "./postcode-country-coherence.js";
|
|
17
|
+
export { findPostcodeCountryScope, firstLocalityValue, localityValuesInDocumentOrder, POSTCODE_COUNTRY_COHERENCE_GATE_KM, stampPostcodeCountryScope, } from "./postcode-country-coherence.js";
|
|
18
18
|
export { findRescoreCandidate, hasResolvedPlace } from "./span-rescore.js";
|
|
19
|
+
export { adminContainmentVerdict, partitionByContainment } from "./admin-containment.js";
|
|
20
|
+
export { ADMIN_LADDER_LOCALITY_FIRST, ADMIN_LADDER_POSTCODE_FIRST, adminLadderFor, adminLadderForNodes, AREA_GRADE_POSTALCODE_SPECIFICITY, mostSpecificResolved, resolvedSpecificity, } from "./admin-winner.js";
|
|
19
21
|
// The type contract + placetype helpers live in core (pure types, keep core a leaf). Re-export so
|
|
20
22
|
// consumers get the whole surface from `@mailwoman/resolver`.
|
|
21
23
|
export * from "@mailwoman/core/resolver";
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAS9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EACN,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAUpG,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAClB,kCAAkC,EAClC,yBAAyB,GACzB,MAAM,iCAAiC,CAAA;AAGxC,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAS9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EACN,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAUpG,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,kCAAkC,EAClC,yBAAyB,GACzB,MAAM,iCAAiC,CAAA;AAGxC,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE1E,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAExF,OAAO,EACN,2BAA2B,EAC3B,2BAA2B,EAC3B,cAAc,EACd,mBAAmB,EACnB,iCAAiC,EACjC,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,mBAAmB,CAAA;AAI1B,kGAAkG;AAClG,8DAA8D;AAC9D,cAAc,0BAA0B,CAAA;AAExC,cAAc,aAAa,CAAA"}
|
|
@@ -76,8 +76,10 @@
|
|
|
76
76
|
* the whole gazetteer. See {@link PostcodeCountryScopeEvidence}.
|
|
77
77
|
*
|
|
78
78
|
* The abstention doctrine is unchanged and is what bounds the new rungs: a two-country tie is a HARD
|
|
79
|
-
* abstention that never falls through to the single-sided rungs
|
|
80
|
-
* address's own
|
|
79
|
+
* abstention that never falls through to the single-sided rungs. Corroboration at home bounds them
|
|
80
|
+
* asymmetrically: the address's own POSTCODE existing in the default country stops the pass dead,
|
|
81
|
+
* while a LOCALITY value at home neutralizes that value as a foreign witness without silencing its
|
|
82
|
+
* siblings (the per-value rule in the single-sided section below).
|
|
81
83
|
*
|
|
82
84
|
* ## Evidence
|
|
83
85
|
*
|
|
@@ -90,9 +92,9 @@
|
|
|
90
92
|
* below is the 25 km the scale run measured.
|
|
91
93
|
*
|
|
92
94
|
* Cost: 2 lookups on the byte-stable path (postcode + locality under the default country), and at
|
|
93
|
-
* most `2 × |candidateSystems|` — bounded at
|
|
94
|
-
* — when the default is incoherent. Nothing runs at all
|
|
95
|
-
* the tree carries both a postcode and a locality.
|
|
95
|
+
* most `2 × |candidateSystems| × |localityValues|` — candidates bounded at 12, locality values at 3,
|
|
96
|
+
* and the common tree carries exactly one — when the default is incoherent. Nothing runs at all
|
|
97
|
+
* unless the tree carries both a postcode and a locality.
|
|
96
98
|
*
|
|
97
99
|
* **Default-ON** since the operator promotion of 2026-08-05 (#1477) — the resolver gauntlet, pinned
|
|
98
100
|
* both ways, returned zero newly-failing gated cases, and 56,000 pair evaluations across both
|
|
@@ -162,10 +164,12 @@ export interface PostcodeCountryScopeOpts {
|
|
|
162
164
|
*/
|
|
163
165
|
postcode: string;
|
|
164
166
|
/**
|
|
165
|
-
* The country the caller's `defaultCountry` would hard-filter to
|
|
166
|
-
*
|
|
167
|
+
* The country the caller's `defaultCountry` would hard-filter to — or `undefined` when no default is in force (the
|
|
168
|
+
* browser cascade), where the pass CONSTRAINS instead of overriding: the default-coherence short-circuit is vacuous
|
|
169
|
+
* and the exactly-one-country abstention carries the safety alone. Historically required: this pass was built to
|
|
170
|
+
* correct a wrong one, so with no default there is nothing to correct and the caller should not be calling.
|
|
167
171
|
*/
|
|
168
|
-
defaultCountry: string;
|
|
172
|
+
defaultCountry: string | undefined;
|
|
169
173
|
/**
|
|
170
174
|
* Consistency gate radius in km. Defaults to {@link POSTCODE_COUNTRY_COHERENCE_GATE_KM}.
|
|
171
175
|
*/
|
|
@@ -183,8 +187,25 @@ export interface PostcodeCountryScopeOpts {
|
|
|
183
187
|
candidateSystems?: readonly string[];
|
|
184
188
|
}
|
|
185
189
|
/**
|
|
186
|
-
* The address's locality
|
|
187
|
-
* Two passes so a real locality always beats a dependent one regardless of tree
|
|
190
|
+
* The address's locality strings in DOCUMENT ORDER — every `locality` value first, then every `dependent_locality`,
|
|
191
|
+
* case-insensitively deduplicated. Two passes so a real locality always beats a dependent one regardless of tree
|
|
192
|
+
* order.
|
|
193
|
+
*
|
|
194
|
+
* Document order is load-bearing, not cosmetic. The original stack-pop traversal visited the LAST node first, so on `92
|
|
195
|
+
* Laurell Road, Gander, NL A1V 0A9` — where the model tags both `Gander` and the province abbreviation `NL` as
|
|
196
|
+
* localities — the pass keyed its whole country verdict on "NL", whose only exact locality-band bearer is an alias of
|
|
197
|
+
* Nal, Afghanistan, and the walk resolved a Newfoundland street 10,000 km away. The FIRST-written locality is the one
|
|
198
|
+
* the address is about.
|
|
199
|
+
*
|
|
200
|
+
* ALL values matter, not just the first. On `Calle Mayor 12, Aravaca, 28023 Madrid` the model tags both `Aravaca` and
|
|
201
|
+
* `Madrid` as localities; `Aravaca` is a neighbourhood the locality band cannot see, while `Madrid` carries the ES pair
|
|
202
|
+
* verdict (the ES 28023 row sits 9.6 km from the Madrid locality row). A pass keyed on a single value bets the whole
|
|
203
|
+
* country verdict on whichever one a traversal order happens to pick — first-only re-scoped that address to the US ZIP
|
|
204
|
+
* 28023 centroid in North Carolina. So the verdict rungs try each value in order until one produces evidence.
|
|
205
|
+
*/
|
|
206
|
+
export declare function localityValuesInDocumentOrder(roots: readonly AddressNode[]): string[];
|
|
207
|
+
/**
|
|
208
|
+
* The first of {@link localityValuesInDocumentOrder} — the locality the address is about.
|
|
188
209
|
*/
|
|
189
210
|
export declare function firstLocalityValue(roots: readonly AddressNode[]): string | undefined;
|
|
190
211
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-country-coherence.d.ts","sourceRoot":"","sources":["../postcode-country-coherence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"postcode-country-coherence.d.ts","sourceRoot":"","sources":["../postcode-country-coherence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuGG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAG9E;;;GAGG;AACH,eAAO,MAAM,kCAAkC,KAAK,CAAA;AAEpD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAA;AAE3E;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,EAAE,4BAA4B,CAAA;IACtC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,cAAc,EAAE,MAAM,GAAG,SAAS,CAAA;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CACpC;AAeD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,EAAE,CASrF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,GAAG,SAAS,CAEpF;AA0ID;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC7C,KAAK,EAAE,SAAS,WAAW,EAAE,EAC7B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,wBAAwB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CA2JtC;AAmBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,EAAE,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAqB1G"}
|
|
@@ -76,8 +76,10 @@
|
|
|
76
76
|
* the whole gazetteer. See {@link PostcodeCountryScopeEvidence}.
|
|
77
77
|
*
|
|
78
78
|
* The abstention doctrine is unchanged and is what bounds the new rungs: a two-country tie is a HARD
|
|
79
|
-
* abstention that never falls through to the single-sided rungs
|
|
80
|
-
* address's own
|
|
79
|
+
* abstention that never falls through to the single-sided rungs. Corroboration at home bounds them
|
|
80
|
+
* asymmetrically: the address's own POSTCODE existing in the default country stops the pass dead,
|
|
81
|
+
* while a LOCALITY value at home neutralizes that value as a foreign witness without silencing its
|
|
82
|
+
* siblings (the per-value rule in the single-sided section below).
|
|
81
83
|
*
|
|
82
84
|
* ## Evidence
|
|
83
85
|
*
|
|
@@ -90,9 +92,9 @@
|
|
|
90
92
|
* below is the 25 km the scale run measured.
|
|
91
93
|
*
|
|
92
94
|
* Cost: 2 lookups on the byte-stable path (postcode + locality under the default country), and at
|
|
93
|
-
* most `2 × |candidateSystems|` — bounded at
|
|
94
|
-
* — when the default is incoherent. Nothing runs at all
|
|
95
|
-
* the tree carries both a postcode and a locality.
|
|
95
|
+
* most `2 × |candidateSystems| × |localityValues|` — candidates bounded at 12, locality values at 3,
|
|
96
|
+
* and the common tree carries exactly one — when the default is incoherent. Nothing runs at all
|
|
97
|
+
* unless the tree carries both a postcode and a locality.
|
|
96
98
|
*
|
|
97
99
|
* **Default-ON** since the operator promotion of 2026-08-05 (#1477) — the resolver gauntlet, pinned
|
|
98
100
|
* both ways, returned zero newly-failing gated cases, and 56,000 pair evaluations across both
|
|
@@ -116,20 +118,53 @@ function hasCoord(p) {
|
|
|
116
118
|
return p.lat !== 0 || p.lon !== 0;
|
|
117
119
|
}
|
|
118
120
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
+
* Upper bound on locality values the pass will consider. A parse rarely tags more than two; the cap keeps a
|
|
122
|
+
* pathological tree from multiplying the pair sweep.
|
|
121
123
|
*/
|
|
122
|
-
|
|
124
|
+
const MAX_LOCALITY_VALUES = 3;
|
|
125
|
+
/**
|
|
126
|
+
* The address's locality strings in DOCUMENT ORDER — every `locality` value first, then every `dependent_locality`,
|
|
127
|
+
* case-insensitively deduplicated. Two passes so a real locality always beats a dependent one regardless of tree
|
|
128
|
+
* order.
|
|
129
|
+
*
|
|
130
|
+
* Document order is load-bearing, not cosmetic. The original stack-pop traversal visited the LAST node first, so on `92
|
|
131
|
+
* Laurell Road, Gander, NL A1V 0A9` — where the model tags both `Gander` and the province abbreviation `NL` as
|
|
132
|
+
* localities — the pass keyed its whole country verdict on "NL", whose only exact locality-band bearer is an alias of
|
|
133
|
+
* Nal, Afghanistan, and the walk resolved a Newfoundland street 10,000 km away. The FIRST-written locality is the one
|
|
134
|
+
* the address is about.
|
|
135
|
+
*
|
|
136
|
+
* ALL values matter, not just the first. On `Calle Mayor 12, Aravaca, 28023 Madrid` the model tags both `Aravaca` and
|
|
137
|
+
* `Madrid` as localities; `Aravaca` is a neighbourhood the locality band cannot see, while `Madrid` carries the ES pair
|
|
138
|
+
* verdict (the ES 28023 row sits 9.6 km from the Madrid locality row). A pass keyed on a single value bets the whole
|
|
139
|
+
* country verdict on whichever one a traversal order happens to pick — first-only re-scoped that address to the US ZIP
|
|
140
|
+
* 28023 centroid in North Carolina. So the verdict rungs try each value in order until one produces evidence.
|
|
141
|
+
*/
|
|
142
|
+
export function localityValuesInDocumentOrder(roots) {
|
|
143
|
+
const out = [];
|
|
144
|
+
const seen = new Set();
|
|
123
145
|
for (const tag of ["locality", "dependent_locality"]) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
146
|
+
collectInDocumentOrder(roots, tag, out, seen);
|
|
147
|
+
}
|
|
148
|
+
return out.slice(0, MAX_LOCALITY_VALUES);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The first of {@link localityValuesInDocumentOrder} — the locality the address is about.
|
|
152
|
+
*/
|
|
153
|
+
export function firstLocalityValue(roots) {
|
|
154
|
+
return localityValuesInDocumentOrder(roots)[0];
|
|
155
|
+
}
|
|
156
|
+
function collectInDocumentOrder(nodes, tag, out, seen) {
|
|
157
|
+
for (const n of nodes) {
|
|
158
|
+
if (n.tag === tag && n.value.trim().length) {
|
|
159
|
+
const value = n.value.trim();
|
|
160
|
+
const key = value.toLowerCase();
|
|
161
|
+
if (!seen.has(key)) {
|
|
162
|
+
seen.add(key);
|
|
163
|
+
out.push(value);
|
|
164
|
+
}
|
|
130
165
|
}
|
|
166
|
+
collectInDocumentOrder(n.children, tag, out, seen);
|
|
131
167
|
}
|
|
132
|
-
return undefined;
|
|
133
168
|
}
|
|
134
169
|
/**
|
|
135
170
|
* Over-fetch for the UNSCOPED holder probes (#24). Postcodes are bounded and small — the 2026-08-10 candidate
|
|
@@ -162,11 +197,11 @@ const MAX_CANDIDATE_COUNTRIES = 12;
|
|
|
162
197
|
* lesson — `BT3 9QQ` trigram-matching Sheffield's `S3 9QQ`), and a fuzzy locality hit is evidence about the index, not
|
|
163
198
|
* about the country. Backends that do not stamp the flag leave it undefined and still contribute.
|
|
164
199
|
*/
|
|
165
|
-
async function countriesHolding(backend, text, placetype, limit) {
|
|
200
|
+
async function countriesHolding(backend, text, placetype, limit, opts) {
|
|
166
201
|
const out = new Map();
|
|
167
202
|
let hits;
|
|
168
203
|
try {
|
|
169
|
-
hits = await backend.findPlace({ text, placetype, limit });
|
|
204
|
+
hits = await backend.findPlace({ text, placetype, limit, ...(opts?.primaryOnly ? { primaryOnly: true } : {}) });
|
|
170
205
|
}
|
|
171
206
|
catch {
|
|
172
207
|
return out; // a backend hiccup degrades to "no evidence", never to a crashed resolve
|
|
@@ -240,20 +275,26 @@ async function coherenceIn(country, postcode, locality, backend, gateKm, knownPo
|
|
|
240
275
|
*/
|
|
241
276
|
export async function findPostcodeCountryScope(roots, backend, opts) {
|
|
242
277
|
const postcode = opts.postcode.trim();
|
|
243
|
-
const defaultCountry = opts.defaultCountry
|
|
244
|
-
if (!postcode
|
|
278
|
+
const defaultCountry = opts.defaultCountry?.trim().toUpperCase() || undefined;
|
|
279
|
+
if (!postcode)
|
|
245
280
|
return null;
|
|
246
|
-
const
|
|
281
|
+
const localities = localityValuesInDocumentOrder(roots);
|
|
247
282
|
// Both halves of the pair are required. A postcode with no locality has nothing to be coherent WITH, which is what
|
|
248
283
|
// keeps this pass inert on "Springfield, IL 62701" (the parser tags Springfield as a `street` — a separate defect)
|
|
249
284
|
// and on every bare-postcode query.
|
|
250
|
-
if (!
|
|
285
|
+
if (!localities.length)
|
|
251
286
|
return null;
|
|
252
287
|
const gateKm = opts.gateKm ?? POSTCODE_COUNTRY_COHERENCE_GATE_KM;
|
|
253
|
-
// 1. Is the caller's own default country coherent? If so we are done —
|
|
254
|
-
// no override, and the common domestic path
|
|
255
|
-
|
|
256
|
-
|
|
288
|
+
// 1. Is the caller's own default country coherent with ANY of the address's locality values? If so we are done —
|
|
289
|
+
// positive evidence for the default, no override, and the common domestic path (one locality value) costs two
|
|
290
|
+
// lookups and changes nothing. With no default in force (the browser cascade) there is nothing to test — the
|
|
291
|
+
// sweep below carries the whole verdict.
|
|
292
|
+
if (defaultCountry) {
|
|
293
|
+
for (const locality of localities) {
|
|
294
|
+
if (await coherenceIn(defaultCountry, postcode, locality, backend, gateKm))
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
257
298
|
// 2. The default could not place this pair. Which countries could? Two sources, unioned:
|
|
258
299
|
//
|
|
259
300
|
// - the SHAPE list (`candidateSystemsForPostcode`, or the shape-coherence pass's narrowing when #31
|
|
@@ -271,19 +312,30 @@ export async function findPostcodeCountryScope(roots, backend, opts) {
|
|
|
271
312
|
const candidates = [...new Set([...shapeSystems, ...pcHolders.keys()])]
|
|
272
313
|
.filter((country) => country !== defaultCountry)
|
|
273
314
|
.slice(0, MAX_CANDIDATE_COUNTRIES);
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
315
|
+
// 3. The pair sweep, per locality value in document order: the first value that produces evidence decides. A value
|
|
316
|
+
// the band cannot see (`Aravaca`, a neighbourhood) yields zero coherent countries and the NEXT value gets its
|
|
317
|
+
// turn — betting the verdict on a single value re-scoped that address to a US ZIP centroid (see
|
|
318
|
+
// localityValuesInDocumentOrder). Exactly one coherent country is a verdict. Two coherent countries mean the
|
|
319
|
+
// geometry genuinely does not decide, and guessing between them is precisely what this mechanism exists not to
|
|
320
|
+
// do — a TIE is a hard abstention, never a fall-through to a later value or the weaker rungs below.
|
|
321
|
+
for (const locality of localities) {
|
|
322
|
+
const coherent = [];
|
|
323
|
+
for (const country of candidates) {
|
|
324
|
+
const hit = await coherenceIn(country, postcode, locality, backend, gateKm, pcHolders.get(country));
|
|
325
|
+
if (hit) {
|
|
326
|
+
coherent.push({ country, postcode, locality, evidence: "pair", ...hit });
|
|
327
|
+
}
|
|
279
328
|
}
|
|
329
|
+
if (coherent.length === 1)
|
|
330
|
+
return coherent[0];
|
|
331
|
+
if (coherent.length > 1)
|
|
332
|
+
return null;
|
|
280
333
|
}
|
|
281
|
-
//
|
|
282
|
-
//
|
|
283
|
-
//
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (coherent.length > 1)
|
|
334
|
+
// The single-sided rungs below lean on the DEFAULT country as the domestic-plausibility guard
|
|
335
|
+
// ("Vienna, VA" stays in Virginia because the default corroborates a half). With no default there
|
|
336
|
+
// is no such anchor, so the no-default path ends at the pair rung: a pair verdict (Zabiče) is
|
|
337
|
+
// in-scope, a single-sided guess is not.
|
|
338
|
+
if (!defaultCountry)
|
|
287
339
|
return null;
|
|
288
340
|
// 4. No country makes the PAIR consistent. On the 2026-08-09 panel that happened 10 times for two opposite
|
|
289
341
|
// reasons, and in both the address's country was never in doubt — only unrepresentable as a pair:
|
|
@@ -292,36 +344,65 @@ export async function findPostcodeCountryScope(roots, backend, opts) {
|
|
|
292
344
|
// agree with anything no matter how good the locality evidence is; or
|
|
293
345
|
// - the locality is a name no admin gazetteer carries (`Praha 3`, `Praha 9` — municipal districts).
|
|
294
346
|
//
|
|
295
|
-
// So each half gets to speak alone, under
|
|
296
|
-
//
|
|
297
|
-
//
|
|
298
|
-
//
|
|
299
|
-
//
|
|
300
|
-
//
|
|
347
|
+
// So each half gets to speak alone, under conditions that keep this from becoming a guess. The
|
|
348
|
+
// POSTCODE half is all-or-nothing: the default country holding this postcode makes the address
|
|
349
|
+
// domestically plausible outright, and nothing foreign may be proposed. The LOCALITY half is
|
|
350
|
+
// judged PER VALUE — a value the default country holds is domestic corroboration for THAT value
|
|
351
|
+
// (it is neutralized as a foreign witness) without silencing its siblings. `14 Long St, Green
|
|
352
|
+
// Point, Cape Town, 8001` is why: "Green Point" has pop-0 US namesakes, and letting that one
|
|
353
|
+
// value abstain the whole pass handed a uniquely-ZA "Cape Town" to a hard US filter (the walk
|
|
354
|
+
// answered Green Point, Pennsylvania). `123 Main St, Vienna, VA 22180` still holds in Virginia:
|
|
355
|
+
// its ONLY locality value is domestic, so no foreign witness remains. The speaking value must
|
|
356
|
+
// name EXACTLY ONE country in the entire gazetteer — the same uniqueness bar the pair rung uses,
|
|
357
|
+
// applied to one side — and all speaking values must AGREE on that country.
|
|
301
358
|
if (pcHolders.has(defaultCountry))
|
|
302
359
|
return null;
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
//
|
|
306
|
-
//
|
|
307
|
-
//
|
|
308
|
-
//
|
|
309
|
-
|
|
310
|
-
|
|
360
|
+
// 4a. A locality value names exactly one country. Stronger than the postcode rung — a place name is far
|
|
361
|
+
// more discriminative than a four-digit code — so it is tried first. A verdict stands down when that
|
|
362
|
+
// country's OWN postcode row contradicts the locality (outside the gate): the two halves disagreeing
|
|
363
|
+
// inside one country is exactly what the pair test exists to catch, and a single-sided rung must not
|
|
364
|
+
// launder it.
|
|
365
|
+
// PRIMARY-keyed rows only (#1626's re-reading discipline, applied to a country verdict): "the locality
|
|
366
|
+
// names exactly one country" must mean a place NAMED that, never a place aliased to it — "NL"'s only
|
|
367
|
+
// locality-band bearer was an exact ALIAS of Nal, Afghanistan, and a single alias row steered the whole
|
|
368
|
+
// walk's country. The pair rung keeps aliases: there the postcode's own geometry corroborates them.
|
|
369
|
+
let anyDomestic = false;
|
|
370
|
+
let anyLocalityKnown = false;
|
|
371
|
+
const verdicts = new Map();
|
|
372
|
+
for (const locality of localities) {
|
|
373
|
+
if (await holdsLocality(backend, locality, defaultCountry)) {
|
|
374
|
+
anyDomestic = true;
|
|
375
|
+
continue;
|
|
376
|
+
}
|
|
377
|
+
const locHolders = await countriesHolding(backend, locality, "locality", LOCALITY_HOLDER_FETCH, {
|
|
378
|
+
primaryOnly: true,
|
|
379
|
+
});
|
|
380
|
+
if (locHolders.size) {
|
|
381
|
+
anyLocalityKnown = true;
|
|
382
|
+
}
|
|
383
|
+
if (locHolders.size !== 1)
|
|
384
|
+
continue;
|
|
311
385
|
const [country, localityPlace] = [...locHolders.entries()][0];
|
|
312
386
|
const ownPostcode = pcHolders.get(country);
|
|
313
387
|
const contradicted = ownPostcode !== undefined &&
|
|
314
388
|
haversineKm(ownPostcode.lat, ownPostcode.lon, localityPlace.lat, localityPlace.lon) > gateKm;
|
|
315
|
-
if (country !== defaultCountry && !contradicted) {
|
|
316
|
-
|
|
389
|
+
if (country !== defaultCountry && !contradicted && !verdicts.has(country)) {
|
|
390
|
+
verdicts.set(country, { country, postcode, locality, evidence: "locality", localityPlace });
|
|
317
391
|
}
|
|
318
392
|
}
|
|
319
|
-
//
|
|
320
|
-
//
|
|
321
|
-
if (
|
|
393
|
+
// Every speaking value must agree: two values uniquely naming DIFFERENT countries is a genuine
|
|
394
|
+
// ambiguity, and guessing between them is what this mechanism exists not to do.
|
|
395
|
+
if (verdicts.size === 1)
|
|
396
|
+
return [...verdicts.values()][0];
|
|
397
|
+
if (verdicts.size > 1)
|
|
398
|
+
return null;
|
|
399
|
+
// 4b. The postcode is held in exactly one country and the locality half is silent EVERYWHERE — no value
|
|
400
|
+
// is domestic and no value names any country. `Biskupcova 1843/3, 13000 Praha 3`: `13000` is a CZ
|
|
401
|
+
// code and nothing else, anywhere, and `Praha 3` (a municipal district) is in no admin gazetteer.
|
|
402
|
+
if (!anyDomestic && !anyLocalityKnown && pcHolders.size === 1) {
|
|
322
403
|
const [country, postcodePlace] = [...pcHolders.entries()][0];
|
|
323
404
|
if (country !== defaultCountry) {
|
|
324
|
-
return { country, postcode, locality, evidence: "postcode", postcodePlace };
|
|
405
|
+
return { country, postcode, locality: localities[0], evidence: "postcode", postcodePlace };
|
|
325
406
|
}
|
|
326
407
|
}
|
|
327
408
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-country-coherence.js","sourceRoot":"","sources":["../postcode-country-coherence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"postcode-country-coherence.js","sourceRoot":"","sources":["../postcode-country-coherence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuGG;AAEH,+FAA+F;AAC/F,iDAAiD;AACjD,OAAO,EAAE,2BAA2B,EAAE,M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AAQ;QAE5F,CAAC,CAAC,QAAQ,GAAG;YACZ,GAAG,CAAC,CAAC,QAAQ;YACb,sBAAsB,EAAE,KAAK,CAAC,OAAO;YACrC,oGAAoG;YACpG,6EAA6E;YAC7E,+BAA+B,EAAE,KAAK,CAAC,QAAQ;YAC/C,mGAAmG;YACnG,2BAA2B;YAC3B,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,yBAAyB,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC1F,CAAA;IACF,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-prefix.d.ts","sourceRoot":"","sources":["../postcode-prefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE1G;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAazG;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"postcode-prefix.d.ts","sourceRoot":"","sources":["../postcode-prefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE1G;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAazG;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkBlF;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAA;CACxB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,uBAAuB,EAC9B,YAAY,CAAC,EAAE,MAAM,GACnB,yBAAyB,GAAG,IAAI,CAclC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAC1C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,kBAAkB,EACxB,KAAK,EAAE,uBAAuB,GAC5B,uBAAuB,CAYzB"}
|
package/out/postcode-prefix.js
CHANGED
|
@@ -77,8 +77,9 @@ export function derivePostcodePrefix(code, country) {
|
|
|
77
77
|
// "BT93GS" → "BT9"). Exactly 3 — never a greedy regex, the build-side twin is `outwardOf`.
|
|
78
78
|
case "GB":
|
|
79
79
|
return compact.length >= MIN_GB_OUTWARD_CODE_LENGTH ? compact.slice(0, -3) : null;
|
|
80
|
-
// The 3-digit
|
|
81
|
-
//
|
|
80
|
+
// The 3-digit sectional centre ("94043" → "940"). Deliberately looser than the build side, which
|
|
81
|
+
// requires a real ZIP shape: a probe for something that is not a code simply misses, and a reader
|
|
82
|
+
// that re-derived the writer's validation would be a second copy of it.
|
|
82
83
|
case "US":
|
|
83
84
|
return compact.length >= MIN_US_SECTION_CODE_LENGTH ? compact.slice(0, 3) : null;
|
|
84
85
|
default:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-prefix.js","sourceRoot":"","sources":["../postcode-prefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAaH;;;GAGG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAEpC;;GAEG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAEpC;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,OAAgB;IAClE,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAElC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAE3C,QAAQ,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;QAC/B,0FAA0F;QAC1F,2FAA2F;QAC3F,KAAK,IAAI;YACR,OAAO,OAAO,CAAC,MAAM,IAAI,0BAA0B,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QAClF,
|
|
1
|
+
{"version":3,"file":"postcode-prefix.js","sourceRoot":"","sources":["../postcode-prefix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAaH;;;GAGG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAEpC;;GAEG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAEpC;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,OAAgB;IAClE,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAElC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IAE3C,QAAQ,OAAO,CA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wC;QACxC,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE;QAC3C,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7F,KAAK,EAAE,CAAC;QACR,UAAU,EAAE,KAAK;KACjB,CAAA;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcode-shape-coherence.js","sourceRoot":"","sources":["../postcode-shape-coherence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH,OAAO,EAAE,2BAA2B,
|
|
1
|
+
{"version":3,"file":"postcode-shape-coherence.js","sourceRoot":"","sources":["../postcode-shape-coherence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAG3D;;;;;GAKG;AACH,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAS,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AA2B9G;;;;GAIG;AACH,SAAS,qBAAqB,CAAC,KAA6B;IAC3D,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAA;IAC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,IAAI,CAAC,QAAQ,EAAE,CAAC,yBAAyB,CAAC,KAAK,IAAI,CAAA;AACtF,CAAC"}
|
package/out/resolve.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
import { type Resolver, type ResolverBackend } from "@mailwoman/core/resolver";
|
|
15
15
|
/**
|
|
16
16
|
* Build a `Resolver` backed by a `ResolverBackend`. The backend can be any concrete impl structurally compatible with
|
|
17
|
-
* `PlaceLookup` — e.g. `new
|
|
17
|
+
* `PlaceLookup` — e.g. `new WOFSQLitePlaceLookup({ databasePath }).asResolverBackend()` or a fake for tests.
|
|
18
18
|
*/
|
|
19
19
|
export declare function createWOFResolver(backend: ResolverBackend): Resolver;
|
|
20
20
|
//# sourceMappingURL=resolve.d.ts.map
|
package/out/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAaN,KAAK,QAAQ,EACb,KAAK,eAAe,EAEpB,MAAM,0BAA0B,CAAA;AA+BjC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,QAAQ,CAEpE"}
|