@mailwoman/resolver-wof-sqlite 9.4.0 → 10.1.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 (548) hide show
  1. package/README.md +8 -8
  2. package/lib/address/{point-interpolation.ts → point/interpolation.ts} +40 -38
  3. package/lib/address/point/schema.ts +132 -0
  4. package/lib/address/point.ts +68 -81
  5. package/lib/{address/index.ts → address.ts} +2 -2
  6. package/lib/ancestry/backfill.ts +24 -88
  7. package/lib/{ancestry/index.ts → ancestry.ts} +19 -15
  8. package/lib/build/candidate.ts +608 -0
  9. package/lib/build/population-corrections.ts +64 -0
  10. package/lib/build/slim.ts +338 -0
  11. package/lib/candidate/alias-bags.ts +74 -14
  12. package/lib/candidate/ancestors/schema.ts +211 -0
  13. package/lib/candidate/{ancestors-sidecar.ts → ancestors/sidecar.ts} +17 -24
  14. package/lib/candidate/country-display-names.ts +6 -20
  15. package/lib/candidate/extract-fold.ts +12 -57
  16. package/lib/candidate/fts.ts +28 -0
  17. package/lib/candidate/importance.ts +221 -0
  18. package/lib/candidate/lookup.ts +669 -0
  19. package/lib/candidate/name-roles.ts +16 -34
  20. package/lib/candidate/own-name.ts +34 -31
  21. package/lib/candidate/place-attrs.ts +20 -13
  22. package/lib/candidate/schema.ts +211 -0
  23. package/lib/candidate/scoring.ts +222 -0
  24. package/lib/capital-schema.ts +21 -17
  25. package/lib/capitals.ts +26 -24
  26. package/lib/coincident-roles.ts +74 -55
  27. package/lib/convention/schema.ts +13 -7
  28. package/lib/convention.ts +144 -0
  29. package/lib/coverage-manifest-schema.ts +34 -39
  30. package/lib/currency-backfill.ts +24 -69
  31. package/lib/env.ts +1 -1
  32. package/lib/exact-match.ts +31 -20
  33. package/lib/extracts.ts +96 -73
  34. package/lib/fst/autocomplete.ts +52 -35
  35. package/lib/fst/builder.ts +30 -36
  36. package/lib/fst/deserialize-web.ts +8 -9
  37. package/lib/fst/format.ts +41 -23
  38. package/lib/fst/freshness.ts +17 -95
  39. package/lib/fst/matcher.ts +2 -2
  40. package/lib/fst/serialize.ts +45 -60
  41. package/lib/fst/types.ts +71 -59
  42. package/lib/fts/query.ts +5 -36
  43. package/lib/fts.ts +280 -0
  44. package/lib/geonames/aliases.ts +72 -149
  45. package/lib/geonames/postal.ts +162 -77
  46. package/lib/index.ts +20 -27
  47. package/lib/interpolation.ts +43 -96
  48. package/lib/lookup.ts +137 -257
  49. package/lib/name-score.ts +9 -7
  50. package/lib/nsul/lookup.ts +36 -53
  51. package/lib/nsul/schema.ts +16 -43
  52. package/lib/paths.ts +159 -0
  53. package/lib/place-importance-schema.ts +57 -164
  54. package/lib/poi/lookup.ts +100 -109
  55. package/lib/poi/schema.ts +42 -26
  56. package/lib/polygon-schema.ts +10 -6
  57. package/lib/postal/city/alias/lookup.ts +79 -0
  58. package/lib/postal/{city-alias-schema.ts → city/alias/schema.ts} +14 -10
  59. package/lib/postal/{city-candidate-schema.ts → city/candidate-schema.ts} +26 -20
  60. package/lib/postal.ts +9 -0
  61. package/lib/postcode-point-lookup.ts +9 -19
  62. package/lib/primary-preference.ts +45 -125
  63. package/lib/proximity-rerank.ts +43 -32
  64. package/lib/ranking-weights.ts +98 -76
  65. package/lib/region-keys.ts +68 -40
  66. package/lib/reverse.ts +108 -72
  67. package/lib/schema.ts +74 -42
  68. package/lib/search-fetch.ts +90 -68
  69. package/lib/sqlite/convention-source.ts +57 -0
  70. package/lib/sqlite/utils.ts +79 -0
  71. package/lib/street/centroid/schema.ts +149 -0
  72. package/lib/street/centroid.ts +16 -25
  73. package/lib/street/{morphology-fst-builder.ts → morphology/fst/builder.ts} +56 -41
  74. package/lib/street/{morphology-fst-loader.ts → morphology/fst/loader.ts} +36 -29
  75. package/lib/street/name-lookup.ts +43 -35
  76. package/lib/street/normalize.ts +85 -216
  77. package/lib/street/segment-schema.ts +116 -43
  78. package/lib/{street/index.ts → street.ts} +3 -3
  79. package/lib/types.ts +94 -140
  80. package/lib/unified-schema.ts +29 -29
  81. package/lib/uprn/existence.ts +30 -19
  82. package/lib/uprn/lookup.ts +28 -67
  83. package/lib/uprn/schema.ts +18 -40
  84. package/lib/weights-overlay-linker.ts +204 -232
  85. package/out/address/point/interpolation.d.ts +45 -0
  86. package/out/address/point/interpolation.d.ts.map +1 -0
  87. package/out/address/{point-interpolation.js → point/interpolation.js} +38 -38
  88. package/out/address/point/interpolation.js.map +1 -0
  89. package/out/address/point/schema.d.ts +74 -0
  90. package/out/address/point/schema.d.ts.map +1 -0
  91. package/out/address/{point-schema.js → point/schema.js} +4 -20
  92. package/out/address/point/schema.js.map +1 -0
  93. package/out/address/point.d.ts +24 -21
  94. package/out/address/point.d.ts.map +1 -1
  95. package/out/address/point.js +60 -77
  96. package/out/address/point.js.map +1 -1
  97. package/out/{address/index.js → address.d.ts} +3 -3
  98. package/out/address.d.ts.map +1 -0
  99. package/out/{address/index.d.ts → address.js} +3 -3
  100. package/out/address.js.map +1 -0
  101. package/out/ancestry/backfill.d.ts +11 -64
  102. package/out/ancestry/backfill.d.ts.map +1 -1
  103. package/out/ancestry/backfill.js +18 -76
  104. package/out/ancestry/backfill.js.map +1 -1
  105. package/out/ancestry.d.ts +49 -0
  106. package/out/ancestry.d.ts.map +1 -0
  107. package/out/ancestry.js +59 -0
  108. package/out/ancestry.js.map +1 -0
  109. package/out/build/candidate.d.ts +170 -0
  110. package/out/build/candidate.d.ts.map +1 -0
  111. package/out/{build-candidate.js → build/candidate.js} +33 -102
  112. package/out/build/candidate.js.map +1 -0
  113. package/out/build/population-corrections.d.ts +52 -0
  114. package/out/build/population-corrections.d.ts.map +1 -0
  115. package/out/build/population-corrections.js +40 -0
  116. package/out/build/population-corrections.js.map +1 -0
  117. package/out/build/slim.d.ts +44 -0
  118. package/out/build/slim.d.ts.map +1 -0
  119. package/out/{build-slim.js → build/slim.js} +33 -94
  120. package/out/build/slim.js.map +1 -0
  121. package/out/candidate/alias-bags.d.ts +13 -5
  122. package/out/candidate/alias-bags.d.ts.map +1 -1
  123. package/out/candidate/alias-bags.js +55 -12
  124. package/out/candidate/alias-bags.js.map +1 -1
  125. package/out/candidate/ancestors/schema.d.ts +166 -0
  126. package/out/candidate/ancestors/schema.d.ts.map +1 -0
  127. package/out/candidate/ancestors/schema.js +131 -0
  128. package/out/candidate/ancestors/schema.js.map +1 -0
  129. package/out/candidate/ancestors/sidecar.d.ts +27 -0
  130. package/out/candidate/ancestors/sidecar.d.ts.map +1 -0
  131. package/out/candidate/{ancestors-sidecar.js → ancestors/sidecar.js} +17 -24
  132. package/out/candidate/ancestors/sidecar.js.map +1 -0
  133. package/out/candidate/country-display-names.d.ts +5 -15
  134. package/out/candidate/country-display-names.d.ts.map +1 -1
  135. package/out/candidate/country-display-names.js +6 -20
  136. package/out/candidate/country-display-names.js.map +1 -1
  137. package/out/candidate/extract-fold.d.ts +8 -16
  138. package/out/candidate/extract-fold.d.ts.map +1 -1
  139. package/out/candidate/extract-fold.js +6 -48
  140. package/out/candidate/extract-fold.js.map +1 -1
  141. package/out/candidate/fts.d.ts +19 -0
  142. package/out/candidate/fts.d.ts.map +1 -0
  143. package/out/candidate/fts.js +22 -0
  144. package/out/candidate/fts.js.map +1 -0
  145. package/out/candidate/importance.d.ts +127 -0
  146. package/out/candidate/importance.d.ts.map +1 -0
  147. package/out/candidate/importance.js +162 -0
  148. package/out/candidate/importance.js.map +1 -0
  149. package/out/candidate/lookup.d.ts +36 -0
  150. package/out/candidate/lookup.d.ts.map +1 -0
  151. package/out/candidate/lookup.js +456 -0
  152. package/out/candidate/lookup.js.map +1 -0
  153. package/out/candidate/name-roles.d.ts +10 -22
  154. package/out/candidate/name-roles.d.ts.map +1 -1
  155. package/out/candidate/name-roles.js +15 -33
  156. package/out/candidate/name-roles.js.map +1 -1
  157. package/out/candidate/own-name.d.ts +23 -25
  158. package/out/candidate/own-name.d.ts.map +1 -1
  159. package/out/candidate/own-name.js +34 -31
  160. package/out/candidate/own-name.js.map +1 -1
  161. package/out/candidate/place-attrs.d.ts +20 -13
  162. package/out/candidate/place-attrs.d.ts.map +1 -1
  163. package/out/candidate/place-attrs.js +4 -5
  164. package/out/candidate/place-attrs.js.map +1 -1
  165. package/out/candidate/schema.d.ts +120 -0
  166. package/out/candidate/schema.d.ts.map +1 -0
  167. package/out/{candidate-schema.js → candidate/schema.js} +11 -23
  168. package/out/candidate/schema.js.map +1 -0
  169. package/out/{candidate-scoring.d.ts → candidate/scoring.d.ts} +8 -9
  170. package/out/candidate/scoring.d.ts.map +1 -0
  171. package/out/candidate/scoring.js +157 -0
  172. package/out/candidate/scoring.js.map +1 -0
  173. package/out/capital-schema.d.ts +21 -17
  174. package/out/capital-schema.d.ts.map +1 -1
  175. package/out/capital-schema.js +17 -15
  176. package/out/capital-schema.js.map +1 -1
  177. package/out/capitals.d.ts +26 -24
  178. package/out/capitals.d.ts.map +1 -1
  179. package/out/capitals.js +23 -21
  180. package/out/capitals.js.map +1 -1
  181. package/out/coincident-roles.d.ts +60 -43
  182. package/out/coincident-roles.d.ts.map +1 -1
  183. package/out/coincident-roles.js +61 -50
  184. package/out/coincident-roles.js.map +1 -1
  185. package/out/convention/schema.d.ts +12 -6
  186. package/out/convention/schema.d.ts.map +1 -1
  187. package/out/convention/schema.js +6 -4
  188. package/out/convention/schema.js.map +1 -1
  189. package/out/convention.d.ts +97 -0
  190. package/out/convention.d.ts.map +1 -0
  191. package/out/convention.js +81 -0
  192. package/out/convention.js.map +1 -0
  193. package/out/coverage-manifest-schema.d.ts +33 -38
  194. package/out/coverage-manifest-schema.d.ts.map +1 -1
  195. package/out/coverage-manifest-schema.js +20 -29
  196. package/out/coverage-manifest-schema.js.map +1 -1
  197. package/out/currency-backfill.d.ts +13 -35
  198. package/out/currency-backfill.d.ts.map +1 -1
  199. package/out/currency-backfill.js +12 -39
  200. package/out/currency-backfill.js.map +1 -1
  201. package/out/env.d.ts +2 -2
  202. package/out/env.js +1 -1
  203. package/out/exact-match.d.ts +19 -10
  204. package/out/exact-match.d.ts.map +1 -1
  205. package/out/exact-match.js +31 -20
  206. package/out/exact-match.js.map +1 -1
  207. package/out/extracts.d.ts +65 -54
  208. package/out/extracts.d.ts.map +1 -1
  209. package/out/extracts.js +63 -55
  210. package/out/extracts.js.map +1 -1
  211. package/out/fst/autocomplete.d.ts +28 -20
  212. package/out/fst/autocomplete.d.ts.map +1 -1
  213. package/out/fst/autocomplete.js +38 -27
  214. package/out/fst/autocomplete.js.map +1 -1
  215. package/out/fst/builder.d.ts.map +1 -1
  216. package/out/fst/builder.js +30 -36
  217. package/out/fst/builder.js.map +1 -1
  218. package/out/fst/deserialize-web.d.ts +3 -3
  219. package/out/fst/deserialize-web.d.ts.map +1 -1
  220. package/out/fst/deserialize-web.js +8 -9
  221. package/out/fst/deserialize-web.js.map +1 -1
  222. package/out/fst/format.d.ts +41 -23
  223. package/out/fst/format.d.ts.map +1 -1
  224. package/out/fst/format.js +41 -23
  225. package/out/fst/format.js.map +1 -1
  226. package/out/fst/freshness.d.ts +11 -73
  227. package/out/fst/freshness.d.ts.map +1 -1
  228. package/out/fst/freshness.js +12 -76
  229. package/out/fst/freshness.js.map +1 -1
  230. package/out/fst/matcher.d.ts +1 -1
  231. package/out/fst/matcher.d.ts.map +1 -1
  232. package/out/fst/matcher.js +2 -2
  233. package/out/fst/matcher.js.map +1 -1
  234. package/out/fst/serialize.d.ts +30 -26
  235. package/out/fst/serialize.d.ts.map +1 -1
  236. package/out/fst/serialize.js +44 -58
  237. package/out/fst/serialize.js.map +1 -1
  238. package/out/fst/types.d.ts +71 -59
  239. package/out/fst/types.d.ts.map +1 -1
  240. package/out/fst/types.js +1 -4
  241. package/out/fst/types.js.map +1 -1
  242. package/out/{fst/index.js → fst.d.ts} +1 -1
  243. package/out/fst.d.ts.map +1 -0
  244. package/out/{fst/index.d.ts → fst.js} +1 -1
  245. package/out/fst.js.map +1 -0
  246. package/out/fts/query.d.ts +2 -27
  247. package/out/fts/query.d.ts.map +1 -1
  248. package/out/fts/query.js +5 -36
  249. package/out/fts/query.js.map +1 -1
  250. package/out/fts.d.ts +126 -0
  251. package/out/fts.d.ts.map +1 -0
  252. package/out/fts.js +188 -0
  253. package/out/fts.js.map +1 -0
  254. package/out/geonames/aliases.d.ts +26 -67
  255. package/out/geonames/aliases.d.ts.map +1 -1
  256. package/out/geonames/aliases.js +44 -121
  257. package/out/geonames/aliases.js.map +1 -1
  258. package/out/geonames/postal.d.ts +84 -50
  259. package/out/geonames/postal.d.ts.map +1 -1
  260. package/out/geonames/postal.js +115 -78
  261. package/out/geonames/postal.js.map +1 -1
  262. package/out/{geonames/index.js → geonames.d.ts} +1 -1
  263. package/out/geonames.d.ts.map +1 -0
  264. package/out/{geonames/index.d.ts → geonames.js} +1 -1
  265. package/out/geonames.js.map +1 -0
  266. package/out/index.d.ts +20 -21
  267. package/out/index.d.ts.map +1 -1
  268. package/out/index.js +14 -15
  269. package/out/index.js.map +1 -1
  270. package/out/interpolation.d.ts +15 -52
  271. package/out/interpolation.d.ts.map +1 -1
  272. package/out/interpolation.js +25 -68
  273. package/out/interpolation.js.map +1 -1
  274. package/out/lookup.d.ts +24 -53
  275. package/out/lookup.d.ts.map +1 -1
  276. package/out/lookup.js +117 -223
  277. package/out/lookup.js.map +1 -1
  278. package/out/name-score.d.ts +2 -2
  279. package/out/name-score.d.ts.map +1 -1
  280. package/out/name-score.js +9 -7
  281. package/out/name-score.js.map +1 -1
  282. package/out/nsul/lookup.d.ts +33 -34
  283. package/out/nsul/lookup.d.ts.map +1 -1
  284. package/out/nsul/lookup.js +26 -40
  285. package/out/nsul/lookup.js.map +1 -1
  286. package/out/nsul/schema.d.ts +16 -43
  287. package/out/nsul/schema.d.ts.map +1 -1
  288. package/out/nsul/schema.js +9 -35
  289. package/out/nsul/schema.js.map +1 -1
  290. package/out/{nsul/index.d.ts → nsul.d.ts} +1 -1
  291. package/out/nsul.d.ts.map +1 -0
  292. package/out/{nsul/index.js → nsul.js} +1 -1
  293. package/out/nsul.js.map +1 -0
  294. package/out/paths.d.ts +124 -0
  295. package/out/paths.d.ts.map +1 -0
  296. package/out/paths.js +104 -0
  297. package/out/paths.js.map +1 -0
  298. package/out/place-importance-schema.d.ts +49 -141
  299. package/out/place-importance-schema.d.ts.map +1 -1
  300. package/out/place-importance-schema.js +25 -140
  301. package/out/place-importance-schema.js.map +1 -1
  302. package/out/poi/lookup.d.ts +38 -42
  303. package/out/poi/lookup.d.ts.map +1 -1
  304. package/out/poi/lookup.js +67 -90
  305. package/out/poi/lookup.js.map +1 -1
  306. package/out/poi/schema.d.ts +41 -25
  307. package/out/poi/schema.d.ts.map +1 -1
  308. package/out/poi/schema.js +25 -17
  309. package/out/poi/schema.js.map +1 -1
  310. package/out/{poi/index.js → poi.d.ts} +1 -1
  311. package/out/poi.d.ts.map +1 -0
  312. package/out/{poi/index.d.ts → poi.js} +1 -1
  313. package/out/poi.js.map +1 -0
  314. package/out/polygon-schema.d.ts +10 -6
  315. package/out/polygon-schema.d.ts.map +1 -1
  316. package/out/polygon-schema.js +2 -2
  317. package/out/polygon-schema.js.map +1 -1
  318. package/out/postal/{city-alias-lookup.d.ts → city/alias/lookup.d.ts} +22 -25
  319. package/out/postal/city/alias/lookup.d.ts.map +1 -0
  320. package/out/postal/city/alias/lookup.js +49 -0
  321. package/out/postal/city/alias/lookup.js.map +1 -0
  322. package/out/postal/{city-alias-schema.d.ts → city/alias/schema.d.ts} +15 -11
  323. package/out/postal/city/alias/schema.d.ts.map +1 -0
  324. package/out/postal/{city-alias-schema.js → city/alias/schema.js} +11 -9
  325. package/out/postal/city/alias/schema.js.map +1 -0
  326. package/out/postal/city/candidate-schema.d.ts +72 -0
  327. package/out/postal/city/candidate-schema.d.ts.map +1 -0
  328. package/out/postal/city/candidate-schema.js +60 -0
  329. package/out/postal/city/candidate-schema.js.map +1 -0
  330. package/out/postal.d.ts +9 -0
  331. package/out/postal.d.ts.map +1 -0
  332. package/out/postal.js +9 -0
  333. package/out/postal.js.map +1 -0
  334. package/out/postcode-point-lookup.d.ts +9 -19
  335. package/out/postcode-point-lookup.d.ts.map +1 -1
  336. package/out/postcode-point-lookup.js +5 -17
  337. package/out/postcode-point-lookup.js.map +1 -1
  338. package/out/primary-preference.d.ts +39 -93
  339. package/out/primary-preference.d.ts.map +1 -1
  340. package/out/primary-preference.js +13 -97
  341. package/out/primary-preference.js.map +1 -1
  342. package/out/proximity-rerank.d.ts +40 -29
  343. package/out/proximity-rerank.d.ts.map +1 -1
  344. package/out/proximity-rerank.js +38 -29
  345. package/out/proximity-rerank.js.map +1 -1
  346. package/out/ranking-weights.d.ts +91 -62
  347. package/out/ranking-weights.d.ts.map +1 -1
  348. package/out/ranking-weights.js +26 -25
  349. package/out/ranking-weights.js.map +1 -1
  350. package/out/region-keys.d.ts +48 -29
  351. package/out/region-keys.d.ts.map +1 -1
  352. package/out/region-keys.js +68 -40
  353. package/out/region-keys.js.map +1 -1
  354. package/out/reverse.d.ts +75 -50
  355. package/out/reverse.d.ts.map +1 -1
  356. package/out/reverse.js +61 -49
  357. package/out/reverse.js.map +1 -1
  358. package/out/schema.d.ts +74 -42
  359. package/out/schema.d.ts.map +1 -1
  360. package/out/schema.js +4 -5
  361. package/out/schema.js.map +1 -1
  362. package/out/search-fetch.d.ts +16 -12
  363. package/out/search-fetch.d.ts.map +1 -1
  364. package/out/search-fetch.js +83 -63
  365. package/out/search-fetch.js.map +1 -1
  366. package/out/sqlite/convention-source.d.ts +25 -0
  367. package/out/sqlite/convention-source.d.ts.map +1 -0
  368. package/out/sqlite/convention-source.js +48 -0
  369. package/out/sqlite/convention-source.js.map +1 -0
  370. package/out/sqlite/utils.d.ts +45 -0
  371. package/out/sqlite/utils.d.ts.map +1 -0
  372. package/out/sqlite/utils.js +56 -0
  373. package/out/sqlite/utils.js.map +1 -0
  374. package/out/street/centroid/schema.d.ts +100 -0
  375. package/out/street/centroid/schema.d.ts.map +1 -0
  376. package/out/street/centroid/schema.js +66 -0
  377. package/out/street/centroid/schema.js.map +1 -0
  378. package/out/street/centroid.d.ts +9 -19
  379. package/out/street/centroid.d.ts.map +1 -1
  380. package/out/street/centroid.js +11 -22
  381. package/out/street/centroid.js.map +1 -1
  382. package/out/street/{morphology-fst-builder.d.ts → morphology/fst/builder.d.ts} +21 -11
  383. package/out/street/morphology/fst/builder.d.ts.map +1 -0
  384. package/out/street/{morphology-fst-builder.js → morphology/fst/builder.js} +40 -34
  385. package/out/street/morphology/fst/builder.js.map +1 -0
  386. package/out/street/morphology/fst/loader.d.ts +74 -0
  387. package/out/street/morphology/fst/loader.d.ts.map +1 -0
  388. package/out/street/{morphology-fst-loader.js → morphology/fst/loader.js} +21 -21
  389. package/out/street/morphology/fst/loader.js.map +1 -0
  390. package/out/street/name-lookup.d.ts +24 -18
  391. package/out/street/name-lookup.d.ts.map +1 -1
  392. package/out/street/name-lookup.js +32 -31
  393. package/out/street/name-lookup.js.map +1 -1
  394. package/out/street/normalize.d.ts +35 -136
  395. package/out/street/normalize.d.ts.map +1 -1
  396. package/out/street/normalize.js +74 -191
  397. package/out/street/normalize.js.map +1 -1
  398. package/out/street/segment-schema.d.ts +79 -39
  399. package/out/street/segment-schema.d.ts.map +1 -1
  400. package/out/street/segment-schema.js +71 -21
  401. package/out/street/segment-schema.js.map +1 -1
  402. package/out/{street/index.d.ts → street.d.ts} +4 -4
  403. package/out/street.d.ts.map +1 -0
  404. package/out/{street/index.js → street.js} +4 -4
  405. package/out/street.js.map +1 -0
  406. package/out/types.d.ts +69 -138
  407. package/out/types.d.ts.map +1 -1
  408. package/out/types.js +0 -6
  409. package/out/types.js.map +1 -1
  410. package/out/unified-schema.d.ts +8 -12
  411. package/out/unified-schema.d.ts.map +1 -1
  412. package/out/unified-schema.js +29 -29
  413. package/out/unified-schema.js.map +1 -1
  414. package/out/uprn/existence.d.ts +28 -17
  415. package/out/uprn/existence.d.ts.map +1 -1
  416. package/out/uprn/existence.js +26 -16
  417. package/out/uprn/existence.js.map +1 -1
  418. package/out/uprn/lookup.d.ts +14 -44
  419. package/out/uprn/lookup.d.ts.map +1 -1
  420. package/out/uprn/lookup.js +20 -56
  421. package/out/uprn/lookup.js.map +1 -1
  422. package/out/uprn/schema.d.ts +18 -40
  423. package/out/uprn/schema.d.ts.map +1 -1
  424. package/out/uprn/schema.js +10 -32
  425. package/out/uprn/schema.js.map +1 -1
  426. package/out/{uprn/index.d.ts → uprn.d.ts} +1 -1
  427. package/out/uprn.d.ts.map +1 -0
  428. package/out/{uprn/index.js → uprn.js} +1 -1
  429. package/out/uprn.js.map +1 -0
  430. package/out/weights-overlay-linker.d.ts +132 -141
  431. package/out/weights-overlay-linker.d.ts.map +1 -1
  432. package/out/weights-overlay-linker.js +86 -154
  433. package/out/weights-overlay-linker.js.map +1 -1
  434. package/package.json +94 -599
  435. package/lib/address/point-schema.ts +0 -155
  436. package/lib/build-candidate.ts +0 -632
  437. package/lib/build-slim.ts +0 -408
  438. package/lib/candidate-ancestors-schema.ts +0 -195
  439. package/lib/candidate-fts.ts +0 -46
  440. package/lib/candidate-importance.ts +0 -224
  441. package/lib/candidate-lookup.ts +0 -977
  442. package/lib/candidate-schema.ts +0 -247
  443. package/lib/candidate-scoring.ts +0 -261
  444. package/lib/convention/index.ts +0 -154
  445. package/lib/fts/index.ts +0 -361
  446. package/lib/postal/city-alias-lookup.ts +0 -97
  447. package/lib/postal/index.ts +0 -9
  448. package/lib/sqlite-convention-source.ts +0 -65
  449. package/lib/sqlite-utils.ts +0 -82
  450. package/lib/street/centroid-schema.ts +0 -154
  451. package/out/address/index.d.ts.map +0 -1
  452. package/out/address/index.js.map +0 -1
  453. package/out/address/point-interpolation.d.ts +0 -49
  454. package/out/address/point-interpolation.d.ts.map +0 -1
  455. package/out/address/point-interpolation.js.map +0 -1
  456. package/out/address/point-schema.d.ts +0 -97
  457. package/out/address/point-schema.d.ts.map +0 -1
  458. package/out/address/point-schema.js.map +0 -1
  459. package/out/ancestry/index.d.ts +0 -45
  460. package/out/ancestry/index.d.ts.map +0 -1
  461. package/out/ancestry/index.js +0 -55
  462. package/out/ancestry/index.js.map +0 -1
  463. package/out/build-candidate.d.ts +0 -184
  464. package/out/build-candidate.d.ts.map +0 -1
  465. package/out/build-candidate.js.map +0 -1
  466. package/out/build-slim.d.ts +0 -80
  467. package/out/build-slim.d.ts.map +0 -1
  468. package/out/build-slim.js.map +0 -1
  469. package/out/candidate/ancestors-sidecar.d.ts +0 -32
  470. package/out/candidate/ancestors-sidecar.d.ts.map +0 -1
  471. package/out/candidate/ancestors-sidecar.js.map +0 -1
  472. package/out/candidate-ancestors-schema.d.ts +0 -150
  473. package/out/candidate-ancestors-schema.d.ts.map +0 -1
  474. package/out/candidate-ancestors-schema.js +0 -123
  475. package/out/candidate-ancestors-schema.js.map +0 -1
  476. package/out/candidate-fts.d.ts +0 -37
  477. package/out/candidate-fts.d.ts.map +0 -1
  478. package/out/candidate-fts.js +0 -40
  479. package/out/candidate-fts.js.map +0 -1
  480. package/out/candidate-importance.d.ts +0 -132
  481. package/out/candidate-importance.d.ts.map +0 -1
  482. package/out/candidate-importance.js +0 -169
  483. package/out/candidate-importance.js.map +0 -1
  484. package/out/candidate-lookup.d.ts +0 -76
  485. package/out/candidate-lookup.d.ts.map +0 -1
  486. package/out/candidate-lookup.js +0 -768
  487. package/out/candidate-lookup.js.map +0 -1
  488. package/out/candidate-schema.d.ts +0 -155
  489. package/out/candidate-schema.d.ts.map +0 -1
  490. package/out/candidate-schema.js.map +0 -1
  491. package/out/candidate-scoring.d.ts.map +0 -1
  492. package/out/candidate-scoring.js +0 -196
  493. package/out/candidate-scoring.js.map +0 -1
  494. package/out/convention/index.d.ts +0 -106
  495. package/out/convention/index.d.ts.map +0 -1
  496. package/out/convention/index.js +0 -93
  497. package/out/convention/index.js.map +0 -1
  498. package/out/fst/index.d.ts.map +0 -1
  499. package/out/fst/index.js.map +0 -1
  500. package/out/fts/index.d.ts +0 -184
  501. package/out/fts/index.d.ts.map +0 -1
  502. package/out/fts/index.js +0 -277
  503. package/out/fts/index.js.map +0 -1
  504. package/out/geonames/index.d.ts.map +0 -1
  505. package/out/geonames/index.js.map +0 -1
  506. package/out/nsul/index.d.ts.map +0 -1
  507. package/out/nsul/index.js.map +0 -1
  508. package/out/poi/index.d.ts.map +0 -1
  509. package/out/poi/index.js.map +0 -1
  510. package/out/postal/city-alias-lookup.d.ts.map +0 -1
  511. package/out/postal/city-alias-lookup.js +0 -62
  512. package/out/postal/city-alias-lookup.js.map +0 -1
  513. package/out/postal/city-alias-schema.d.ts.map +0 -1
  514. package/out/postal/city-alias-schema.js.map +0 -1
  515. package/out/postal/city-candidate-schema.d.ts +0 -66
  516. package/out/postal/city-candidate-schema.d.ts.map +0 -1
  517. package/out/postal/city-candidate-schema.js +0 -56
  518. package/out/postal/city-candidate-schema.js.map +0 -1
  519. package/out/postal/index.d.ts +0 -9
  520. package/out/postal/index.d.ts.map +0 -1
  521. package/out/postal/index.js +0 -9
  522. package/out/postal/index.js.map +0 -1
  523. package/out/sqlite-convention-source.d.ts +0 -29
  524. package/out/sqlite-convention-source.d.ts.map +0 -1
  525. package/out/sqlite-convention-source.js +0 -57
  526. package/out/sqlite-convention-source.js.map +0 -1
  527. package/out/sqlite-utils.d.ts +0 -45
  528. package/out/sqlite-utils.d.ts.map +0 -1
  529. package/out/sqlite-utils.js +0 -57
  530. package/out/sqlite-utils.js.map +0 -1
  531. package/out/street/centroid-schema.d.ts +0 -105
  532. package/out/street/centroid-schema.d.ts.map +0 -1
  533. package/out/street/centroid-schema.js +0 -78
  534. package/out/street/centroid-schema.js.map +0 -1
  535. package/out/street/index.d.ts.map +0 -1
  536. package/out/street/index.js.map +0 -1
  537. package/out/street/morphology-fst-builder.d.ts.map +0 -1
  538. package/out/street/morphology-fst-builder.js.map +0 -1
  539. package/out/street/morphology-fst-loader.d.ts +0 -67
  540. package/out/street/morphology-fst-loader.d.ts.map +0 -1
  541. package/out/street/morphology-fst-loader.js.map +0 -1
  542. package/out/uprn/index.d.ts.map +0 -1
  543. package/out/uprn/index.js.map +0 -1
  544. /package/lib/{fst/index.ts → fst.ts} +0 -0
  545. /package/lib/{geonames/index.ts → geonames.ts} +0 -0
  546. /package/lib/{nsul/index.ts → nsul.ts} +0 -0
  547. /package/lib/{poi/index.ts → poi.ts} +0 -0
  548. /package/lib/{uprn/index.ts → uprn.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-candidate.js","sourceRoot":"","sources":["../lib/build-candidate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACtF,OAAO,EACN,iBAAiB,EACjB,4BAA4B,EAC5B,oBAAoB,GAEpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,qGAAqG;AACrG,mEAAmE;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAA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AE,CAAC,QAAQ,EAAU,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;SAChD,uBAAuB,EAAE,CAAA;IAE3B,yCAAyC;IACzC,OAAO;QACN,IAAI;QACJ,MAAM,EAAE,KAAK,CAAC,IAAI;QAClB,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,MAAM;QACf,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,cAAc;QAC/B,YAAY,EAAE,OAAO,CAAC,YAAY,GAAG,iBAAiB;QACtD,cAAc,EAAE,OAAO,CAAC,cAAc,GAAG,eAAe;QACxD,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,GAAG,KAAK;QACR,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,UAAU,CAAC,OAAO,EAAE,kBAAkB,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACvG,CAAA;AACF,CAAC"}
@@ -1,80 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Build a "slim" Who's On First SQLite distribution that's small enough to ship as a static asset
7
- * for the browser-side mailwoman demo (Path B of the demo plan). The full admin distribution is
8
- * ~2 GB; the slim variant aims for the ~50–100 MB range by keeping only the places a public demo
9
- * will actually query for.
10
- *
11
- * Selection policy (v1, US-focused):
12
- *
13
- * - All countries / regions / counties / boroughs in the configured `countries` set, so the ancestor
14
- * chain a locality / postcode reports through `parent_id` stays intact.
15
- * - Top-K localities by population (read from the source's pre-built `place_population` aux table) in
16
- * those countries.
17
- * - All postcodes in those countries — they're small and addressing-relevant.
18
- * - All `names` + `place_population` rows for selected place IDs.
19
- * - The `coincident_roles` dual-role relation (#402), filtered to surviving spr ids.
20
- *
21
- * No geojson, by design. The upstream WOF GeoJSON bodies live ONLY in the raw `whosonfirst-data-*`
22
- * repos; `scripts/build-unified-wof.ts` extracts `wof:population` straight into
23
- * `place_population` (and the bbox into `spr`) at ingest and never persists a `geojson` table. So
24
- * the source admin DB carries population in `place_population`, and this builder consumes it
25
- * directly — there is nothing to extract from, and nothing to drop.
26
- *
27
- * The output DB has the resolver-facing schema: `spr`, `names`, `place_population`, plus the
28
- * `place_search` FTS5 / `place_bbox` R*Tree virtual tables rebuilt against the trimmed row set
29
- * (both derive purely from `spr` + `names` — see `fts.ts`). That means `WOFSQLitePlaceLookup`
30
- * opens the slim DB without any code change — it sees a smaller universe, nothing more.
31
- *
32
- * Multi-extract inputs (e.g. admin + postcode) are processed in sequence; selected rows accumulate
33
- * into the single output DB. The postcode extract contributes only postcodes; admin contributes
34
- * everything else. Empty / missing input paths are skipped (callers pass `""` when a extract, such
35
- * as a custom postcode DB, isn't built yet).
36
- */
37
- export interface BuildSlimOptions {
38
- /**
39
- * Input WOF SQLite distributions. Each should already have spr / names / place_population tables.
40
- */
41
- inputs: string[];
42
- /**
43
- * Output path for the slim DB. Will be overwritten if it exists.
44
- */
45
- output: string;
46
- /**
47
- * Country codes to keep (ISO 2-letter). Defaults to `["US"]`.
48
- */
49
- countries?: string[];
50
- /**
51
- * Cap on the number of localities to keep per country, by descending population.
52
- */
53
- topLocalitiesPerCountry?: number;
54
- /**
55
- * Drop the `names` table after the FTS index is built (default false). `place_search` is a self-contained FTS5 (no
56
- * external `content=`), so once it's built `names` is only the build-time source — the resolver queries
57
- * `place_search` + `spr` + `place_population` + `coincident_roles` and never reads `names` at runtime. Dropping it is
58
- * the single biggest size win (~2/3 of the file for a multi-locale build; see #359). A future consumer that needs raw
59
- * alt-names at runtime should ship a SEPARATE extract rather than re-bloat the hot DB.
60
- */
61
- dropNames?: boolean;
62
- /**
63
- * Optional progress callback for CLI / test introspection.
64
- */
65
- onProgress?: (phase: SlimBuildPhase, detail: string) => void;
66
- }
67
- export type SlimBuildPhase = "init" | "schema" | "country" | "region" | "county" | "locality" | "postcode" | "names" | "place_population" | "coincident_roles" | "place_abbr" | "fts" | "vacuum" | "done";
68
- export interface BuildSlimResult {
69
- outputPath: string;
70
- outputBytes: number;
71
- rowCounts: {
72
- spr: number;
73
- names: number;
74
- placeSearch: number;
75
- placeBbox: number;
76
- placePopulation: number;
77
- };
78
- }
79
- export declare function buildSlimWOFDatabase(opts: BuildSlimOptions): Promise<BuildSlimResult>;
80
- //# sourceMappingURL=build-slim.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-slim.d.ts","sourceRoot":"","sources":["../lib/build-slim.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAcH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB;;OAEG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5D;AAED,MAAM,MAAM,cAAc,GACvB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,kBAAkB,GAClB,kBAAkB,GAClB,YAAY,GACZ,KAAK,GACL,QAAQ,GACR,MAAM,CAAA;AAET,MAAM,WAAW,eAAe;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE;QACV,GAAG,EAAE,MAAM,CAAA;QACX,KAAK,EAAE,MAAM,CAAA;QACb,WAAW,EAAE,MAAM,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;QACjB,eAAe,EAAE,MAAM,CAAA;KACvB,CAAA;CACD;AAwCD,wBAA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EAAE,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CACtG;iBACA,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC;iBAClC,OAAO,EAAE,CAAA;QACZ,CAAC;QAED,+FAA+F;QAC/F,8FAA8F;QAC9F,gGAAgG;QAChG,8FAA8F;QAC9F,kCAAkC;QAClC,MAAM,cAAc,GAAG,GAAG;aACxB,OAAO,CAAC,sFAAsF,CAAC;aAC/F,GAAG,EAAkC,CAAA;QAEvC,IAAI,cAAc,EAAE,GAAG,EAAE,CAAC;YACzB,QAAQ,CAAC,kBAAkB,EAAE,GAAG,SAAS,8BAA8B,CAAC,CAAA;YACxE,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,4BAA4B,CAAC,CAAC,CAAA;YAEnF,GAAG,CAAC,IAAI,CACP;oFACgF,CAChF,CAAA;YAED,GAAG,CAAC,IAAI,CAAC,qFAAqF,CAAC,CAAA;QAChG,CAAC;IACF,CAAC;YAAS,CAAC;QACV,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;IACjC,CAAC;AACF,CAAC"}
@@ -1,32 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- * @file Pass 3b of the candidate build — the containment sidecar (closure rows + interval labels).
6
- */
7
- import type { DatabaseClient } from "@mailwoman/sqlite/client";
8
- import type { CandidateDatabase } from "#candidate-schema";
9
- import type { PlaceAttrs } from "#candidate/place-attrs";
10
- import type { WOFDatabase } from "#schema";
11
- /**
12
- * Pass 3b — the ancestors sidecar: closure rows + interval labels (candidate-ancestors-schema.ts owns the encoding
13
- * decision and the DAG/absence semantics). Reads the same source `ancestors` table the region stamp reads,
14
- * denormalizing each edge with the parent's name/key from `attrs`, streamed `ORDER BY id` so the clustered `(spr_id,
15
- * depth)` insert is sorted — the contiguous-leaves discipline of the candidate table itself.
16
- *
17
- * Excluded by policy: self rows, and placetypes outside the containment ladder (continent, empire, …: `placetypeDepth` 0)
18
- * — they discriminate nothing a consumer of this sidecar checks. An edge to a parent with no current `spr` row has no
19
- * name to denormalize; it is dropped and counted rather than stored blind.
20
- */
21
- export declare function buildAncestorsSidecar(ctx: {
22
- src: DatabaseClient<WOFDatabase>;
23
- out: DatabaseClient<CandidateDatabase>;
24
- attrs: Map<number, PlaceAttrs>;
25
- ptID: (pt: string | null) => number;
26
- progress: (phase: string, message: string) => void;
27
- }): Promise<{
28
- ancestorRows: number;
29
- ancestorPlaces: number;
30
- intervalPlaces: number;
31
- }>;
32
- //# sourceMappingURL=ancestors-sidecar.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ancestors-sidecar.d.ts","sourceRoot":"","sources":["../../lib/candidate/ancestors-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAW9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE;IAChD,GAAG,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;IAChC,GAAG,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IACtC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC9B,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;IACnC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAClD,GAAG,OA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CAAC,cAAc,EAAE,gDAAgD,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5G,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,cAAc,EAAE,0CAA0C,CAAC,CAAC,CAAC,EAAE,CAAC,CACnG,CAAA;IAED,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,CAAC,IAAI,EAAE,CAAA;AACpE,CAAC"}
@@ -1,150 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Typed schema for the candidate gazetteer's ANCESTORS sidecar (`candidate_ancestor` +
7
- * `candidate_interval`) — the containment lineage the candidate table itself cannot answer, built
8
- * into the same `candidate.db` by `build-candidate.ts` and read by
9
- * {@link WOFCandidateTableLookup.ancestors}.
10
- *
11
- * ENCODING: closure-lite rows, denormalized — one row per (place, ancestor) edge carrying the
12
- * parent's placetype, display name and folded key — rather than a fixed-slot id chain on the
13
- * candidate row. Decided by the two consumers:
14
- *
15
- * 1. The admin-coherence check needs the WINNER's chain as (placetype, name) pairs in one probe.
16
- * A fixed-slot `[id;8]` chain answers with ids, and every id then needs a name lookup the
17
- * artifact has no per-id table for — up to 8 indirections where the closure row has zero.
18
- * 2. The account layer needs EVERY candidate under a `name_key` enumerable WITH its chain from
19
- * one artifact probe ("present-but-outranked, discriminated by containment"). That is the
20
- * candidate probe (contiguous) followed by one `spr_id`-clustered closure probe per candidate
21
- * — each a handful of adjacent pages.
22
- *
23
- * Denormalizing the parent onto the edge is the same discipline as the candidate table itself:
24
- * this artifact is read over HTTP byte ranges, where a join to a dimension table scatters page
25
- * fetches, and a `WITHOUT ROWID` B-tree clustered on `(spr_id, depth)` keeps a whole chain in
26
- * 1-2 pages. The repeated parent strings are the price of the zero-join read, paid at build time.
27
- *
28
- * `depth` is 1 for the NEAREST ancestor (deepest containment tier), increasing outward to the
29
- * country — the same nearest-first order `ancestry.ts` serves for the FTS backend, so the two
30
- * backends' `ancestors()` agree by construction. The order within a place is deterministic:
31
- * containment depth descending (`placetypeDepth`), then ancestor id ascending, capped at
32
- * {@link MAX_ANCESTOR_DEPTH}. `parent_name_key` is the SHARED {@link normalizeLocalityForKey}
33
- * fold — the same fold `candidate.name_key` is built with, so a chain entry and a candidate key
34
- * compare under one normalizer.
35
- *
36
- * `candidate_interval` carries pre/post-order labels over the CANONICAL-PARENT FOREST, assigned
37
- * at build time: `a` contains `d` ⟺ `a.pre <= d.pre AND d.post <= a.post` — O(1) in either
38
- * direction with no chain scan and no knowledge of either side's tier — and the descendants of
39
- * `a` are the contiguous range `pre BETWEEN a.pre AND a.post`. Interval labels are classically
40
- * avoided for their relabel-on-update cost; this database is a sealed read-only artifact rebuilt
41
- * whole, which is exactly the regime where that cost is void.
42
- *
43
- * THE DAG CAVEAT, and the recorded choice: WOF places can carry more than one parent (multiple
44
- * hierarchies, ambiguous boundaries). `candidate_ancestor` keeps EVERY parent — the closure rows
45
- * are the complete containment record. A single interval pair can only encode a tree, so the
46
- * interval forest links each place to ONE canonical parent: its depth-1 edge — the finest
47
- * containment tier, lowest ancestor id — the same MIN-stability convention the candidate table's
48
- * `region_id` stamp uses. A containment question about a NON-canonical hierarchy must consult the
49
- * closure rows; the interval answer for it is `false`, which is why interval verdicts are
50
- * "contained along the canonical hierarchy", never "not contained at all".
51
- *
52
- * ABSENCE SEMANTICS (meaning-of-zero): a place with no `candidate_interval` row has no recorded
53
- * ancestry in the source (extract-fed postcodes and localities, isolated places, cycle-skipped
54
- * rows). Absence is UNVERIFIABLE, never a containment verdict.
55
- */
56
- import { type Kysely } from "kysely";
57
- import type { CandidateDatabase } from "#candidate-schema";
58
- import type { NameKey } from "#street/normalize";
59
- /**
60
- * The deepest chain the sidecar stores per place. WOF containment within the resolvable placetypes (country …
61
- * microhood) never legitimately exceeds this; anything past it is source noise the build drops (and counts) rather than
62
- * stores.
63
- */
64
- export declare const MAX_ANCESTOR_DEPTH = 8;
65
- /**
66
- * The closure-row table's name — probed with `hasTable` by the reader, so an artifact predating the sidecar degrades to
67
- * "no ancestors capability" rather than `no such table`.
68
- */
69
- export declare const CANDIDATE_ANCESTOR_TABLE = "candidate_ancestor";
70
- /**
71
- * The interval-label table's name — the closure table's seal-time sibling; existence-restricted the same way.
72
- */
73
- export declare const CANDIDATE_INTERVAL_TABLE = "candidate_interval";
74
- /**
75
- * One (place, ancestor) edge, denormalized so a chain read is a single clustered probe (no join).
76
- */
77
- export interface CandidateAncestorTable {
78
- /**
79
- * WOF id of the place whose chain this row belongs to — the same `spr_id` the candidate table resolves to.
80
- */
81
- spr_id: number;
82
- /**
83
- * 1 = nearest ancestor, increasing outward to the country. Deterministic within a place (containment depth
84
- * descending, then ancestor id ascending), so `(spr_id, depth)` is a stable primary key across rebuilds.
85
- */
86
- depth: number;
87
- /**
88
- * WOF id of the ancestor.
89
- */
90
- parent_spr_id: number;
91
- /**
92
- * Small int from the shared `placetype_codes` dictionary (the same one the candidate table uses).
93
- */
94
- parent_placetype_id: number;
95
- /**
96
- * The ancestor's canonical display name — what {@link Ancestor.name} serves, matching the FTS backend's register.
97
- */
98
- parent_name: string;
99
- /**
100
- * The SHARED {@link normalizeLocalityForKey} fold of `parent_name` — comparable against `candidate.name_key` and
101
- * against a query-side fold under one normalizer, by construction.
102
- */
103
- parent_name_key: NameKey;
104
- }
105
- /**
106
- * Pre/post-order labels over the canonical-parent forest — one row per place WITH recorded ancestry (see the module
107
- * docstring for absence semantics). `pre < post` always; labels are unique across the artifact.
108
- */
109
- export interface CandidateIntervalTable {
110
- spr_id: number;
111
- pre: number;
112
- post: number;
113
- }
114
- /**
115
- * The sidecar tables, for a `Kysely` view over the candidate DB. `CandidateDatabase` (candidate-schema.ts) extends
116
- * this, so the builder's one typed client sees both families.
117
- */
118
- export interface CandidateAncestorsDatabase {
119
- candidate_ancestor: CandidateAncestorTable;
120
- candidate_interval: CandidateIntervalTable;
121
- }
122
- /**
123
- * The `candidate_ancestor` columns in clustered-key order — the first two ARE the primary key, and the builder's
124
- * positional `INSERT` binds by this order. Keep in sync with {@link CandidateAncestorTable}.
125
- */
126
- export declare const CANDIDATE_ANCESTOR_COLUMNS: readonly ["spr_id", "depth", "parent_spr_id", "parent_placetype_id", "parent_name", "parent_name_key"];
127
- /**
128
- * Create the clustered closure table. The builder inserts in `(spr_id, depth)` order so the B-tree leaves are
129
- * contiguous per place — the byte-range read discipline.
130
- */
131
- export declare function createCandidateAncestorTable(db: Kysely<CandidateDatabase>): Promise<void>;
132
- /**
133
- * Create the interval-label table. Small rows probed by primary key — the `WITHOUT ROWID` win case.
134
- */
135
- export declare function createCandidateIntervalTable(db: Kysely<CandidateDatabase>): Promise<void>;
136
- /**
137
- * One place's interval label — the shape both sides of a containment comparison read.
138
- */
139
- export interface IntervalLabel {
140
- pre: number;
141
- post: number;
142
- }
143
- /**
144
- * Does `outer` contain `inner` along the canonical hierarchy? Reflexive: a place contains itself (containment
145
- * degenerates to identity, the same reading the admin-coherence check gives a self-match). The shared FUNCTION for
146
- * every consumer of the labels — a re-derived comparison risks disagreeing at exactly the strict/inclusive boundary
147
- * this line settles.
148
- */
149
- export declare function intervalContains(outer: IntervalLabel, inner: IntervalLabel): boolean;
150
- //# sourceMappingURL=candidate-ancestors-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate-ancestors-schema.d.ts","sourceRoot":"","sources":["../lib/candidate-ancestors-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AAEH,OAAO,EAAO,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;AAKzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAEnC;;;GAGG;AACH,eAAO,MA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candidate gazetteer's ANCESTORS sidecar (`candidate_ancestor` +
7
- * `candidate_interval`) — the containment lineage the candidate table itself cannot answer, built
8
- * into the same `candidate.db` by `build-candidate.ts` and read by
9
- * {@link WOFCandidateTableLookup.ancestors}.
10
- *
11
- * ENCODING: closure-lite rows, denormalized — one row per (place, ancestor) edge carrying the
12
- * parent's placetype, display name and folded key — rather than a fixed-slot id chain on the
13
- * candidate row. Decided by the two consumers:
14
- *
15
- * 1. The admin-coherence check needs the WINNER's chain as (placetype, name) pairs in one probe.
16
- * A fixed-slot `[id;8]` chain answers with ids, and every id then needs a name lookup the
17
- * artifact has no per-id table for — up to 8 indirections where the closure row has zero.
18
- * 2. The account layer needs EVERY candidate under a `name_key` enumerable WITH its chain from
19
- * one artifact probe ("present-but-outranked, discriminated by containment"). That is the
20
- * candidate probe (contiguous) followed by one `spr_id`-clustered closure probe per candidate
21
- * — each a handful of adjacent pages.
22
- *
23
- * Denormalizing the parent onto the edge is the same discipline as the candidate table itself:
24
- * this artifact is read over HTTP byte ranges, where a join to a dimension table scatters page
25
- * fetches, and a `WITHOUT ROWID` B-tree clustered on `(spr_id, depth)` keeps a whole chain in
26
- * 1-2 pages. The repeated parent strings are the price of the zero-join read, paid at build time.
27
- *
28
- * `depth` is 1 for the NEAREST ancestor (deepest containment tier), increasing outward to the
29
- * country — the same nearest-first order `ancestry.ts` serves for the FTS backend, so the two
30
- * backends' `ancestors()` agree by construction. The order within a place is deterministic:
31
- * containment depth descending (`placetypeDepth`), then ancestor id ascending, capped at
32
- * {@link MAX_ANCESTOR_DEPTH}. `parent_name_key` is the SHARED {@link normalizeLocalityForKey}
33
- * fold — the same fold `candidate.name_key` is built with, so a chain entry and a candidate key
34
- * compare under one normalizer.
35
- *
36
- * `candidate_interval` carries pre/post-order labels over the CANONICAL-PARENT FOREST, assigned
37
- * at build time: `a` contains `d` ⟺ `a.pre <= d.pre AND d.post <= a.post` — O(1) in either
38
- * direction with no chain scan and no knowledge of either side's tier — and the descendants of
39
- * `a` are the contiguous range `pre BETWEEN a.pre AND a.post`. Interval labels are classically
40
- * avoided for their relabel-on-update cost; this database is a sealed read-only artifact rebuilt
41
- * whole, which is exactly the regime where that cost is void.
42
- *
43
- * THE DAG CAVEAT, and the recorded choice: WOF places can carry more than one parent (multiple
44
- * hierarchies, ambiguous boundaries). `candidate_ancestor` keeps EVERY parent — the closure rows
45
- * are the complete containment record. A single interval pair can only encode a tree, so the
46
- * interval forest links each place to ONE canonical parent: its depth-1 edge — the finest
47
- * containment tier, lowest ancestor id — the same MIN-stability convention the candidate table's
48
- * `region_id` stamp uses. A containment question about a NON-canonical hierarchy must consult the
49
- * closure rows; the interval answer for it is `false`, which is why interval verdicts are
50
- * "contained along the canonical hierarchy", never "not contained at all".
51
- *
52
- * ABSENCE SEMANTICS (meaning-of-zero): a place with no `candidate_interval` row has no recorded
53
- * ancestry in the source (extract-fed postcodes and localities, isolated places, cycle-skipped
54
- * rows). Absence is UNVERIFIABLE, never a containment verdict.
55
- */
56
- import { sql } from "kysely";
57
- /**
58
- * The deepest chain the sidecar stores per place. WOF containment within the resolvable placetypes (country …
59
- * microhood) never legitimately exceeds this; anything past it is source noise the build drops (and counts) rather than
60
- * stores.
61
- */
62
- export const MAX_ANCESTOR_DEPTH = 8;
63
- /**
64
- * The closure-row table's name — probed with `hasTable` by the reader, so an artifact predating the sidecar degrades to
65
- * "no ancestors capability" rather than `no such table`.
66
- */
67
- export const CANDIDATE_ANCESTOR_TABLE = "candidate_ancestor";
68
- /**
69
- * The interval-label table's name — the closure table's seal-time sibling; existence-restricted the same way.
70
- */
71
- export const CANDIDATE_INTERVAL_TABLE = "candidate_interval";
72
- /**
73
- * The `candidate_ancestor` columns in clustered-key order — the first two ARE the primary key, and the builder's
74
- * positional `INSERT` binds by this order. Keep in sync with {@link CandidateAncestorTable}.
75
- */
76
- export const CANDIDATE_ANCESTOR_COLUMNS = [
77
- "spr_id",
78
- "depth",
79
- "parent_spr_id",
80
- "parent_placetype_id",
81
- "parent_name",
82
- "parent_name_key",
83
- ];
84
- /**
85
- * Create the clustered closure table. The builder inserts in `(spr_id, depth)` order so the B-tree leaves are
86
- * contiguous per place — the byte-range read discipline.
87
- */
88
- export async function createCandidateAncestorTable(db) {
89
- await db.schema
90
- .createTable(CANDIDATE_ANCESTOR_TABLE)
91
- .addColumn("spr_id", "integer", (c) => c.notNull())
92
- .addColumn("depth", "integer", (c) => c.notNull())
93
- .addColumn("parent_spr_id", "integer", (c) => c.notNull())
94
- .addColumn("parent_placetype_id", "integer", (c) => c.notNull())
95
- .addColumn("parent_name", "text", (c) => c.notNull())
96
- .addColumn("parent_name_key", "text", (c) => c.notNull())
97
- .addPrimaryKeyConstraint("candidate_ancestor_pk", ["spr_id", "depth"])
98
- // `WITHOUT ROWID` has no first-class builder; the raw modifier is the idiomatic fallback.
99
- .modifyEnd(sql `without rowid`)
100
- .execute();
101
- }
102
- /**
103
- * Create the interval-label table. Small rows probed by primary key — the `WITHOUT ROWID` win case.
104
- */
105
- export async function createCandidateIntervalTable(db) {
106
- await db.schema
107
- .createTable(CANDIDATE_INTERVAL_TABLE)
108
- .addColumn("spr_id", "integer", (c) => c.primaryKey())
109
- .addColumn("pre", "integer", (c) => c.notNull())
110
- .addColumn("post", "integer", (c) => c.notNull())
111
- .modifyEnd(sql `without rowid`)
112
- .execute();
113
- }
114
- /**
115
- * Does `outer` contain `inner` along the canonical hierarchy? Reflexive: a place contains itself (containment
116
- * degenerates to identity, the same reading the admin-coherence check gives a self-match). The shared FUNCTION for
117
- * every consumer of the labels — a re-derived comparison risks disagreeing at exactly the strict/inclusive boundary
118
- * this line settles.
119
- */
120
- export function intervalContains(outer, inner) {
121
- return outer.pre <= inner.pre && inner.post <= outer.post;
122
- }
123
- //# sourceMappingURL=candidate-ancestors-schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate-ancestors-schema.js","sourceRoot":"","sources":["../lib/candidate-ancestors-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;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,QAAQ,EAAE,OAAO,CAAC,CAAC;QACtE,0FAA0F;SACzF,SAAS,CAAC,GAAG,CAAA,eAAe,CAAC;SAC7B,OAAO,EAAE,CAAA;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EAA6B;IAC/E,MAAM,EAAE,CAAC,MAAM;SACb,WAAW,CAAC,wBAAwB,CAAC;SACrC,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;SACrD,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAC/C,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAChD,SAAS,CAAC,GAAG,CAAA,eAAe,CAAC;SAC7B,OAAO,EAAE,CAAA;AACZ,CAAC;AAUD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAoB,EAAE,KAAoB;IAC1E,OAAO,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAA;AAC1D,CAAC"}
@@ -1,37 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * FTS5-TRIGRAM fuzzy index over the candidate gazetteer's `name_key` — the typo-tolerant fallback
7
- * the exact `name_key` B-tree probe structurally can't do (a misspelling breaks the normalized
8
- * key, so the contiguous-probe lookup returns nothing). It indexes the NORMALIZED key (not the
9
- * raw `name`), so a diacritic-stripped query (`munchen`) trigram-matches the stored `munchen`
10
- * rather than missing a raw `München`. The trigram tokenizer makes MATCH a substring/fuzzy
11
- * operation; the reader ({@link WOFCandidateTableLookup}) OR's the query's trigrams to fetch a
12
- * loose set, then re-ranks it with a WORD-level similarity. The trigram index is the candidate
13
- * GENERATOR, not the scorer — trigram Jaccard scores a true transposition correction BELOW a wrong
14
- * answer, because shared generic suffixes count as evidence and transpositions count against it.
15
- * The receipts are on `candidate-lookup.ts`'s `FUZZY_FETCH` and `WORD_FUZZY_MIN`.
16
- *
17
- * This is what unifies the two gazetteers: the candidate B-tree stays the common,
18
- * byte-range-optimal fast path (the browser's contiguous probe), and FTS5 is consulted ONLY on an
19
- * exact+strip miss — so its scattered postings cost is rare/amortized, and one DB serves both the
20
- * browser and the server.
21
- *
22
- * Raw SQL on purpose: Kysely can't express `CREATE VIRTUAL TABLE … USING fts5` (the repo's
23
- * FTS5-stays-raw rule). Indexing DISTINCT `name_key` keeps the index to unique normalized forms
24
- * (a name_key fans out to many candidate rows — placetypes, regions, aliases — but the fuzzy
25
- * fallback only needs to recover the name_key, then re-probes the B-tree for its rows).
26
- */
27
- import type { DatabaseClient } from "@mailwoman/sqlite/client";
28
- /**
29
- * Name of the FTS5 trigram virtual table this module owns. The reader conditions its fuzzy fallback on it.
30
- */
31
- export declare const CANDIDATE_FTS_TABLE = "candidate_fts";
32
- /**
33
- * Build (or rebuild) {@link CANDIDATE_FTS_TABLE} from the materialized `candidate` table. Call after the candidate
34
- * B-tree is populated (build pipeline) or against an existing candidate DB (migration).
35
- */
36
- export declare function createCandidateFTS<DB>(db: DatabaseClient<DB>): void;
37
- //# sourceMappingURL=candidate-fts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate-fts.d.ts","sourceRoot":"","sources":["../lib/candidate-fts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAE9D;;GAEG;AACH,eAAO,MAAM,mBAAmB,kBAAkB,CAAA;AAElD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,GAAG,IAAI,CAOnE"}
@@ -1,40 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * FTS5-TRIGRAM fuzzy index over the candidate gazetteer's `name_key` — the typo-tolerant fallback
7
- * the exact `name_key` B-tree probe structurally can't do (a misspelling breaks the normalized
8
- * key, so the contiguous-probe lookup returns nothing). It indexes the NORMALIZED key (not the
9
- * raw `name`), so a diacritic-stripped query (`munchen`) trigram-matches the stored `munchen`
10
- * rather than missing a raw `München`. The trigram tokenizer makes MATCH a substring/fuzzy
11
- * operation; the reader ({@link WOFCandidateTableLookup}) OR's the query's trigrams to fetch a
12
- * loose set, then re-ranks it with a WORD-level similarity. The trigram index is the candidate
13
- * GENERATOR, not the scorer — trigram Jaccard scores a true transposition correction BELOW a wrong
14
- * answer, because shared generic suffixes count as evidence and transpositions count against it.
15
- * The receipts are on `candidate-lookup.ts`'s `FUZZY_FETCH` and `WORD_FUZZY_MIN`.
16
- *
17
- * This is what unifies the two gazetteers: the candidate B-tree stays the common,
18
- * byte-range-optimal fast path (the browser's contiguous probe), and FTS5 is consulted ONLY on an
19
- * exact+strip miss — so its scattered postings cost is rare/amortized, and one DB serves both the
20
- * browser and the server.
21
- *
22
- * Raw SQL on purpose: Kysely can't express `CREATE VIRTUAL TABLE … USING fts5` (the repo's
23
- * FTS5-stays-raw rule). Indexing DISTINCT `name_key` keeps the index to unique normalized forms
24
- * (a name_key fans out to many candidate rows — placetypes, regions, aliases — but the fuzzy
25
- * fallback only needs to recover the name_key, then re-probes the B-tree for its rows).
26
- */
27
- /**
28
- * Name of the FTS5 trigram virtual table this module owns. The reader conditions its fuzzy fallback on it.
29
- */
30
- export const CANDIDATE_FTS_TABLE = "candidate_fts";
31
- /**
32
- * Build (or rebuild) {@link CANDIDATE_FTS_TABLE} from the materialized `candidate` table. Call after the candidate
33
- * B-tree is populated (build pipeline) or against an existing candidate DB (migration).
34
- */
35
- export function createCandidateFTS(db) {
36
- db.exec(`DROP TABLE IF EXISTS ${CANDIDATE_FTS_TABLE}`);
37
- db.exec(`CREATE VIRTUAL TABLE ${CANDIDATE_FTS_TABLE} USING fts5(name_key, tokenize='trigram')`);
38
- db.exec(`INSERT INTO ${CANDIDATE_FTS_TABLE}(name_key) SELECT DISTINCT name_key FROM candidate WHERE name_key IS NOT NULL`);
39
- }
40
- //# sourceMappingURL=candidate-fts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"candidate-fts.js","sourceRoot":"","sources":["../lib/candidate-fts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,eAAe,CAAA;AAElD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAK,EAAsB;IAC5D,EAAE,CAAC,IAAI,CAAC,wBAAwB,mBAAmB,EAAE,CAAC,CAAA;IACtD,EAAE,CAAC,IAAI,CAAC,wBAAwB,mBAAmB,2CAA2C,CAAC,CAAA;IAE/F,EAAE,CAAC,IAAI,CACN,eAAe,mBAAmB,+EAA+E,CACjH,CAAA;AACF,CAAC"}