@mailwoman/resolver-wof-sqlite 9.1.0 → 9.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/README.md +36 -20
  2. package/lib/address/index.ts +9 -0
  3. package/{address-point-interpolation.ts → lib/address/point-interpolation.ts} +40 -28
  4. package/{address-point-schema.ts → lib/address/point-schema.ts} +34 -8
  5. package/lib/address/point.ts +280 -0
  6. package/{ancestry-backfill.ts → lib/ancestry/backfill.ts} +14 -19
  7. package/{ancestry.ts → lib/ancestry/index.ts} +13 -8
  8. package/{build-candidate.ts → lib/build-candidate.ts} +243 -199
  9. package/{build-slim.ts → lib/build-slim.ts} +153 -168
  10. package/lib/candidate/alias-bags.ts +56 -0
  11. package/lib/candidate/ancestors-sidecar.ts +204 -0
  12. package/lib/candidate/country-display-names.ts +79 -0
  13. package/lib/candidate/extract-fold.ts +138 -0
  14. package/lib/candidate/name-roles.ts +238 -0
  15. package/lib/candidate/own-name.ts +146 -0
  16. package/lib/candidate/place-attrs.ts +44 -0
  17. package/lib/candidate-ancestors-schema.ts +195 -0
  18. package/{candidate-fts.ts → lib/candidate-fts.ts} +7 -5
  19. package/{candidate-importance.ts → lib/candidate-importance.ts} +54 -57
  20. package/lib/candidate-lookup.ts +976 -0
  21. package/{candidate-schema.ts → lib/candidate-schema.ts} +34 -6
  22. package/lib/candidate-scoring.ts +261 -0
  23. package/lib/capital-schema.ts +89 -0
  24. package/lib/capitals.ts +148 -0
  25. package/{coincident-roles.ts → lib/coincident-roles.ts} +75 -19
  26. package/{convention.ts → lib/convention/index.ts} +5 -5
  27. package/lib/convention/schema.ts +72 -0
  28. package/{coverage-manifest-schema.ts → lib/coverage-manifest-schema.ts} +15 -16
  29. package/lib/currency-backfill.ts +334 -0
  30. package/lib/env.ts +50 -0
  31. package/lib/exact-match.ts +113 -0
  32. package/{sharding.ts → lib/extracts.ts} +63 -60
  33. package/lib/fst/autocomplete.ts +176 -0
  34. package/{fst-builder.ts → lib/fst/builder.ts} +30 -27
  35. package/{fst-deserialize-web.ts → lib/fst/deserialize-web.ts} +27 -87
  36. package/lib/fst/format.ts +106 -0
  37. package/{fst-freshness.ts → lib/fst/freshness.ts} +42 -75
  38. package/lib/fst/index.ts +14 -0
  39. package/{fst-matcher.ts → lib/fst/matcher.ts} +1 -1
  40. package/{fst-serialize.ts → lib/fst/serialize.ts} +37 -115
  41. package/{fst-types.ts → lib/fst/types.ts} +4 -2
  42. package/{fts.ts → lib/fts/index.ts} +28 -23
  43. package/{fts-query.ts → lib/fts/query.ts} +2 -2
  44. package/{geonames-aliases.ts → lib/geonames/aliases.ts} +13 -13
  45. package/lib/geonames/index.ts +8 -0
  46. package/{geonames-postal.ts → lib/geonames/postal.ts} +16 -15
  47. package/{index.ts → lib/index.ts} +52 -48
  48. package/{interpolation.ts → lib/interpolation.ts} +137 -41
  49. package/lib/lookup.ts +861 -0
  50. package/{name-score.ts → lib/name-score.ts} +6 -4
  51. package/lib/nsul/index.ts +8 -0
  52. package/lib/nsul/lookup.ts +144 -0
  53. package/lib/nsul/schema.ts +130 -0
  54. package/{place-importance-schema.ts → lib/place-importance-schema.ts} +70 -22
  55. package/lib/poi/index.ts +8 -0
  56. package/{poi-lookup.ts → lib/poi/lookup.ts} +32 -39
  57. package/{poi-schema.ts → lib/poi/schema.ts} +10 -6
  58. package/lib/polygon-schema.ts +47 -0
  59. package/{postal-city-alias-lookup.ts → lib/postal/city-alias-lookup.ts} +15 -21
  60. package/{postal-city-candidate-schema.ts → lib/postal/city-candidate-schema.ts} +4 -2
  61. package/lib/postal/index.ts +9 -0
  62. package/{postcode-point-lookup.ts → lib/postcode-point-lookup.ts} +17 -15
  63. package/lib/primary-preference.ts +226 -0
  64. package/lib/proximity-rerank.ts +120 -0
  65. package/{ranking-weights.ts → lib/ranking-weights.ts} +30 -4
  66. package/lib/region-keys.ts +144 -0
  67. package/{reverse.ts → lib/reverse.ts} +45 -56
  68. package/{schema.ts → lib/schema.ts} +11 -1
  69. package/lib/search-fetch.ts +257 -0
  70. package/{sqlite-convention-source.ts → lib/sqlite-convention-source.ts} +9 -10
  71. package/lib/sqlite-utils.ts +83 -0
  72. package/{street-centroid-schema.ts → lib/street/centroid-schema.ts} +12 -6
  73. package/{street-centroid.ts → lib/street/centroid.ts} +26 -28
  74. package/lib/street/index.ts +13 -0
  75. package/{street-morphology-fst-builder.ts → lib/street/morphology-fst-builder.ts} +24 -14
  76. package/{street-morphology-fst-loader.ts → lib/street/morphology-fst-loader.ts} +14 -12
  77. package/{street-name-lookup.ts → lib/street/name-lookup.ts} +14 -30
  78. package/lib/street/normalize.ts +572 -0
  79. package/{street-segment-schema.ts → lib/street/segment-schema.ts} +13 -8
  80. package/{types.ts → lib/types.ts} +49 -9
  81. package/{unified-schema.ts → lib/unified-schema.ts} +21 -25
  82. package/lib/uprn/existence.ts +84 -0
  83. package/lib/uprn/index.ts +9 -0
  84. package/lib/uprn/lookup.ts +206 -0
  85. package/lib/uprn/schema.ts +124 -0
  86. package/lib/weights-overlay-linker.ts +878 -0
  87. package/out/address/index.d.ts +9 -0
  88. package/out/address/index.d.ts.map +1 -0
  89. package/out/address/index.js +9 -0
  90. package/out/address/index.js.map +1 -0
  91. package/out/{address-point-interpolation.d.ts → address/point-interpolation.d.ts} +11 -10
  92. package/out/address/point-interpolation.d.ts.map +1 -0
  93. package/out/{address-point-interpolation.js → address/point-interpolation.js} +29 -23
  94. package/out/address/point-interpolation.js.map +1 -0
  95. package/out/{address-point-schema.d.ts → address/point-schema.d.ts} +30 -10
  96. package/out/address/point-schema.d.ts.map +1 -0
  97. package/out/{address-point-schema.js → address/point-schema.js} +7 -3
  98. package/out/address/point-schema.js.map +1 -0
  99. package/out/{address-point.d.ts → address/point.d.ts} +16 -8
  100. package/out/address/point.d.ts.map +1 -0
  101. package/out/address/point.js +191 -0
  102. package/out/address/point.js.map +1 -0
  103. package/out/{ancestry-backfill.d.ts → ancestry/backfill.d.ts} +7 -5
  104. package/out/ancestry/backfill.d.ts.map +1 -0
  105. package/out/{ancestry-backfill.js → ancestry/backfill.js} +12 -16
  106. package/out/ancestry/backfill.js.map +1 -0
  107. package/out/{ancestry.d.ts → ancestry/index.d.ts} +6 -5
  108. package/out/ancestry/index.d.ts.map +1 -0
  109. package/out/{ancestry.js → ancestry/index.js} +7 -7
  110. package/out/ancestry/index.js.map +1 -0
  111. package/out/build-candidate.d.ts +88 -7
  112. package/out/build-candidate.d.ts.map +1 -1
  113. package/out/build-candidate.js +145 -149
  114. package/out/build-candidate.js.map +1 -1
  115. package/out/build-slim.d.ts +5 -5
  116. package/out/build-slim.d.ts.map +1 -1
  117. package/out/build-slim.js +127 -142
  118. package/out/build-slim.js.map +1 -1
  119. package/out/candidate/alias-bags.d.ts +19 -0
  120. package/out/candidate/alias-bags.d.ts.map +1 -0
  121. package/out/candidate/alias-bags.js +39 -0
  122. package/out/candidate/alias-bags.js.map +1 -0
  123. package/out/candidate/ancestors-sidecar.d.ts +32 -0
  124. package/out/candidate/ancestors-sidecar.d.ts.map +1 -0
  125. package/out/candidate/ancestors-sidecar.js +140 -0
  126. package/out/candidate/ancestors-sidecar.js.map +1 -0
  127. package/out/candidate/country-display-names.d.ts +35 -0
  128. package/out/candidate/country-display-names.d.ts.map +1 -0
  129. package/out/candidate/country-display-names.js +59 -0
  130. package/out/candidate/country-display-names.js.map +1 -0
  131. package/out/candidate/extract-fold.d.ts +32 -0
  132. package/out/candidate/extract-fold.d.ts.map +1 -0
  133. package/out/candidate/extract-fold.js +104 -0
  134. package/out/candidate/extract-fold.js.map +1 -0
  135. package/out/candidate/name-roles.d.ts +57 -0
  136. package/out/candidate/name-roles.d.ts.map +1 -0
  137. package/out/candidate/name-roles.js +166 -0
  138. package/out/candidate/name-roles.js.map +1 -0
  139. package/out/candidate/own-name.d.ts +50 -0
  140. package/out/candidate/own-name.d.ts.map +1 -0
  141. package/out/candidate/own-name.js +132 -0
  142. package/out/candidate/own-name.js.map +1 -0
  143. package/out/candidate/place-attrs.d.ts +43 -0
  144. package/out/candidate/place-attrs.d.ts.map +1 -0
  145. package/out/candidate/place-attrs.js +15 -0
  146. package/out/candidate/place-attrs.js.map +1 -0
  147. package/out/candidate-ancestors-schema.d.ts +150 -0
  148. package/out/candidate-ancestors-schema.d.ts.map +1 -0
  149. package/out/candidate-ancestors-schema.js +123 -0
  150. package/out/candidate-ancestors-schema.js.map +1 -0
  151. package/out/candidate-fts.d.ts +7 -5
  152. package/out/candidate-fts.d.ts.map +1 -1
  153. package/out/candidate-fts.js +5 -3
  154. package/out/candidate-fts.js.map +1 -1
  155. package/out/candidate-importance.d.ts +16 -16
  156. package/out/candidate-importance.d.ts.map +1 -1
  157. package/out/candidate-importance.js +47 -52
  158. package/out/candidate-importance.js.map +1 -1
  159. package/out/candidate-lookup.d.ts +31 -52
  160. package/out/candidate-lookup.d.ts.map +1 -1
  161. package/out/candidate-lookup.js +380 -172
  162. package/out/candidate-lookup.js.map +1 -1
  163. package/out/candidate-schema.d.ts +31 -7
  164. package/out/candidate-schema.d.ts.map +1 -1
  165. package/out/candidate-schema.js +3 -0
  166. package/out/candidate-schema.js.map +1 -1
  167. package/out/candidate-scoring.d.ts +34 -0
  168. package/out/candidate-scoring.d.ts.map +1 -0
  169. package/out/candidate-scoring.js +196 -0
  170. package/out/candidate-scoring.js.map +1 -0
  171. package/out/capital-schema.d.ts +51 -0
  172. package/out/capital-schema.d.ts.map +1 -0
  173. package/out/capital-schema.js +63 -0
  174. package/out/capital-schema.js.map +1 -0
  175. package/out/capitals.d.ts +69 -0
  176. package/out/capitals.d.ts.map +1 -0
  177. package/out/capitals.js +98 -0
  178. package/out/capitals.js.map +1 -0
  179. package/out/coincident-roles.d.ts +12 -4
  180. package/out/coincident-roles.d.ts.map +1 -1
  181. package/out/coincident-roles.js +43 -11
  182. package/out/coincident-roles.js.map +1 -1
  183. package/out/{convention.d.ts → convention/index.d.ts} +5 -5
  184. package/out/convention/index.d.ts.map +1 -0
  185. package/out/{convention.js → convention/index.js} +4 -4
  186. package/out/convention/index.js.map +1 -0
  187. package/out/convention/schema.d.ts +51 -0
  188. package/out/convention/schema.d.ts.map +1 -0
  189. package/out/convention/schema.js +34 -0
  190. package/out/convention/schema.js.map +1 -0
  191. package/out/coverage-manifest-schema.d.ts +8 -8
  192. package/out/coverage-manifest-schema.d.ts.map +1 -1
  193. package/out/coverage-manifest-schema.js +6 -10
  194. package/out/coverage-manifest-schema.js.map +1 -1
  195. package/out/currency-backfill.d.ts +90 -0
  196. package/out/currency-backfill.d.ts.map +1 -0
  197. package/out/currency-backfill.js +196 -0
  198. package/out/currency-backfill.js.map +1 -0
  199. package/out/env.d.ts +43 -0
  200. package/out/env.d.ts.map +1 -0
  201. package/out/env.js +48 -0
  202. package/out/env.js.map +1 -0
  203. package/out/exact-match.d.ts +25 -0
  204. package/out/exact-match.d.ts.map +1 -0
  205. package/out/exact-match.js +88 -0
  206. package/out/exact-match.js.map +1 -0
  207. package/out/extracts.d.ts +114 -0
  208. package/out/extracts.d.ts.map +1 -0
  209. package/out/{sharding.js → extracts.js} +38 -38
  210. package/out/extracts.js.map +1 -0
  211. package/out/{fst-autocomplete.d.ts → fst/autocomplete.d.ts} +13 -13
  212. package/out/fst/autocomplete.d.ts.map +1 -0
  213. package/out/fst/autocomplete.js +113 -0
  214. package/out/fst/autocomplete.js.map +1 -0
  215. package/out/{fst-builder.d.ts → fst/builder.d.ts} +5 -5
  216. package/out/fst/builder.d.ts.map +1 -0
  217. package/out/{fst-builder.js → fst/builder.js} +24 -24
  218. package/out/fst/builder.js.map +1 -0
  219. package/out/{fst-deserialize-web.d.ts → fst/deserialize-web.d.ts} +3 -3
  220. package/out/fst/deserialize-web.d.ts.map +1 -0
  221. package/out/{fst-deserialize-web.js → fst/deserialize-web.js} +10 -74
  222. package/out/fst/deserialize-web.js.map +1 -0
  223. package/out/fst/format.d.ts +80 -0
  224. package/out/fst/format.d.ts.map +1 -0
  225. package/out/fst/format.js +91 -0
  226. package/out/fst/format.js.map +1 -0
  227. package/out/{fst-freshness.d.ts → fst/freshness.d.ts} +11 -14
  228. package/out/fst/freshness.d.ts.map +1 -0
  229. package/out/{fst-freshness.js → fst/freshness.js} +42 -74
  230. package/out/fst/freshness.js.map +1 -0
  231. package/out/fst/index.d.ts +14 -0
  232. package/out/fst/index.d.ts.map +1 -0
  233. package/out/fst/index.js +14 -0
  234. package/out/fst/index.js.map +1 -0
  235. package/out/{fst-matcher.d.ts → fst/matcher.d.ts} +2 -2
  236. package/out/fst/matcher.d.ts.map +1 -0
  237. package/out/{fst-matcher.js → fst/matcher.js} +1 -1
  238. package/out/fst/matcher.js.map +1 -0
  239. package/out/{fst-serialize.d.ts → fst/serialize.d.ts} +5 -10
  240. package/out/fst/serialize.d.ts.map +1 -0
  241. package/out/{fst-serialize.js → fst/serialize.js} +18 -98
  242. package/out/fst/serialize.js.map +1 -0
  243. package/out/{fst-types.d.ts → fst/types.d.ts} +4 -3
  244. package/out/fst/types.d.ts.map +1 -0
  245. package/out/{fst-types.js → fst/types.js} +1 -1
  246. package/out/fst/types.js.map +1 -0
  247. package/out/{fts.d.ts → fts/index.d.ts} +20 -13
  248. package/out/fts/index.d.ts.map +1 -0
  249. package/out/{fts.js → fts/index.js} +20 -15
  250. package/out/fts/index.js.map +1 -0
  251. package/out/{fts-query.d.ts → fts/query.d.ts} +2 -2
  252. package/out/fts/query.d.ts.map +1 -0
  253. package/out/{fts-query.js → fts/query.js} +2 -2
  254. package/out/fts/query.js.map +1 -0
  255. package/out/{geonames-aliases.d.ts → geonames/aliases.d.ts} +8 -6
  256. package/out/geonames/aliases.d.ts.map +1 -0
  257. package/out/{geonames-aliases.js → geonames/aliases.js} +7 -7
  258. package/out/geonames/aliases.js.map +1 -0
  259. package/out/geonames/index.d.ts +8 -0
  260. package/out/geonames/index.d.ts.map +1 -0
  261. package/out/geonames/index.js +8 -0
  262. package/out/geonames/index.js.map +1 -0
  263. package/out/{geonames-postal.d.ts → geonames/postal.d.ts} +12 -10
  264. package/out/geonames/postal.d.ts.map +1 -0
  265. package/out/{geonames-postal.js → geonames/postal.js} +11 -11
  266. package/out/geonames/postal.js.map +1 -0
  267. package/out/index.d.ts +32 -31
  268. package/out/index.d.ts.map +1 -1
  269. package/out/index.js +24 -24
  270. package/out/index.js.map +1 -1
  271. package/out/interpolation.d.ts +18 -9
  272. package/out/interpolation.d.ts.map +1 -1
  273. package/out/interpolation.js +108 -36
  274. package/out/interpolation.js.map +1 -1
  275. package/out/lookup.d.ts +25 -25
  276. package/out/lookup.d.ts.map +1 -1
  277. package/out/lookup.js +174 -558
  278. package/out/lookup.js.map +1 -1
  279. package/out/name-score.d.ts +0 -10
  280. package/out/name-score.d.ts.map +1 -1
  281. package/out/name-score.js +6 -4
  282. package/out/name-score.js.map +1 -1
  283. package/out/nsul/index.d.ts +8 -0
  284. package/out/nsul/index.d.ts.map +1 -0
  285. package/out/nsul/index.js +8 -0
  286. package/out/nsul/index.js.map +1 -0
  287. package/out/nsul/lookup.d.ts +83 -0
  288. package/out/nsul/lookup.d.ts.map +1 -0
  289. package/out/nsul/lookup.js +80 -0
  290. package/out/nsul/lookup.js.map +1 -0
  291. package/out/nsul/schema.d.ts +100 -0
  292. package/out/nsul/schema.d.ts.map +1 -0
  293. package/out/nsul/schema.js +78 -0
  294. package/out/nsul/schema.js.map +1 -0
  295. package/out/place-importance-schema.d.ts +47 -10
  296. package/out/place-importance-schema.d.ts.map +1 -1
  297. package/out/place-importance-schema.js +56 -10
  298. package/out/place-importance-schema.js.map +1 -1
  299. package/out/poi/index.d.ts +8 -0
  300. package/out/poi/index.d.ts.map +1 -0
  301. package/out/poi/index.js +8 -0
  302. package/out/poi/index.js.map +1 -0
  303. package/out/{poi-lookup.d.ts → poi/lookup.d.ts} +8 -10
  304. package/out/poi/lookup.d.ts.map +1 -0
  305. package/out/{poi-lookup.js → poi/lookup.js} +24 -29
  306. package/out/poi/lookup.js.map +1 -0
  307. package/out/{poi-schema.d.ts → poi/schema.d.ts} +10 -6
  308. package/out/poi/schema.d.ts.map +1 -0
  309. package/out/{poi-schema.js → poi/schema.js} +1 -1
  310. package/out/poi/schema.js.map +1 -0
  311. package/out/polygon-schema.d.ts +37 -0
  312. package/out/polygon-schema.d.ts.map +1 -0
  313. package/out/polygon-schema.js +23 -0
  314. package/out/polygon-schema.js.map +1 -0
  315. package/out/{postal-city-alias-lookup.d.ts → postal/city-alias-lookup.d.ts} +7 -6
  316. package/out/postal/city-alias-lookup.d.ts.map +1 -0
  317. package/out/{postal-city-alias-lookup.js → postal/city-alias-lookup.js} +12 -16
  318. package/out/postal/city-alias-lookup.js.map +1 -0
  319. package/out/{postal-city-alias-schema.d.ts → postal/city-alias-schema.d.ts} +1 -1
  320. package/out/{postal-city-alias-schema.d.ts.map → postal/city-alias-schema.d.ts.map} +1 -1
  321. package/out/{postal-city-alias-schema.js → postal/city-alias-schema.js} +1 -1
  322. package/out/{postal-city-alias-schema.js.map → postal/city-alias-schema.js.map} +1 -1
  323. package/out/{postal-city-candidate-schema.d.ts → postal/city-candidate-schema.d.ts} +4 -3
  324. package/out/postal/city-candidate-schema.d.ts.map +1 -0
  325. package/out/{postal-city-candidate-schema.js → postal/city-candidate-schema.js} +2 -2
  326. package/out/{postal-city-candidate-schema.js.map → postal/city-candidate-schema.js.map} +1 -1
  327. package/out/postal/index.d.ts +9 -0
  328. package/out/postal/index.d.ts.map +1 -0
  329. package/out/postal/index.js +9 -0
  330. package/out/postal/index.js.map +1 -0
  331. package/out/postcode-point-lookup.d.ts +10 -10
  332. package/out/postcode-point-lookup.d.ts.map +1 -1
  333. package/out/postcode-point-lookup.js +13 -13
  334. package/out/postcode-point-lookup.js.map +1 -1
  335. package/out/primary-preference.d.ts +133 -0
  336. package/out/primary-preference.d.ts.map +1 -0
  337. package/out/primary-preference.js +146 -0
  338. package/out/primary-preference.js.map +1 -0
  339. package/out/proximity-rerank.d.ts +77 -0
  340. package/out/proximity-rerank.d.ts.map +1 -0
  341. package/out/proximity-rerank.js +86 -0
  342. package/out/proximity-rerank.js.map +1 -0
  343. package/out/ranking-weights.d.ts +15 -3
  344. package/out/ranking-weights.d.ts.map +1 -1
  345. package/out/ranking-weights.js +21 -3
  346. package/out/ranking-weights.js.map +1 -1
  347. package/out/region-keys.d.ts +47 -0
  348. package/out/region-keys.d.ts.map +1 -0
  349. package/out/region-keys.js +121 -0
  350. package/out/region-keys.js.map +1 -0
  351. package/out/reverse.d.ts +6 -6
  352. package/out/reverse.d.ts.map +1 -1
  353. package/out/reverse.js +23 -35
  354. package/out/reverse.js.map +1 -1
  355. package/out/schema.d.ts +10 -1
  356. package/out/schema.d.ts.map +1 -1
  357. package/out/schema.js.map +1 -1
  358. package/out/search-fetch.d.ts +59 -0
  359. package/out/search-fetch.d.ts.map +1 -0
  360. package/out/search-fetch.js +184 -0
  361. package/out/search-fetch.js.map +1 -0
  362. package/out/sqlite-convention-source.d.ts +7 -7
  363. package/out/sqlite-convention-source.d.ts.map +1 -1
  364. package/out/sqlite-convention-source.js +5 -5
  365. package/out/sqlite-convention-source.js.map +1 -1
  366. package/out/sqlite-utils.d.ts +24 -6
  367. package/out/sqlite-utils.d.ts.map +1 -1
  368. package/out/sqlite-utils.js +24 -7
  369. package/out/sqlite-utils.js.map +1 -1
  370. package/out/{street-centroid-schema.d.ts → street/centroid-schema.d.ts} +12 -7
  371. package/out/street/centroid-schema.d.ts.map +1 -0
  372. package/out/{street-centroid-schema.js → street/centroid-schema.js} +5 -5
  373. package/out/{street-centroid-schema.js.map → street/centroid-schema.js.map} +1 -1
  374. package/out/{street-centroid.d.ts → street/centroid.d.ts} +6 -6
  375. package/out/street/centroid.d.ts.map +1 -0
  376. package/out/{street-centroid.js → street/centroid.js} +18 -24
  377. package/out/street/centroid.js.map +1 -0
  378. package/out/street/index.d.ts +13 -0
  379. package/out/street/index.d.ts.map +1 -0
  380. package/out/street/index.js +13 -0
  381. package/out/street/index.js.map +1 -0
  382. package/out/{street-morphology-fst-builder.d.ts → street/morphology-fst-builder.d.ts} +4 -4
  383. package/out/street/morphology-fst-builder.d.ts.map +1 -0
  384. package/out/{street-morphology-fst-builder.js → street/morphology-fst-builder.js} +18 -13
  385. package/out/street/morphology-fst-builder.js.map +1 -0
  386. package/out/{street-morphology-fst-loader.d.ts → street/morphology-fst-loader.d.ts} +5 -5
  387. package/out/street/morphology-fst-loader.d.ts.map +1 -0
  388. package/out/{street-morphology-fst-loader.js → street/morphology-fst-loader.js} +11 -10
  389. package/out/street/morphology-fst-loader.js.map +1 -0
  390. package/out/{street-name-lookup.d.ts → street/name-lookup.d.ts} +4 -7
  391. package/out/street/name-lookup.d.ts.map +1 -0
  392. package/out/{street-name-lookup.js → street/name-lookup.js} +9 -23
  393. package/out/street/name-lookup.js.map +1 -0
  394. package/out/street/normalize.d.ts +179 -0
  395. package/out/street/normalize.d.ts.map +1 -0
  396. package/out/street/normalize.js +457 -0
  397. package/out/street/normalize.js.map +1 -0
  398. package/out/{street-segment-schema.d.ts → street/segment-schema.d.ts} +13 -9
  399. package/out/street/segment-schema.d.ts.map +1 -0
  400. package/out/{street-segment-schema.js → street/segment-schema.js} +4 -4
  401. package/out/{street-segment-schema.js.map → street/segment-schema.js.map} +1 -1
  402. package/out/types.d.ts +49 -9
  403. package/out/types.d.ts.map +1 -1
  404. package/out/types.js.map +1 -1
  405. package/out/unified-schema.d.ts +6 -5
  406. package/out/unified-schema.d.ts.map +1 -1
  407. package/out/unified-schema.js +16 -19
  408. package/out/unified-schema.js.map +1 -1
  409. package/out/uprn/existence.d.ts +53 -0
  410. package/out/uprn/existence.d.ts.map +1 -0
  411. package/out/uprn/existence.js +61 -0
  412. package/out/uprn/existence.js.map +1 -0
  413. package/out/uprn/index.d.ts +9 -0
  414. package/out/uprn/index.d.ts.map +1 -0
  415. package/out/uprn/index.js +9 -0
  416. package/out/uprn/index.js.map +1 -0
  417. package/out/uprn/lookup.d.ts +85 -0
  418. package/out/uprn/lookup.d.ts.map +1 -0
  419. package/out/uprn/lookup.js +149 -0
  420. package/out/uprn/lookup.js.map +1 -0
  421. package/out/uprn/schema.d.ts +93 -0
  422. package/out/uprn/schema.d.ts.map +1 -0
  423. package/out/uprn/schema.js +78 -0
  424. package/out/uprn/schema.js.map +1 -0
  425. package/out/weights-overlay-linker.d.ts +299 -0
  426. package/out/weights-overlay-linker.d.ts.map +1 -0
  427. package/out/weights-overlay-linker.js +511 -0
  428. package/out/weights-overlay-linker.js.map +1 -0
  429. package/package.json +622 -154
  430. package/address-point.ts +0 -125
  431. package/candidate-lookup.ts +0 -720
  432. package/fst-autocomplete.ts +0 -204
  433. package/geo.ts +0 -121
  434. package/lookup.ts +0 -1354
  435. package/out/address-point-interpolation.d.ts.map +0 -1
  436. package/out/address-point-interpolation.js.map +0 -1
  437. package/out/address-point-schema.d.ts.map +0 -1
  438. package/out/address-point-schema.js.map +0 -1
  439. package/out/address-point.d.ts.map +0 -1
  440. package/out/address-point.js +0 -84
  441. package/out/address-point.js.map +0 -1
  442. package/out/ancestry-backfill.d.ts.map +0 -1
  443. package/out/ancestry-backfill.js.map +0 -1
  444. package/out/ancestry.d.ts.map +0 -1
  445. package/out/ancestry.js.map +0 -1
  446. package/out/convention.d.ts.map +0 -1
  447. package/out/convention.js.map +0 -1
  448. package/out/fst-autocomplete.d.ts.map +0 -1
  449. package/out/fst-autocomplete.js +0 -130
  450. package/out/fst-autocomplete.js.map +0 -1
  451. package/out/fst-builder.d.ts.map +0 -1
  452. package/out/fst-builder.js.map +0 -1
  453. package/out/fst-deserialize-web.d.ts.map +0 -1
  454. package/out/fst-deserialize-web.js.map +0 -1
  455. package/out/fst-freshness.d.ts.map +0 -1
  456. package/out/fst-freshness.js.map +0 -1
  457. package/out/fst-matcher.d.ts.map +0 -1
  458. package/out/fst-matcher.js.map +0 -1
  459. package/out/fst-serialize.d.ts.map +0 -1
  460. package/out/fst-serialize.js.map +0 -1
  461. package/out/fst-types.d.ts.map +0 -1
  462. package/out/fst-types.js.map +0 -1
  463. package/out/fts-query.d.ts.map +0 -1
  464. package/out/fts-query.js.map +0 -1
  465. package/out/fts.d.ts.map +0 -1
  466. package/out/fts.js.map +0 -1
  467. package/out/geo.d.ts +0 -74
  468. package/out/geo.d.ts.map +0 -1
  469. package/out/geo.js +0 -71
  470. package/out/geo.js.map +0 -1
  471. package/out/geonames-aliases.d.ts.map +0 -1
  472. package/out/geonames-aliases.js.map +0 -1
  473. package/out/geonames-postal.d.ts.map +0 -1
  474. package/out/geonames-postal.js.map +0 -1
  475. package/out/poi-lookup.d.ts.map +0 -1
  476. package/out/poi-lookup.js.map +0 -1
  477. package/out/poi-schema.d.ts.map +0 -1
  478. package/out/poi-schema.js.map +0 -1
  479. package/out/postal-city-alias-lookup.d.ts.map +0 -1
  480. package/out/postal-city-alias-lookup.js.map +0 -1
  481. package/out/postal-city-candidate-schema.d.ts.map +0 -1
  482. package/out/sharding.d.ts +0 -114
  483. package/out/sharding.d.ts.map +0 -1
  484. package/out/sharding.js.map +0 -1
  485. package/out/street-centroid-schema.d.ts.map +0 -1
  486. package/out/street-centroid.d.ts.map +0 -1
  487. package/out/street-centroid.js.map +0 -1
  488. package/out/street-morphology-fst-builder.d.ts.map +0 -1
  489. package/out/street-morphology-fst-builder.js.map +0 -1
  490. package/out/street-morphology-fst-loader.d.ts.map +0 -1
  491. package/out/street-morphology-fst-loader.js.map +0 -1
  492. package/out/street-name-lookup.d.ts.map +0 -1
  493. package/out/street-name-lookup.js.map +0 -1
  494. package/out/street-normalize.d.ts +0 -95
  495. package/out/street-normalize.d.ts.map +0 -1
  496. package/out/street-normalize.js +0 -272
  497. package/out/street-normalize.js.map +0 -1
  498. package/out/street-segment-schema.d.ts.map +0 -1
  499. package/sqlite-utils.ts +0 -46
  500. package/street-normalize.ts +0 -318
  501. /package/{postal-city-alias-schema.ts → lib/postal/city-alias-schema.ts} +0 -0
@@ -8,7 +8,7 @@
8
8
  * then linear interpolation along the segment polyline. Design:
9
9
  * `docs/articles/plan/2026-06-11-interpolation-design.md`.
10
10
  *
11
- * Reads the per-state shard built by `scripts/build-interpolation-shard.ts` (`street_segment`: one
11
+ * Reads the per-state extract built by `scripts/build-interpolation-extract.ts` (`street_segment`: one
12
12
  * row per TIGER edge SIDE — independent left/right ranges, ZIPs, parity). Query-side
13
13
  * normalization is THE shared normalizer (`street-normalize.ts`) — identical to build-side, by
14
14
  * construction.
@@ -25,43 +25,92 @@
25
25
  * exact-point fall-through) is a noted follow-up on #483, so the `find()` shape mirrors
26
26
  * `AddressPointLookup.find()` to keep that wiring mechanical.
27
27
  */
28
- import { DatabaseSync } from "node:sqlite";
29
- import { parseJSONStrict } from "@mailwoman/core/objects";
30
- import { clampFraction, pointAlong } from "@mailwoman/spatial";
31
- import { haversineKm } from "./geo.js";
32
- import { hasTable } from "./sqlite-utils.js";
33
- import { canonicalizeRouteKey, normalizeStreetForKey } from "./street-normalize.js";
28
+ import { parseJSONStrict } from "@mailwoman/core/json";
29
+ import { clampFraction, haversineKm, pointAlong } from "@mailwoman/spatial";
30
+ import { DatabaseClient } from "@mailwoman/sqlite/client";
31
+ import { hasTable, prepareAll } from "#sqlite-utils";
32
+ import { canonicalizeRouteKey, streetKeyVariants } from "#street/normalize";
33
+ /**
34
+ * Acceptance geometry for the `near` tie-break: the winning postcode group's closest segment must sit within this many
35
+ * kilometres of `near`, AND the runner-up group must be at least {@link NEAR_DOMINANCE} times farther. Both measured on
36
+ * the two live failures: Brooklyn's `st pauls place` 11226 segment is ~2 km from the Brooklyn centroid with Great
37
+ * Neck's 11021 at ~24 km (12×); Fraser's `east 13 mile road` 48026 is ~2 km with Mecosta's namesake ~190 km away. A
38
+ * near-tie between groups is genuine ambiguity and stays an abstention.
39
+ */
40
+ const NEAR_MAX_KM = 25;
41
+ /**
42
+ * See {@link NEAR_MAX_KM}.
43
+ */
44
+ const NEAR_DOMINANCE = 2;
45
+ /**
46
+ * The postcode group nearest `near`, under the {@link NEAR_MAX_KM} dominance geometry — or null when no group qualifies
47
+ * (out of range, or the runner-up is too close to call). A group's distance is its closest segment's first polyline
48
+ * vertex; a segment whose geometry fails to parse prices as unreachable rather than aborting the tie-break.
49
+ */
50
+ function nearestPostcodeGroup(pool, near) {
51
+ const groups = new Map();
52
+ for (const row of pool) {
53
+ const key = row.postcode ?? "";
54
+ let km = Number.POSITIVE_INFINITY;
55
+ try {
56
+ const [firstVertex] = parseJSONStrict(row.geometry);
57
+ if (firstVertex) {
58
+ km = haversineKm(near.lat, near.lon, firstVertex[1], firstVertex[0]);
59
+ }
60
+ }
61
+ catch {
62
+ // Unparseable geometry: this row cannot be sited, so it cannot win the tie-break.
63
+ }
64
+ const group = groups.get(key);
65
+ if (group) {
66
+ group.rows.push(row);
67
+ group.km = Math.min(group.km, km);
68
+ }
69
+ else {
70
+ groups.set(key, { rows: [row], km });
71
+ }
72
+ }
73
+ const ranked = [...groups.values()].toSorted((a, b) => a.km - b.km);
74
+ const [winner, runnerUp] = ranked;
75
+ if (!winner || winner.km > NEAR_MAX_KM)
76
+ return null;
77
+ if (runnerUp && runnerUp.km < winner.km * NEAR_DOMINANCE)
78
+ return null;
79
+ return winner.rows;
80
+ }
34
81
  export class StreetInterpolator {
35
82
  #db;
36
- #ownsDB;
83
+ /**
84
+ * Resources this instance opened. A connection handed in by a caller is NOT in here, so disposal cannot reach it —
85
+ * ownership is membership rather than a flag a later branch has to check.
86
+ */
87
+ #resources = new DisposableStack();
37
88
  #byPostcode;
38
89
  #byStreet;
39
90
  #radiusCalibration;
40
91
  constructor(opts) {
41
92
  if (opts.database) {
42
93
  this.#db = opts.database;
43
- this.#ownsDB = false;
44
94
  }
45
95
  else if (opts.dbPath) {
46
- this.#db = new DatabaseSync(opts.dbPath, { readOnly: true });
47
- this.#ownsDB = true;
96
+ this.#db = this.#resources.use(new DatabaseClient(opts.dbPath, { readOnly: true }));
48
97
  }
49
98
  else {
50
99
  throw new Error("StreetInterpolator: one of dbPath or database is required");
51
100
  }
52
- // Degrade gracefully on an empty/tableless shard (interrupted build, stray 0-byte file): with no
101
+ // Degrade gracefully on an empty/tableless extract (interrupted build, stray 0-byte file): with no
53
102
  // `street_segment` table this interpolator is a no-op miss, not a crash that loses the state (#568).
54
103
  if (hasTable(this.#db, "street_segment")) {
55
104
  const columns = `from_hn, to_hn, min_hn, max_hn, parity, postcode, geometry, source, release`;
56
- this.#byPostcode = this.#db.prepare(`SELECT ${columns} FROM street_segment
105
+ this.#byPostcode = prepareAll(this.#db, `SELECT ${columns} FROM street_segment
57
106
  WHERE postcode = ? AND street_norm = ? AND min_hn <= ? AND max_hn >= ?`);
58
- this.#byStreet = this.#db.prepare(`SELECT ${columns} FROM street_segment
107
+ this.#byStreet = prepareAll(this.#db, `SELECT ${columns} FROM street_segment
59
108
  WHERE street_norm = ? AND min_hn <= ? AND max_hn >= ?`);
60
109
  }
61
110
  // #374 doctrine: the conformal radius multiplier is a property of the calibration set the ARTIFACT was
62
- // built against, so it ships in the shard's `interp_calibration` metadata table (street-segment-schema.ts)
111
+ // built against, so it ships in the extract's `interp_calibration` metadata table (street-segment-schema.ts)
63
112
  // and is read here, once, at open time — sync raw `.prepare()` per the sync-by-interface doctrine
64
- // (AGENTS.md). Shards predating the table (the pre-2026-07 fleet) yield `undefined`; callers then fall
113
+ // (AGENTS.md). Extracts predating the table (the pre-2026-07 fleet) yield `undefined`; callers then fall
65
114
  // back to their in-code table, byte-identically.
66
115
  if (hasTable(this.#db, "interp_calibration")) {
67
116
  const row = this.#db.prepare("SELECT radius_multiplier FROM interp_calibration LIMIT 1").get();
@@ -72,9 +121,9 @@ export class StreetInterpolator {
72
121
  }
73
122
  }
74
123
  /**
75
- * The artifact's own conformal radius multiplier (#374), read from the shard's `interp_calibration` metadata table at
76
- * construction. `undefined` = the shard predates the table (or carries no valid row) — the resolver then applies no
77
- * artifact default and callers may supply a legacy fallback.
124
+ * The artifact's own conformal radius multiplier (#374), read from the extract's `interp_calibration` metadata table
125
+ * at construction. `undefined` = the extract predates the table (or carries no valid row) — the resolver then applies
126
+ * no artifact default and callers may supply a legacy fallback.
78
127
  */
79
128
  get radiusCalibration() {
80
129
  return this.#radiusCalibration;
@@ -82,27 +131,36 @@ export class StreetInterpolator {
82
131
  find(query) {
83
132
  if (!this.#byPostcode || !this.#byStreet)
84
133
  return null;
85
- const streetNorm = canonicalizeRouteKey(normalizeStreetForKey(query.street));
86
134
  const numberRaw = query.number.trim();
87
135
  // Strictly-numeric house numbers only — this tier estimates, it doesn't guess at
88
136
  // hyphenated/alphanumeric schemes the ranges don't model.
89
- if (!streetNorm || !/^\d+$/.test(numberRaw))
137
+ if (!/^\d+$/.test(numberRaw))
90
138
  return null;
91
139
  const n = Number(numberRaw);
92
- let rows;
93
- if (query.postcode) {
140
+ // Key-variant ladder (see `streetKeyVariants`): the literal key first, then the doubled-type
141
+ // collapse and the saint↔st register swap. A variant advances the ladder when it produces no
142
+ // ANSWER, not merely no rows — a wrong-register key can cover the number in far-away towns and
143
+ // then fail the ambiguity check ("saint pauls place" reaches Nassau's rows; the Brooklyn answer
144
+ // lives under "st pauls place"), and stopping at rows would eclipse the right variant.
145
+ for (const variant of streetKeyVariants(query.street)) {
146
+ const streetNorm = canonicalizeRouteKey(variant);
94
147
  // A given ZIP that scopes to nothing is a MISS, not a statewide guess: the retry was
95
148
  // measured (2026-06-11 VT eval) at +2.3pp coverage for a poisoned tail (p99 1.0 → 20.8
96
149
  // km, max 204 km — a unique name statewide can live in a far-away town).
97
- rows = this.#byPostcode.all(query.postcode.trim(), streetNorm, n, n);
98
- }
99
- else {
100
- // No scope given: a name matching ranges across several ZIPs is ambiguous — abstain.
101
- rows = this.#byStreet.all(streetNorm, n, n);
102
- const postcodes = new Set(rows.map((r) => r.postcode ?? ""));
103
- if (postcodes.size > 1)
104
- return null;
150
+ const rows = query.postcode
151
+ ? this.#byPostcode(query.postcode.trim(), streetNorm, n, n)
152
+ : this.#byStreet(streetNorm, n, n);
153
+ const hit = this.#answerFromRows(rows, n, query);
154
+ if (hit)
155
+ return hit;
105
156
  }
157
+ return null;
158
+ }
159
+ /**
160
+ * Resolve one key variant's covering rows to an answer, or null when they cannot honestly give one — the
161
+ * parity/ambiguity/tightest-range pipeline the module doc describes.
162
+ */
163
+ #answerFromRows(rows, n, query) {
106
164
  if (!rows.length)
107
165
  return null;
108
166
  // Parity preference: exact side first, then 'mixed' (matches either), then the
@@ -111,8 +169,24 @@ export class StreetInterpolator {
111
169
  const exact = rows.filter((r) => r.parity === (wantOdd ? "odd" : "even"));
112
170
  const mixed = rows.filter((r) => r.parity === "mixed");
113
171
  const preferred = exact.length ? exact : mixed;
114
- const pool = preferred.length ? preferred : rows;
172
+ let pool = preferred.length ? preferred : rows;
115
173
  const parityMatched = preferred.length > 0;
174
+ // No scope given: the covering ranges must agree on ONE postcode or the lookup abstains — a
175
+ // name spanning towns is ambiguity, not an answer. Counted over the PARITY pool, not all
176
+ // rows: a section-line boundary road carries a different ZIP per side ("east 13 mile road"
177
+ // is Fraser 48026 odd / Roseville 48066 even), and the opposite side can never hold the
178
+ // number it would otherwise veto. When several postcodes survive parity, the caller's
179
+ // resolved-locality coordinate breaks the tie by segment proximity under the dominance
180
+ // geometry of {@link NEAR_MAX_KM} — a near-tie stays an abstention.
181
+ if (!query.postcode) {
182
+ const postcodes = new Set(pool.map((r) => r.postcode ?? ""));
183
+ if (postcodes.size > 1) {
184
+ const scoped = query.near ? nearestPostcodeGroup(pool, query.near) : null;
185
+ if (!scoped)
186
+ return null;
187
+ pool = scoped;
188
+ }
189
+ }
116
190
  // Tightest range wins — the most specific claim about where this number lives.
117
191
  let best = pool[0];
118
192
  for (const candidate of pool) {
@@ -135,10 +209,8 @@ export class StreetInterpolator {
135
209
  release: best.release,
136
210
  };
137
211
  }
138
- close() {
139
- if (this.#ownsDB) {
140
- this.#db.close();
141
- }
212
+ [Symbol.dispose]() {
213
+ this.#resources[Symbol.dispose]();
142
214
  }
143
215
  }
144
216
  //# sourceMappingURL=interpolation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"interpolation.js","sourceRoot":"","sources":["../interpolation.ts"],"names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,CAAC,CAAA;QACnE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,CAAA;QACtC,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAAA;QACrE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;QAEpD,OAAO;YACN,GAAG;YACH,GAAG;YACH,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,aAAa;YACrB,aAAa;YACb,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/C,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAA;IACF,CAAC;IAED,CAAC,MAAM,CAAC,OAAO,CAAC;QACf,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAA;IAClC,CAAC;CACD"}
package/out/lookup.d.ts CHANGED
@@ -3,48 +3,49 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * `WOFSqlitePlaceLookup` — the resolver implementation backed by `node:sqlite` + a Kysely-typed
6
+ * `WOFSQLitePlaceLookup` — the resolver implementation backed by `node:sqlite` + a Kysely-typed
7
7
  * query layer where the queries are non-trivial, and raw SQL where they aren't (FTS5 MATCH, the
8
8
  * FTS index build).
9
9
  *
10
10
  * See `docs/plan/phases/PHASE_4_2_wof_sqlite.md` for the design rationale.
11
11
  */
12
- import { DatabaseSync } from "node:sqlite";
13
12
  import { type Ancestor, type CoincidentLocality } from "@mailwoman/resolver";
14
- import { type Convention, type ConventionSource } from "./convention.ts";
15
- import type { WOFPostalCityAliasLookup } from "./postal-city-alias-lookup.ts";
16
- import { type RankingWeights } from "./ranking-weights.ts";
17
- import { type ShardConfig } from "./sharding.ts";
18
- import type { FindPlaceQuery, PlaceCandidate, PlaceLookup } from "./types.ts";
19
- export interface WOFSqlitePlaceLookupOpts {
13
+ import { DatabaseClient } from "@mailwoman/sqlite/client";
14
+ import { type Convention, type ConventionSource } from "#convention/index";
15
+ import { type ExtractConfig } from "#extracts";
16
+ import type { WOFPostalCityAliasLookup } from "#postal/city-alias-lookup";
17
+ import { type RankingWeights } from "#ranking-weights";
18
+ import type { WOFDatabase } from "#schema";
19
+ import type { FindPlaceQuery, PlaceCandidate, PlaceLookup } from "#types";
20
+ export interface WOFSQLitePlaceLookupOpts {
20
21
  /**
21
22
  * Path to the WOF SQLite distribution on disk. Mutually exclusive with `database`.
22
23
  *
23
- * **Single string** — opens that one DB as the main shard.
24
+ * **Single string** — opens that one DB as the main extract.
24
25
  *
25
26
  * **Array** — opens the first entry as main, then ATTACHes each subsequent entry as a separate SQLite schema. Schema
26
27
  * names are derived from the filename (`whosonfirst-data-postalcode- us-latest.db` → `postalcode_us`); override with
27
- * `ShardConfig.schemaName` when the filename doesn't follow WOF convention. See `sharding.ts` for the derivation
28
+ * `ExtractConfig.schemaName` when the filename doesn't follow WOF convention. See `extracts.ts` for the derivation
28
29
  * rules.
29
30
  *
30
- * Routing: queries with a `placetype` matching a shard's name (or explicit `placetypes` hint) are sent to that shard;
31
- * everything else hits main. Cross-shard UNION is NOT done — BM25 isn't comparable across separately-indexed
32
- * corpora.
31
+ * Routing: queries with a `placetype` matching a extract's name (or explicit `placetypes` hint) are sent to that
32
+ * extract; everything else hits main. Cross-extract UNION is NOT done — BM25 isn't comparable across
33
+ * separately-indexed corpora.
33
34
  */
34
- databasePath?: string | ReadonlyArray<string | ShardConfig>;
35
+ databasePath?: string | ReadonlyArray<string | ExtractConfig>;
35
36
  /**
36
- * Pre-opened DatabaseSync — primarily for tests against an inline fixture DB. Mutually exclusive with `databasePath`.
37
- * Multi-shard requires `databasePath` (so the lookup owns the ATTACH).
37
+ * Pre-opened connection — primarily for tests against an inline fixture DB. Mutually exclusive with `databasePath`.
38
+ * Multi-extract requires `databasePath` (so the lookup owns the ATTACH).
38
39
  */
39
- database?: DatabaseSync;
40
+ database?: DatabaseClient<WOFDatabase>;
40
41
  /**
41
42
  * If true, build the FTS5 `place_search` virtual table on construction if it doesn't already exist. The upstream WOF
42
43
  * distribution does NOT ship FTS5, so callers either set this once on first open or pre-build it via the
43
44
  * operator-side CLI documented in the README. Default false — the resolver assumes the index already exists and
44
45
  * errors loudly if it doesn't.
45
46
  *
46
- * With multi-shard, `buildFTS: true` builds the index on the **main** shard only. Other shards must be pre-built via
47
- * `mailwoman gazetteer build fts` — operator script for predictable cost.
47
+ * With multi-extract, `buildFTS: true` builds the index on the **main** extract only. Other extracts must be
48
+ * pre-built via `mailwoman gazetteer build fts` — operator script for predictable cost.
48
49
  */
49
50
  buildFTS?: boolean;
50
51
  /**
@@ -58,13 +59,14 @@ export interface WOFSqlitePlaceLookupOpts {
58
59
  * Opt-in postal-city alias reader (#475). When supplied, the coordinate-first locality scorer treats an observed
59
60
  * `postal_city` ("Antioch", postcode 37013) as a name-match alias for the geographic locality the postcode sits in
60
61
  * ("Nashville"), recovering the chronic postal-vs- geographic-city mismatch. Absent (the default), the resolver is
61
- * byte-identical — every alias code path is gated on this being non-null, so an unprovided reader changes no score.
62
+ * byte-identical — every alias code path is conditioned on this being non-null, so an unprovided reader changes no
63
+ * score.
62
64
  */
63
65
  postalCityAliases?: WOFPostalCityAliasLookup;
64
66
  }
65
- export declare class WOFSqlitePlaceLookup implements PlaceLookup, Disposable {
67
+ export declare class WOFSQLitePlaceLookup implements PlaceLookup, Disposable {
66
68
  #private;
67
- constructor(opts: WOFSqlitePlaceLookupOpts, weights?: Partial<RankingWeights>);
69
+ constructor(opts: WOFSQLitePlaceLookupOpts, weights?: Partial<RankingWeights>);
68
70
  findPlace(query: FindPlaceQuery): Promise<PlaceCandidate[]>;
69
71
  /**
70
72
  * Dual-role localities coincident with an admin id, from the precomputed `coincident_roles` relation (#403). Backs
@@ -83,9 +85,7 @@ export declare class WOFSqlitePlaceLookup implements PlaceLookup, Disposable {
83
85
  * locality/neighbourhood ancestors order correctly instead of sorting last.
84
86
  */
85
87
  ancestors(id: number | string): Ancestor[];
86
- close(): void;
87
88
  [Symbol.dispose](): void;
88
89
  }
89
- export { trigramJaccard, trigrams } from "./name-score.ts";
90
- export type { RankingWeights } from "./ranking-weights.ts";
90
+ export type { RankingWeights } from "#ranking-weights";
91
91
  //# sourceMappingURL=lookup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lookup.d.ts","sourceRoot":"","sources":["../lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAsB,MAAM,aAAa,CAAA;AAG9D,OAAO,EAAyB,KAAK,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAKnG,OAAO,EAIN,KAAK,UAAU,EACf,KAAK,gBAAgB,EAGrB,MAAM,iBAAiB,CAAA;AAcxB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE3E,OAAO,EAKN,KAAK,WAAW,EAChB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAA;AAS3F,MAAM,WAAW,wBAAwB;IACxC;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,GAAG,WAAW,CAAC,CAAA;IAC3D;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;OAKG;IACH,WAAW,CAAC,EA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