@mailwoman/resolver 9.0.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 +91 -14
- package/out/postcode-country-coherence.d.ts.map +1 -1
- package/out/postcode-country-coherence.js +279 -42
- package/out/postcode-country-coherence.js.map +1 -1
- package/out/postcode-prefix.d.ts +101 -0
- package/out/postcode-prefix.d.ts.map +1 -0
- package/out/postcode-prefix.js +125 -0
- package/out/postcode-prefix.js.map +1 -0
- package/out/postcode-shape-coherence.d.ts +113 -0
- package/out/postcode-shape-coherence.d.ts.map +1 -0
- package/out/postcode-shape-coherence.js +193 -0
- package/out/postcode-shape-coherence.js.map +1 -0
- package/out/resolve.d.ts +1 -1
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +592 -410
- package/out/resolve.js.map +1 -1
- package/out/span-rescore.d.ts +28 -0
- package/out/span-rescore.d.ts.map +1 -1
- package/out/span-rescore.js +151 -17
- 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 +28 -5
- package/out/street-tier.js.map +1 -1
- package/out/toponym-prior.d.ts +139 -0
- package/out/toponym-prior.d.ts.map +1 -0
- package/out/toponym-prior.js +308 -0
- package/out/toponym-prior.js.map +1 -0
- package/package.json +98 -7
- package/postcode-country-coherence.ts +355 -50
- package/postcode-prefix.ts +166 -0
- package/postcode-shape-coherence.ts +248 -0
- package/resolve.ts +809 -527
- package/span-rescore.ts +206 -19
- package/street-evidence.ts +1 -1
- package/street-tier.ts +31 -5
- package/toponym-prior.ts +367 -0
package/out/street-tier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"street-tier.js","sourceRoot":"","sources":["../street-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAG9D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC;;GAEG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,eAAe,EAAE,wBAAwB,EAAE,eAAe,CAAC,C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AI,CAAC,CAAC,QAAQ,EAAE,CAAC,cAAc,CAAC,KAAK,IAAI;wBAAE,SAAQ;oBAC3E,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,EAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,eAAe,CAAwB,IAAI,EAAE,CAAC,CAAA;oBAEpF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC;wBACxE,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;oBACnB,CAAC;gBACF,CAAC;YACF,CAAC;YAED,OAAM;QACP,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* #17 bare city-name disambiguation — two SOFT ranking keys for the bare-toponym class.
|
|
7
|
+
*
|
|
8
|
+
* A bare city name is the one query shape where the resolver has no geography to reason with: no
|
|
9
|
+
* postcode to anchor against, no region to scope by, no country the address itself named. All that
|
|
10
|
+
* is left is a prior over which same-named place a person typing that word alone probably meant.
|
|
11
|
+
* The shipped prior is POPULATION, and population is measurably the wrong prior for this class —
|
|
12
|
+
* the panel run of 2026-08-10 caught it four times over:
|
|
13
|
+
*
|
|
14
|
+
* | query | population winner | gold | miss |
|
|
15
|
+
* | ------- | -------------------- | --------------------- | -------- |
|
|
16
|
+
* | Whitby | Whitby ON (128,377) | Whitby, N Yorks (13,130) | 5,508 km |
|
|
17
|
+
* | Warwick | Warwick RI (82,999) | Warwick, Warks (32,719) | 5,211 km |
|
|
18
|
+
* | Epping | Epping VIC (32,395) | Epping, Essex (12,547) | 16,874 km |
|
|
19
|
+
* | Windsor | Windsor ON (217,188) | Windsor, Berks (26,885) | 6,007 km |
|
|
20
|
+
*
|
|
21
|
+
* Every one of those is a place people know for something other than its size, and the gazetteer
|
|
22
|
+
* already measures that: `admin-global-priority-importance.db` ranks all four the RIGHT way round
|
|
23
|
+
* (Whitby GB 0.5496 over CA 0.5089; Windsor GB 0.5648 over CA 0.5607 — a 0.004 margin population
|
|
24
|
+
* inverts by a factor of eight). What it measures is a BLENDED global toponym prior
|
|
25
|
+
* (`ResolvedPlace.importance`): the concordance's encyclopedia-derived channel where a concordance
|
|
26
|
+
* matched, a population-derived proxy everywhere else — the one scale on which every bearer of a
|
|
27
|
+
* name is scored comparably, which is the precondition for comparing them at all.
|
|
28
|
+
* {@link rankByImportance} consumes it. (The STRICT encyclopedia-evidence channel keeps its own
|
|
29
|
+
* reserved slot, `ResolvedPlace.encyclopedic`, which no ranking key reads and no shipped artifact
|
|
30
|
+
* yet populates — see `core/resolver/types.ts`.)
|
|
31
|
+
*
|
|
32
|
+
* {@link rankByCountryPrior} covers the other half of the class — the query where a country IS
|
|
33
|
+
* known, but only because a locale said so. See `span-rescore.ts` for where that one applies.
|
|
34
|
+
*
|
|
35
|
+
* Both obey the same three house rules, and neither is a gate:
|
|
36
|
+
*
|
|
37
|
+
* 1. **Tier-safe.** `exactMatch` stays the primary key. A soft prior re-orders WITHIN a tier; it never
|
|
38
|
+
* promotes a partial match over an exact one.
|
|
39
|
+
* 2. **Positive evidence only.** An absent score is unmeasured, not zero (the meaning-of-zero rule), so an
|
|
40
|
+
* unscored candidate is never moved BY the signal and never penalized FOR lacking it — it keeps the
|
|
41
|
+
* rank population gave it while the scored rows reorder among themselves. On a candidate.db built
|
|
42
|
+
* before the #28 `importance` column, nothing is scored, so {@link rankByImportance} is
|
|
43
|
+
* byte-stable by construction.
|
|
44
|
+
* 3. **Stable.** Equal keys keep their incoming order, so the backend's own ranking survives underneath. That order
|
|
45
|
+
* carries decisions only the backend can make — the candidate backend's seat tiebreak
|
|
46
|
+
* (`resolver-wof-sqlite/primary-preference.ts`) reaches an end-to-end answer solely through this stability
|
|
47
|
+
* (#1729), so equal-key stability here is load-bearing, not cosmetic.
|
|
48
|
+
*/
|
|
49
|
+
import type { ResolvedPlace } from "@mailwoman/core/resolver";
|
|
50
|
+
/**
|
|
51
|
+
* Weight of the locale-country bonus, in the same log10-population units the candidate backend's `prominence` uses
|
|
52
|
+
* (`-neg_rank` = log10(population + 1)). 2 == "the in-country place may be up to 100x smaller and still win".
|
|
53
|
+
*
|
|
54
|
+
* The value is the resolver's existing `anchorWeight` default (`resolve.ts`), reused deliberately: that knob is the
|
|
55
|
+
* postcode-anchor country pin, and this is the same quantity from a weaker source, so the two should not disagree about
|
|
56
|
+
* what a country signal is worth. Calibrated against the live board (2026-08-10, shipped `candidate.db`), it moves
|
|
57
|
+
* exactly the queries where the locale is implausible and leaves the rest alone:
|
|
58
|
+
*
|
|
59
|
+
* - `Zürich` en-US — Zurich KS 1.91 + 2 = 3.91 loses to Zürich CH 5.65. **Flips** (was 8,043 km off).
|
|
60
|
+
* - `Berlin` en-US — Berlin CT 4.30 + 2 = 6.30 loses to Berlin DE 6.56. **Flips.**
|
|
61
|
+
* - `Manchester` en-US — Manchester NH 5.06 + 2 = 7.06 beats Manchester GB 5.74. **Held.**
|
|
62
|
+
* - `Springfield` en-US — every bearer is US, so the bonus is uniform. **Held.**
|
|
63
|
+
* - `Moscow` en-US — Moscow ID 4.42 + 2 = 6.42 beats Москва 6.10. **Held.**
|
|
64
|
+
* - `Fulda` en-US — Fulda MN 3.13 + 2 = 5.13 beats Fulda DE 4.84. **Held.**
|
|
65
|
+
*/
|
|
66
|
+
export declare const DEFAULT_COUNTRY_PRIOR_WEIGHT = 2;
|
|
67
|
+
/**
|
|
68
|
+
* The fields a ranking key reads. Structural rather than `ResolvedPlace` so the backend's own `PlaceCandidate` (a
|
|
69
|
+
* structural twin) can be ranked without a cast.
|
|
70
|
+
*/
|
|
71
|
+
type Rankable = Pick<ResolvedPlace, "score"> & Partial<Pick<ResolvedPlace, "country" | "exactMatch" | "importance" | "prominence">>;
|
|
72
|
+
/**
|
|
73
|
+
* Importance-first ordering — the #28 fame prior, consumed.
|
|
74
|
+
*
|
|
75
|
+
* Ranks by `importance` DESC within the exact tier, with `prominence`/`score` as the tiebreak (two places of equal fame
|
|
76
|
+
* separate on size). Candidates the gazetteer never scored do not participate — they hold the rank population gave them
|
|
77
|
+
* while the scored rows permute among their own slots (see {@link reorderMeasured}). Returns the input untouched when
|
|
78
|
+
* fewer than two candidates are scored.
|
|
79
|
+
*
|
|
80
|
+
* The producer is the candidate build's `importance` column (#28) — the BLENDED prior (the concordance's
|
|
81
|
+
* encyclopedia-derived channel clamped around a population-derived base — `place-importance-schema.ts`'s
|
|
82
|
+
* `blendImportance`; see `candidate-schema.ts` → `CandidateTable.importance` for why the strict channel is deliberately
|
|
83
|
+
* NOT what lands there). On an artifact predating the column, `importance` is `undefined` on every candidate the
|
|
84
|
+
* backend produces and the abstention below keeps the ranking byte-stable.
|
|
85
|
+
*
|
|
86
|
+
* Flip decisions, ratified 2026-08-11: bare `Moscow`→Москва, `Manchester`→GB, `Fulda`→DE, `Cambridge`→GB are ACCEPTED
|
|
87
|
+
* behavior — all cross-country contests, where this prior answers the question population cannot. Bare `Springfield`
|
|
88
|
+
* ABSTAINS to the referential answer via {@link SAME_COUNTRY_IMPORTANCE_TIE_BAND}; no candidate is dropped, so the
|
|
89
|
+
* runner-up survives as a declared alternative downstream.
|
|
90
|
+
*/
|
|
91
|
+
export declare function rankByImportance<T extends Rankable>(candidates: readonly T[]): T[];
|
|
92
|
+
/**
|
|
93
|
+
* Soft locale-country prior: `(prominence ?? score) + weight` for a candidate in `country`.
|
|
94
|
+
*
|
|
95
|
+
* Additive, never a filter — a far more prominent foreign namesake still wins (Zürich CH over Zurich KS) while a close
|
|
96
|
+
* contest goes to the locale (Manchester NH over Manchester GB). No-op without a `country`, so the un-scoped path stays
|
|
97
|
+
* byte-identical.
|
|
98
|
+
*
|
|
99
|
+
* The units matter: `prominence` on the candidate backend is log10(population + 1), so `weight` is read as "orders of
|
|
100
|
+
* magnitude of population the in-country place is allowed to give away". Pass a large weight to make the country
|
|
101
|
+
* effectively hard, `0` to disable.
|
|
102
|
+
*/
|
|
103
|
+
export declare function rankByCountryPrior<T extends Rankable>(candidates: readonly T[], country: string | undefined, weight?: number): T[];
|
|
104
|
+
/**
|
|
105
|
+
* Capital status of a resolved candidate, answered by the caller's reference (#1880 —
|
|
106
|
+
* `@mailwoman/resolver-wof-sqlite/capitals` is the shipped implementation): 2 for a national capital, 1 for an admin-1
|
|
107
|
+
* seat, 0 for neither. The resolver stays backend-agnostic — it never loads the reference, it only consumes the
|
|
108
|
+
* verdict.
|
|
109
|
+
*/
|
|
110
|
+
export type CapitalLevelFn = (place: Pick<ResolvedPlace, "name" | "country" | "lat" | "lon">) => number;
|
|
111
|
+
/**
|
|
112
|
+
* Margin a national capital may give away, in log10-population units: a namesake must be more than 10^2 = 100x more
|
|
113
|
+
* populous to hold the lead. Bare "San José" reaches the Costa Rican capital (342,188) over San Jose, California
|
|
114
|
+
* (969,655 — 2.8x); bare "Hamilton" stays on Hamilton, Ontario (519,949) over Bermuda's 902-person capital (576x).
|
|
115
|
+
*/
|
|
116
|
+
export declare const NATIONAL_CAPITAL_MARGIN_LOG10 = 2;
|
|
117
|
+
/**
|
|
118
|
+
* Bounded capital promotion (#1880) — the third soft key for the bare-toponym class, applied AFTER
|
|
119
|
+
* {@link rankByImportance} because the fame prior is what decides this class and a capital signal parked below the
|
|
120
|
+
* deciding stage measurably never reaches an answer (the iteration-1 board run: the candidate-order bonus reordered
|
|
121
|
+
* `findPlace` on every target row and moved 0 of the 12).
|
|
122
|
+
*
|
|
123
|
+
* The rule: within the exact tier, take the first NATIONAL-capital row and walk it upward past each row it is within
|
|
124
|
+
* {@link NATIONAL_CAPITAL_MARGIN_LOG10} of, stopping at the first row over the margin or at another national capital.
|
|
125
|
+
* Same three house rules as the other keys — tier-safe (never crosses the exact/partial boundary; the cost is real and
|
|
126
|
+
* accepted: a capital that only PARTIALLY matched the query — Saint George's, Grenada for the abbreviated "St.
|
|
127
|
+
* George's" — stays behind every exact match, because crossing that line is how iteration 1 answered bare "Djibouti"
|
|
128
|
+
* with the capital city instead of the country), positive evidence only (no capital in the list → identity, and the
|
|
129
|
+
* margin reads the same `prominence ?? score` size every other key does), and stable (non-promoted rows keep their
|
|
130
|
+
* order).
|
|
131
|
+
*
|
|
132
|
+
* The margin deliberately re-uses log10-population units rather than the importance scale: the ratified importance flip
|
|
133
|
+
* decisions (Whitby/Windsor/Springfield) sit on gaps of 0.004–0.02, while the capital contests this key exists for sit
|
|
134
|
+
* on gaps of 0.21–0.24 — an importance-scale bonus big enough to win them would dwarf every ratified decision on the
|
|
135
|
+
* same scale.
|
|
136
|
+
*/
|
|
137
|
+
export declare function promoteCapitals<T extends Rankable & Pick<ResolvedPlace, "name" | "country" | "lat" | "lon">>(candidates: readonly T[], level: CapitalLevelFn | undefined): T[];
|
|
138
|
+
export {};
|
|
139
|
+
//# sourceMappingURL=toponym-prior.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toponym-prior.d.ts","sourceRoot":"","sources":["../toponym-prior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,4BAA4B,IAAI,CAAA;AAgB7C;;;GAGG;AACH,KAAK,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,GAC3C,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC,CAAC,CAAA;AAmIrF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,QAAQ,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAkBlF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,QAAQ,EACpD,UAAU,EAAE,SAAS,CAAC,EAAE,EACxB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,MAAM,GAAE,MAAqC,GAC3C,CAAC,EAAE,CAOL;AAED;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC,KAAK,MAAM,CAAA;AAYvG;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC,EAC3G,UAAU,EAAE,SAAS,CAAC,EAAE,EACxB,KAAK,EAAE,cAAc,GAAG,SAAS,GAC/B,CAAC,EAAE,CAoCL"}
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* #17 bare city-name disambiguation — two SOFT ranking keys for the bare-toponym class.
|
|
7
|
+
*
|
|
8
|
+
* A bare city name is the one query shape where the resolver has no geography to reason with: no
|
|
9
|
+
* postcode to anchor against, no region to scope by, no country the address itself named. All that
|
|
10
|
+
* is left is a prior over which same-named place a person typing that word alone probably meant.
|
|
11
|
+
* The shipped prior is POPULATION, and population is measurably the wrong prior for this class —
|
|
12
|
+
* the panel run of 2026-08-10 caught it four times over:
|
|
13
|
+
*
|
|
14
|
+
* | query | population winner | gold | miss |
|
|
15
|
+
* | ------- | -------------------- | --------------------- | -------- |
|
|
16
|
+
* | Whitby | Whitby ON (128,377) | Whitby, N Yorks (13,130) | 5,508 km |
|
|
17
|
+
* | Warwick | Warwick RI (82,999) | Warwick, Warks (32,719) | 5,211 km |
|
|
18
|
+
* | Epping | Epping VIC (32,395) | Epping, Essex (12,547) | 16,874 km |
|
|
19
|
+
* | Windsor | Windsor ON (217,188) | Windsor, Berks (26,885) | 6,007 km |
|
|
20
|
+
*
|
|
21
|
+
* Every one of those is a place people know for something other than its size, and the gazetteer
|
|
22
|
+
* already measures that: `admin-global-priority-importance.db` ranks all four the RIGHT way round
|
|
23
|
+
* (Whitby GB 0.5496 over CA 0.5089; Windsor GB 0.5648 over CA 0.5607 — a 0.004 margin population
|
|
24
|
+
* inverts by a factor of eight). What it measures is a BLENDED global toponym prior
|
|
25
|
+
* (`ResolvedPlace.importance`): the concordance's encyclopedia-derived channel where a concordance
|
|
26
|
+
* matched, a population-derived proxy everywhere else — the one scale on which every bearer of a
|
|
27
|
+
* name is scored comparably, which is the precondition for comparing them at all.
|
|
28
|
+
* {@link rankByImportance} consumes it. (The STRICT encyclopedia-evidence channel keeps its own
|
|
29
|
+
* reserved slot, `ResolvedPlace.encyclopedic`, which no ranking key reads and no shipped artifact
|
|
30
|
+
* yet populates — see `core/resolver/types.ts`.)
|
|
31
|
+
*
|
|
32
|
+
* {@link rankByCountryPrior} covers the other half of the class — the query where a country IS
|
|
33
|
+
* known, but only because a locale said so. See `span-rescore.ts` for where that one applies.
|
|
34
|
+
*
|
|
35
|
+
* Both obey the same three house rules, and neither is a gate:
|
|
36
|
+
*
|
|
37
|
+
* 1. **Tier-safe.** `exactMatch` stays the primary key. A soft prior re-orders WITHIN a tier; it never
|
|
38
|
+
* promotes a partial match over an exact one.
|
|
39
|
+
* 2. **Positive evidence only.** An absent score is unmeasured, not zero (the meaning-of-zero rule), so an
|
|
40
|
+
* unscored candidate is never moved BY the signal and never penalized FOR lacking it — it keeps the
|
|
41
|
+
* rank population gave it while the scored rows reorder among themselves. On a candidate.db built
|
|
42
|
+
* before the #28 `importance` column, nothing is scored, so {@link rankByImportance} is
|
|
43
|
+
* byte-stable by construction.
|
|
44
|
+
* 3. **Stable.** Equal keys keep their incoming order, so the backend's own ranking survives underneath. That order
|
|
45
|
+
* carries decisions only the backend can make — the candidate backend's seat tiebreak
|
|
46
|
+
* (`resolver-wof-sqlite/primary-preference.ts`) reaches an end-to-end answer solely through this stability
|
|
47
|
+
* (#1729), so equal-key stability here is load-bearing, not cosmetic.
|
|
48
|
+
*/
|
|
49
|
+
/**
|
|
50
|
+
* Weight of the locale-country bonus, in the same log10-population units the candidate backend's `prominence` uses
|
|
51
|
+
* (`-neg_rank` = log10(population + 1)). 2 == "the in-country place may be up to 100x smaller and still win".
|
|
52
|
+
*
|
|
53
|
+
* The value is the resolver's existing `anchorWeight` default (`resolve.ts`), reused deliberately: that knob is the
|
|
54
|
+
* postcode-anchor country pin, and this is the same quantity from a weaker source, so the two should not disagree about
|
|
55
|
+
* what a country signal is worth. Calibrated against the live board (2026-08-10, shipped `candidate.db`), it moves
|
|
56
|
+
* exactly the queries where the locale is implausible and leaves the rest alone:
|
|
57
|
+
*
|
|
58
|
+
* - `Zürich` en-US — Zurich KS 1.91 + 2 = 3.91 loses to Zürich CH 5.65. **Flips** (was 8,043 km off).
|
|
59
|
+
* - `Berlin` en-US — Berlin CT 4.30 + 2 = 6.30 loses to Berlin DE 6.56. **Flips.**
|
|
60
|
+
* - `Manchester` en-US — Manchester NH 5.06 + 2 = 7.06 beats Manchester GB 5.74. **Held.**
|
|
61
|
+
* - `Springfield` en-US — every bearer is US, so the bonus is uniform. **Held.**
|
|
62
|
+
* - `Moscow` en-US — Moscow ID 4.42 + 2 = 6.42 beats Москва 6.10. **Held.**
|
|
63
|
+
* - `Fulda` en-US — Fulda MN 3.13 + 2 = 5.13 beats Fulda DE 4.84. **Held.**
|
|
64
|
+
*/
|
|
65
|
+
export const DEFAULT_COUNTRY_PRIOR_WEIGHT = 2;
|
|
66
|
+
/**
|
|
67
|
+
* Importance margin below which two SAME-COUNTRY bearers are a tie, and the tie falls back to referential (size) order.
|
|
68
|
+
* Ratified 2026-08-11 (the five bare-query flip decisions): bare `Springfield` must stay on the referential answer —
|
|
69
|
+
* the live chain is IL 0.612605 → MA 0.611142 → MO 0.596195 (adjacent gaps 0.0015 and 0.0149, full span 0.0164), so the
|
|
70
|
+
* band must cover at least the 0.0149 adjacent gap for the trio to chain into one cluster.
|
|
71
|
+
*
|
|
72
|
+
* The band never compares across countries, and that scope is forced by decided rows, not preference: Windsor's
|
|
73
|
+
* accepted flip (GB 0.564842 over CA 0.560687) sits at a 0.0042 gap — inside ANY band that covers Springfield. The two
|
|
74
|
+
* decisions are only co-satisfiable if the band binds same-country pairs alone. That is also what the §2 referential
|
|
75
|
+
* policy (ROAD_TO_V9) says: within a country the geocoder ranks referentially; the blended prior's job is the
|
|
76
|
+
* cross-country question — which country's bearer a bare query meant.
|
|
77
|
+
*/
|
|
78
|
+
const SAME_COUNTRY_IMPORTANCE_TIE_BAND = 0.02;
|
|
79
|
+
/**
|
|
80
|
+
* Partition into (exact, rest), sort each half with `key` DESC, and re-join. The partition is what keeps a soft prior
|
|
81
|
+
* soft: it can only ever re-order candidates the backend already considers equally good matches. Backends that don't
|
|
82
|
+
* stamp `exactMatch` land every row in one tier, which is the correct degradation — the key then applies to the whole
|
|
83
|
+
* list.
|
|
84
|
+
*/
|
|
85
|
+
function rankWithinTier(candidates, compare) {
|
|
86
|
+
const exact = [];
|
|
87
|
+
const rest = [];
|
|
88
|
+
for (const c of candidates) {
|
|
89
|
+
// `exactMatch` is TRI-STATE: true / false / undefined (a backend path that stamps no flag —
|
|
90
|
+
// e.g. WOFSQLitePlaceLookup's postcode-area neighbours from #fetchLocalitiesByID). Only a
|
|
91
|
+
// stated TRUE earns the exact tier; undefined must not outrank a real fuzzy name match
|
|
92
|
+
// (the 2026-08-10 de.native_locality incident: 75 Saxon towns lost to nameless neighbours).
|
|
93
|
+
;
|
|
94
|
+
(c.exactMatch === true ? exact : rest).push(c);
|
|
95
|
+
}
|
|
96
|
+
// `toSorted` is stable, so equal keys keep the backend's incoming order.
|
|
97
|
+
return [...exact.toSorted(compare), ...rest.toSorted(compare)];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Size, in the backend's own units — the candidate backend's `prominence` is log10(population + 1); a backend that
|
|
101
|
+
* computes no prominence falls back to its raw `score`.
|
|
102
|
+
*/
|
|
103
|
+
const size = (c) => c.prominence ?? c.score;
|
|
104
|
+
/**
|
|
105
|
+
* A candidate the gazetteer actually scored. An absent value means "the score source never measured this place" OR
|
|
106
|
+
* "this artifact predates the column" OR "the join refused the row" — three different things, none of them zero.
|
|
107
|
+
*/
|
|
108
|
+
const measured = (c) => typeof c.importance === "number" && Number.isFinite(c.importance);
|
|
109
|
+
/**
|
|
110
|
+
* Reorder ONLY the measured candidates, and only among the positions they already occupy.
|
|
111
|
+
*
|
|
112
|
+
* This is what "positive evidence only" has to mean when coverage is partial, which it always is — measured on the
|
|
113
|
+
* shipped importance artifact, the four bare GB panel rows have 2/7, 8/10, 8/10 and 9/10 of their candidates scored. A
|
|
114
|
+
* blanket "abstain unless everything is measured" throws the signal away on all four; treating absent as 0 would let a
|
|
115
|
+
* scored hamlet leapfrog an unscored metropolis. Neither is right, and the resolution is that an unmeasured row simply
|
|
116
|
+
* does not participate: it holds the rank population gave it, and the scored rows permute among the slots they hold
|
|
117
|
+
* between them.
|
|
118
|
+
*
|
|
119
|
+
* So for `Whitby` — CA(0.5089), GB(0.5496), TC(—), then four unscored bearers — the swap is confined to slots 0 and 1,
|
|
120
|
+
* GB takes the lead, and TC never moves.
|
|
121
|
+
*/
|
|
122
|
+
function reorderMeasured(tier, order) {
|
|
123
|
+
const slots = [];
|
|
124
|
+
for (const [i, c] of tier.entries()) {
|
|
125
|
+
if (measured(c)) {
|
|
126
|
+
slots.push(i);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (slots.length < 2)
|
|
130
|
+
return [...tier];
|
|
131
|
+
const sorted = order(slots.map((i) => tier[i]));
|
|
132
|
+
const out = [...tier];
|
|
133
|
+
for (const [k, slot] of slots.entries()) {
|
|
134
|
+
out[slot] = sorted[k];
|
|
135
|
+
}
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The importance ordering over MEASURED rows, with the {@link SAME_COUNTRY_IMPORTANCE_TIE_BAND} applied.
|
|
140
|
+
*
|
|
141
|
+
* Same-country bearers whose adjacent importance gaps sit inside the band chain into one cluster (transitive on purpose
|
|
142
|
+
* — otherwise the boundary would depend on comparison order), and a cluster orders its members referentially (size
|
|
143
|
+
* DESC). Clusters — including every cross-country row, which is always its own cluster — rank by their most important
|
|
144
|
+
* member, then head size, then input order. A cluster therefore moves as a unit: a same-country near-tie cannot be
|
|
145
|
+
* split by a foreign row falling between its members' scores.
|
|
146
|
+
*/
|
|
147
|
+
function orderMeasuredByImportance(rows) {
|
|
148
|
+
// Group by country in first-appearance order; a row without a country can never substantiate a
|
|
149
|
+
// same-country tie, so it stays a singleton.
|
|
150
|
+
const groups = new Map();
|
|
151
|
+
const clusters = [];
|
|
152
|
+
for (const [i, row] of rows.entries()) {
|
|
153
|
+
const country = row.country?.toUpperCase();
|
|
154
|
+
if (!country) {
|
|
155
|
+
clusters.push({ firstIndex: i, members: [row] });
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
const group = groups.get(country);
|
|
159
|
+
if (group) {
|
|
160
|
+
group.members.push(row);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
groups.set(country, { firstIndex: i, members: [row] });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
for (const group of groups.values()) {
|
|
167
|
+
const sorted = group.members.toSorted((a, b) => b.importance - a.importance || size(b) - size(a));
|
|
168
|
+
let open = [];
|
|
169
|
+
for (const row of sorted) {
|
|
170
|
+
if (open.length && open.at(-1).importance - row.importance > SAME_COUNTRY_IMPORTANCE_TIE_BAND) {
|
|
171
|
+
clusters.push({ firstIndex: group.firstIndex, members: open });
|
|
172
|
+
open = [];
|
|
173
|
+
}
|
|
174
|
+
open.push(row);
|
|
175
|
+
}
|
|
176
|
+
if (open.length) {
|
|
177
|
+
clusters.push({ firstIndex: group.firstIndex, members: open });
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const keyed = clusters.map((cluster) => ({
|
|
181
|
+
firstIndex: cluster.firstIndex,
|
|
182
|
+
key: Math.max(...cluster.members.map((m) => m.importance)),
|
|
183
|
+
members: cluster.members.toSorted((a, b) => size(b) - size(a)),
|
|
184
|
+
}));
|
|
185
|
+
keyed.sort((a, b) => b.key - a.key || size(b.members[0]) - size(a.members[0]) || a.firstIndex - b.firstIndex);
|
|
186
|
+
return keyed.flatMap((c) => c.members);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Importance-first ordering — the #28 fame prior, consumed.
|
|
190
|
+
*
|
|
191
|
+
* Ranks by `importance` DESC within the exact tier, with `prominence`/`score` as the tiebreak (two places of equal fame
|
|
192
|
+
* separate on size). Candidates the gazetteer never scored do not participate — they hold the rank population gave them
|
|
193
|
+
* while the scored rows permute among their own slots (see {@link reorderMeasured}). Returns the input untouched when
|
|
194
|
+
* fewer than two candidates are scored.
|
|
195
|
+
*
|
|
196
|
+
* The producer is the candidate build's `importance` column (#28) — the BLENDED prior (the concordance's
|
|
197
|
+
* encyclopedia-derived channel clamped around a population-derived base — `place-importance-schema.ts`'s
|
|
198
|
+
* `blendImportance`; see `candidate-schema.ts` → `CandidateTable.importance` for why the strict channel is deliberately
|
|
199
|
+
* NOT what lands there). On an artifact predating the column, `importance` is `undefined` on every candidate the
|
|
200
|
+
* backend produces and the abstention below keeps the ranking byte-stable.
|
|
201
|
+
*
|
|
202
|
+
* Flip decisions, ratified 2026-08-11: bare `Moscow`→Москва, `Manchester`→GB, `Fulda`→DE, `Cambridge`→GB are ACCEPTED
|
|
203
|
+
* behavior — all cross-country contests, where this prior answers the question population cannot. Bare `Springfield`
|
|
204
|
+
* ABSTAINS to the referential answer via {@link SAME_COUNTRY_IMPORTANCE_TIE_BAND}; no candidate is dropped, so the
|
|
205
|
+
* runner-up survives as a declared alternative downstream.
|
|
206
|
+
*/
|
|
207
|
+
export function rankByImportance(candidates) {
|
|
208
|
+
if (candidates.length < 2)
|
|
209
|
+
return [...candidates];
|
|
210
|
+
// Abstain entirely until at least one candidate carries a MEASURED score — the tier split
|
|
211
|
+
// below is only meaningful as a tiebreak among scored rows. Without this, wiring the consumer
|
|
212
|
+
// before the #28 producer reordered candidates on the exactMatch flag alone (meaning-of-zero:
|
|
213
|
+
// an absent score must not act as evidence).
|
|
214
|
+
if (!candidates.some(measured))
|
|
215
|
+
return [...candidates];
|
|
216
|
+
const exact = [];
|
|
217
|
+
const rest = [];
|
|
218
|
+
for (const c of candidates) {
|
|
219
|
+
// Tri-state exactMatch: only a stated TRUE earns the exact tier (see rankWithinTier).
|
|
220
|
+
;
|
|
221
|
+
(c.exactMatch === true ? exact : rest).push(c);
|
|
222
|
+
}
|
|
223
|
+
return [...reorderMeasured(exact, orderMeasuredByImportance), ...reorderMeasured(rest, orderMeasuredByImportance)];
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Soft locale-country prior: `(prominence ?? score) + weight` for a candidate in `country`.
|
|
227
|
+
*
|
|
228
|
+
* Additive, never a filter — a far more prominent foreign namesake still wins (Zürich CH over Zurich KS) while a close
|
|
229
|
+
* contest goes to the locale (Manchester NH over Manchester GB). No-op without a `country`, so the un-scoped path stays
|
|
230
|
+
* byte-identical.
|
|
231
|
+
*
|
|
232
|
+
* The units matter: `prominence` on the candidate backend is log10(population + 1), so `weight` is read as "orders of
|
|
233
|
+
* magnitude of population the in-country place is allowed to give away". Pass a large weight to make the country
|
|
234
|
+
* effectively hard, `0` to disable.
|
|
235
|
+
*/
|
|
236
|
+
export function rankByCountryPrior(candidates, country, weight = DEFAULT_COUNTRY_PRIOR_WEIGHT) {
|
|
237
|
+
if (!country || candidates.length < 2)
|
|
238
|
+
return [...candidates];
|
|
239
|
+
const target = country.toUpperCase();
|
|
240
|
+
const key = (c) => size(c) + (c.country?.toUpperCase() === target ? weight : 0);
|
|
241
|
+
return rankWithinTier(candidates, (a, b) => key(b) - key(a));
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The level a candidate must hold to be PROMOTED: national capitals only. Admin-1 seats stay un-promoted, and that
|
|
245
|
+
* scope is forced by decided rows, not caution — a seat margin of even 1 log10 unit flips bare `Springfield` to
|
|
246
|
+
* Springfield, Illinois against the ratified 2026-08-11 referential decision
|
|
247
|
+
* ({@link SAME_COUNTRY_IMPORTANCE_TIE_BAND}), and sends bare `Hamilton` to the Waikato seat (Hamilton NZ, 2.8x smaller
|
|
248
|
+
* than Hamilton, Ontario), both measured on the shipped `candidate.db`. The reference still records seats; no consumer
|
|
249
|
+
* promotes on them.
|
|
250
|
+
*/
|
|
251
|
+
const PROMOTABLE_CAPITAL_LEVEL = 2;
|
|
252
|
+
/**
|
|
253
|
+
* Margin a national capital may give away, in log10-population units: a namesake must be more than 10^2 = 100x more
|
|
254
|
+
* populous to hold the lead. Bare "San José" reaches the Costa Rican capital (342,188) over San Jose, California
|
|
255
|
+
* (969,655 — 2.8x); bare "Hamilton" stays on Hamilton, Ontario (519,949) over Bermuda's 902-person capital (576x).
|
|
256
|
+
*/
|
|
257
|
+
export const NATIONAL_CAPITAL_MARGIN_LOG10 = 2;
|
|
258
|
+
/**
|
|
259
|
+
* Bounded capital promotion (#1880) — the third soft key for the bare-toponym class, applied AFTER
|
|
260
|
+
* {@link rankByImportance} because the fame prior is what decides this class and a capital signal parked below the
|
|
261
|
+
* deciding stage measurably never reaches an answer (the iteration-1 board run: the candidate-order bonus reordered
|
|
262
|
+
* `findPlace` on every target row and moved 0 of the 12).
|
|
263
|
+
*
|
|
264
|
+
* The rule: within the exact tier, take the first NATIONAL-capital row and walk it upward past each row it is within
|
|
265
|
+
* {@link NATIONAL_CAPITAL_MARGIN_LOG10} of, stopping at the first row over the margin or at another national capital.
|
|
266
|
+
* Same three house rules as the other keys — tier-safe (never crosses the exact/partial boundary; the cost is real and
|
|
267
|
+
* accepted: a capital that only PARTIALLY matched the query — Saint George's, Grenada for the abbreviated "St.
|
|
268
|
+
* George's" — stays behind every exact match, because crossing that line is how iteration 1 answered bare "Djibouti"
|
|
269
|
+
* with the capital city instead of the country), positive evidence only (no capital in the list → identity, and the
|
|
270
|
+
* margin reads the same `prominence ?? score` size every other key does), and stable (non-promoted rows keep their
|
|
271
|
+
* order).
|
|
272
|
+
*
|
|
273
|
+
* The margin deliberately re-uses log10-population units rather than the importance scale: the ratified importance flip
|
|
274
|
+
* decisions (Whitby/Windsor/Springfield) sit on gaps of 0.004–0.02, while the capital contests this key exists for sit
|
|
275
|
+
* on gaps of 0.21–0.24 — an importance-scale bonus big enough to win them would dwarf every ratified decision on the
|
|
276
|
+
* same scale.
|
|
277
|
+
*/
|
|
278
|
+
export function promoteCapitals(candidates, level) {
|
|
279
|
+
if (!level || candidates.length < 2)
|
|
280
|
+
return [...candidates];
|
|
281
|
+
const exact = [];
|
|
282
|
+
const rest = [];
|
|
283
|
+
for (const c of candidates) {
|
|
284
|
+
// Tri-state exactMatch, same reading as rankWithinTier: only a stated TRUE earns the tier.
|
|
285
|
+
;
|
|
286
|
+
(c.exactMatch === true ? exact : rest).push(c);
|
|
287
|
+
}
|
|
288
|
+
const tier = exact.length ? exact : rest;
|
|
289
|
+
const best = tier.findIndex((c) => level(c) >= PROMOTABLE_CAPITAL_LEVEL);
|
|
290
|
+
if (best <= 0)
|
|
291
|
+
return [...candidates];
|
|
292
|
+
let target = best;
|
|
293
|
+
while (target > 0) {
|
|
294
|
+
const above = tier[target - 1];
|
|
295
|
+
if (level(above) >= PROMOTABLE_CAPITAL_LEVEL)
|
|
296
|
+
break;
|
|
297
|
+
if (size(tier[best]) + NATIONAL_CAPITAL_MARGIN_LOG10 < size(above))
|
|
298
|
+
break;
|
|
299
|
+
target--;
|
|
300
|
+
}
|
|
301
|
+
if (target === best)
|
|
302
|
+
return [...candidates];
|
|
303
|
+
const reordered = [...tier];
|
|
304
|
+
const [capital] = reordered.splice(best, 1);
|
|
305
|
+
reordered.splice(target, 0, capital);
|
|
306
|
+
return exact.length ? [...reordered, ...rest] : reordered;
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=toponym-prior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toponym-prior.js","sourceRoot":"","sources":["../toponym-prior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAIH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAA;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,gCAAgC,GAAG,IAAI,CAAA;AAS7C;;;;;GAKG;AACH,SAAS,cAAc,CAAqB,UAAwB,EAAE,OAA+B;IACpG,MAAM,KAAK,GAAQ,EAAE,CAAA;IACrB,MAAM,IAAI,GAAQ,EAAE,CAAA;IAEpB,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC5B,4FAA4F;QAC5F,0FAA0F;QAC1F,uFAAuF;QACvF,4FAA4F;QAC5F,CAAC;QAAA,CAAC,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAChD,CAAC;IAED,yEAAyE;IACzE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;AAC/D,CAAC;AAED;;;GAGG;AACH,MAAM,IAAI,GAAG,CAAC,CAAW,EAAU,EAAE,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,KAAK,CAA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