@mailwoman/core 4.16.1 → 5.0.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 (316) hide show
  1. package/data/chromium-i18n/ssl-address-download.ts +110 -0
  2. package/data/libpostal/resources-download.ts +121 -0
  3. package/out/api/APIClient.d.ts +2 -2
  4. package/out/api/APIClient.d.ts.map +1 -1
  5. package/out/api/APIClient.js +2 -2
  6. package/out/api/APIClient.js.map +1 -1
  7. package/out/api/responses.d.ts.map +1 -1
  8. package/out/api/responses.js.map +1 -1
  9. package/out/classification/Classification.d.ts +3 -4
  10. package/out/classification/Classification.d.ts.map +1 -1
  11. package/out/classification/Classification.js.map +1 -1
  12. package/out/classification/CompositeClassifier.d.ts +1 -1
  13. package/out/classification/CompositeClassifier.d.ts.map +1 -1
  14. package/out/classification/CompositeClassifier.js +1 -1
  15. package/out/classification/CompositeClassifier.js.map +1 -1
  16. package/out/classification/PhraseClassifier.d.ts.map +1 -1
  17. package/out/classification/PhraseClassifier.js.map +1 -1
  18. package/out/classification/SectionClassifier.d.ts.map +1 -1
  19. package/out/classification/SectionClassifier.js.map +1 -1
  20. package/out/classification/WordClassifier.d.ts.map +1 -1
  21. package/out/classification/WordClassifier.js.map +1 -1
  22. package/out/classification/scheme.d.ts.map +1 -1
  23. package/out/classification/scheme.js.map +1 -1
  24. package/out/coarse-placer/coarse-placer.d.ts +28 -34
  25. package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
  26. package/out/coarse-placer/coarse-placer.js +17 -20
  27. package/out/coarse-placer/coarse-placer.js.map +1 -1
  28. package/out/coarse-placer/featurize.d.ts +17 -19
  29. package/out/coarse-placer/featurize.d.ts.map +1 -1
  30. package/out/coarse-placer/featurize.js +17 -19
  31. package/out/coarse-placer/featurize.js.map +1 -1
  32. package/out/collections.d.ts +1 -2
  33. package/out/collections.d.ts.map +1 -1
  34. package/out/collections.js +1 -2
  35. package/out/collections.js.map +1 -1
  36. package/out/data/chromium-i18n/ssl-address-download.d.ts +30 -0
  37. package/out/data/chromium-i18n/ssl-address-download.d.ts.map +1 -0
  38. package/out/data/chromium-i18n/ssl-address-download.js +98 -0
  39. package/out/data/chromium-i18n/ssl-address-download.js.map +1 -0
  40. package/out/data/libpostal/resources-download.d.ts +29 -0
  41. package/out/data/libpostal/resources-download.d.ts.map +1 -0
  42. package/out/data/libpostal/resources-download.js +107 -0
  43. package/out/data/libpostal/resources-download.js.map +1 -0
  44. package/out/db/schema.d.ts +2 -2
  45. package/out/decoder/arbitrate-tree.d.ts +3 -3
  46. package/out/decoder/arbitrate-tree.d.ts.map +1 -1
  47. package/out/decoder/arbitrate-tree.js +5 -5
  48. package/out/decoder/arbitrate-tree.js.map +1 -1
  49. package/out/decoder/build-tree.d.ts +12 -14
  50. package/out/decoder/build-tree.d.ts.map +1 -1
  51. package/out/decoder/build-tree.js +4 -5
  52. package/out/decoder/build-tree.js.map +1 -1
  53. package/out/decoder/calibration.d.ts +3 -4
  54. package/out/decoder/calibration.d.ts.map +1 -1
  55. package/out/decoder/calibration.js +3 -4
  56. package/out/decoder/calibration.js.map +1 -1
  57. package/out/decoder/containment.d.ts +5 -6
  58. package/out/decoder/containment.d.ts.map +1 -1
  59. package/out/decoder/containment.js +5 -6
  60. package/out/decoder/containment.js.map +1 -1
  61. package/out/decoder/index.d.ts +1 -0
  62. package/out/decoder/index.d.ts.map +1 -1
  63. package/out/decoder/index.js +1 -0
  64. package/out/decoder/index.js.map +1 -1
  65. package/out/decoder/proposals-to-tree.d.ts +9 -9
  66. package/out/decoder/proposals-to-tree.d.ts.map +1 -1
  67. package/out/decoder/proposals-to-tree.js +11 -11
  68. package/out/decoder/proposals-to-tree.js.map +1 -1
  69. package/out/decoder/resolve-proposal-overlaps.d.ts +3 -5
  70. package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
  71. package/out/decoder/resolve-proposal-overlaps.js +5 -6
  72. package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
  73. package/out/decoder/serialize-json.d.ts +13 -1
  74. package/out/decoder/serialize-json.d.ts.map +1 -1
  75. package/out/decoder/serialize-json.js +6 -2
  76. package/out/decoder/serialize-json.js.map +1 -1
  77. package/out/decoder/serialize-tuples.d.ts +10 -1
  78. package/out/decoder/serialize-tuples.d.ts.map +1 -1
  79. package/out/decoder/serialize-tuples.js +13 -5
  80. package/out/decoder/serialize-tuples.js.map +1 -1
  81. package/out/decoder/serialize-xml.d.ts +15 -9
  82. package/out/decoder/serialize-xml.d.ts.map +1 -1
  83. package/out/decoder/serialize-xml.js +29 -12
  84. package/out/decoder/serialize-xml.js.map +1 -1
  85. package/out/decoder/types.d.ts +52 -61
  86. package/out/decoder/types.d.ts.map +1 -1
  87. package/out/decoder/types.js +2 -2
  88. package/out/decoder/unknown-spans.d.ts +46 -0
  89. package/out/decoder/unknown-spans.d.ts.map +1 -0
  90. package/out/decoder/unknown-spans.js +56 -0
  91. package/out/decoder/unknown-spans.js.map +1 -0
  92. package/out/decoder/validate-tree.d.ts.map +1 -1
  93. package/out/decoder/validate-tree.js +2 -3
  94. package/out/decoder/validate-tree.js.map +1 -1
  95. package/out/errors/schema.d.ts +1 -2
  96. package/out/errors/schema.d.ts.map +1 -1
  97. package/out/errors/schema.js +1 -2
  98. package/out/errors/schema.js.map +1 -1
  99. package/out/filters/RelationshipFilter.d.ts.map +1 -1
  100. package/out/filters/RelationshipFilter.js.map +1 -1
  101. package/out/formatter/index.d.ts.map +1 -1
  102. package/out/formatter/index.js.map +1 -1
  103. package/out/identifiers.d.ts.map +1 -1
  104. package/out/identifiers.js.map +1 -1
  105. package/out/kysley/client.d.ts +3 -4
  106. package/out/kysley/client.d.ts.map +1 -1
  107. package/out/kysley/client.js +3 -4
  108. package/out/kysley/client.js.map +1 -1
  109. package/out/kysley/dialect-config.d.ts +1 -1
  110. package/out/kysley/dialect-config.d.ts.map +1 -1
  111. package/out/kysley/dialect.d.ts +4 -4
  112. package/out/kysley/dialect.js +4 -4
  113. package/out/kysley/driver.d.ts.map +1 -1
  114. package/out/kysley/driver.js +1 -1
  115. package/out/kysley/driver.js.map +1 -1
  116. package/out/lifecycle/ServiceSymbol.d.ts +2 -4
  117. package/out/lifecycle/ServiceSymbol.d.ts.map +1 -1
  118. package/out/lifecycle/ServiceSymbol.js +2 -4
  119. package/out/lifecycle/ServiceSymbol.js.map +1 -1
  120. package/out/lifecycle/services.d.ts +7 -8
  121. package/out/lifecycle/services.d.ts.map +1 -1
  122. package/out/lifecycle/services.js +5 -4
  123. package/out/lifecycle/services.js.map +1 -1
  124. package/out/locale/locale.d.ts +5 -6
  125. package/out/locale/locale.d.ts.map +1 -1
  126. package/out/locale/registry.d.ts.map +1 -1
  127. package/out/locale/registry.js.map +1 -1
  128. package/out/logging/index.d.ts +1 -0
  129. package/out/logging/index.d.ts.map +1 -1
  130. package/out/logging/index.js +1 -0
  131. package/out/logging/index.js.map +1 -1
  132. package/out/logging/shared.d.ts +2 -2
  133. package/out/logging/shared.js +2 -2
  134. package/out/logging/utils.d.ts +30 -0
  135. package/out/logging/utils.d.ts.map +1 -0
  136. package/out/logging/utils.js +30 -0
  137. package/out/logging/utils.js.map +1 -0
  138. package/out/objects.d.ts +3 -4
  139. package/out/objects.d.ts.map +1 -1
  140. package/out/objects.js +1 -2
  141. package/out/objects.js.map +1 -1
  142. package/out/parser/AddressParser.d.ts +12 -16
  143. package/out/parser/AddressParser.d.ts.map +1 -1
  144. package/out/parser/AddressParser.js.map +1 -1
  145. package/out/parser/proposal-pipeline.d.ts +12 -12
  146. package/out/parser/proposal-pipeline.d.ts.map +1 -1
  147. package/out/parser/proposal-pipeline.js +12 -12
  148. package/out/parser/proposal-pipeline.js.map +1 -1
  149. package/out/parser/solution-to-proposals.d.ts +4 -4
  150. package/out/parser/solution-to-proposals.d.ts.map +1 -1
  151. package/out/parser/solution-to-proposals.js +5 -5
  152. package/out/parser/solution-to-proposals.js.map +1 -1
  153. package/out/pipeline/index.d.ts +1 -1
  154. package/out/pipeline/reconcile-lookups.d.ts +4 -4
  155. package/out/pipeline/reconcile-lookups.d.ts.map +1 -1
  156. package/out/pipeline/reconcile-lookups.js +4 -4
  157. package/out/pipeline/reconcile-lookups.js.map +1 -1
  158. package/out/pipeline/reconcile.d.ts +21 -23
  159. package/out/pipeline/reconcile.d.ts.map +1 -1
  160. package/out/pipeline/reconcile.js +49 -51
  161. package/out/pipeline/reconcile.js.map +1 -1
  162. package/out/pipeline/runtime-pipeline.d.ts +14 -16
  163. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  164. package/out/pipeline/runtime-pipeline.js +33 -37
  165. package/out/pipeline/runtime-pipeline.js.map +1 -1
  166. package/out/pipeline/span-logit-aggregation.d.ts +5 -6
  167. package/out/pipeline/span-logit-aggregation.d.ts.map +1 -1
  168. package/out/pipeline/span-logit-aggregation.js +7 -8
  169. package/out/pipeline/span-logit-aggregation.js.map +1 -1
  170. package/out/pipeline/span-proposer.d.ts +18 -22
  171. package/out/pipeline/span-proposer.d.ts.map +1 -1
  172. package/out/pipeline/span-proposer.js +21 -22
  173. package/out/pipeline/span-proposer.js.map +1 -1
  174. package/out/pipeline/types.d.ts +77 -86
  175. package/out/pipeline/types.d.ts.map +1 -1
  176. package/out/policy/defaults.d.ts +5 -6
  177. package/out/policy/defaults.d.ts.map +1 -1
  178. package/out/policy/defaults.js +5 -6
  179. package/out/policy/defaults.js.map +1 -1
  180. package/out/policy/from-config.d.ts +8 -9
  181. package/out/policy/from-config.d.ts.map +1 -1
  182. package/out/policy/from-config.js +8 -9
  183. package/out/policy/from-config.js.map +1 -1
  184. package/out/policy/input-shape-router.d.ts +15 -19
  185. package/out/policy/input-shape-router.d.ts.map +1 -1
  186. package/out/policy/input-shape-router.js +11 -14
  187. package/out/policy/input-shape-router.js.map +1 -1
  188. package/out/policy/policy.d.ts +10 -13
  189. package/out/policy/policy.d.ts.map +1 -1
  190. package/out/policy/registry.d.ts +4 -5
  191. package/out/policy/registry.d.ts.map +1 -1
  192. package/out/policy/registry.js +6 -7
  193. package/out/policy/registry.js.map +1 -1
  194. package/out/resolver/index.d.ts +1 -1
  195. package/out/resolver/index.js +1 -1
  196. package/out/resolver/types.d.ts +212 -216
  197. package/out/resolver/types.d.ts.map +1 -1
  198. package/out/resolver/types.js +32 -39
  199. package/out/resolver/types.js.map +1 -1
  200. package/out/resources/LocaleIndex.d.ts +1 -2
  201. package/out/resources/LocaleIndex.d.ts.map +1 -1
  202. package/out/resources/LocaleIndex.js +1 -2
  203. package/out/resources/LocaleIndex.js.map +1 -1
  204. package/out/resources/ResourceMapCache.d.ts.map +1 -1
  205. package/out/resources/ResourceMapCache.js.map +1 -1
  206. package/out/resources/collections.d.ts +1 -2
  207. package/out/resources/collections.d.ts.map +1 -1
  208. package/out/resources/collections.js +1 -2
  209. package/out/resources/collections.js.map +1 -1
  210. package/out/resources/fs.d.ts.map +1 -1
  211. package/out/resources/fs.js.map +1 -1
  212. package/out/resources/git.d.ts.map +1 -1
  213. package/out/resources/git.js.map +1 -1
  214. package/out/resources/libaddressinput.d.ts +2 -2
  215. package/out/resources/libaddressinput.js +2 -2
  216. package/out/resources/libpostal.d.ts +4 -5
  217. package/out/resources/libpostal.d.ts.map +1 -1
  218. package/out/resources/libpostal.js +6 -7
  219. package/out/resources/libpostal.js.map +1 -1
  220. package/out/resources/set.d.ts +1 -2
  221. package/out/resources/set.d.ts.map +1 -1
  222. package/out/resources/set.js +1 -2
  223. package/out/resources/set.js.map +1 -1
  224. package/out/resources/whosonfirst/DataSourceCache.d.ts.map +1 -1
  225. package/out/resources/whosonfirst/DataSourceCache.js.map +1 -1
  226. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
  227. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  228. package/out/resources/whosonfirst/PlacetypeDataSource.js +1 -1
  229. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  230. package/out/resources/whosonfirst/loader.d.ts +1 -2
  231. package/out/resources/whosonfirst/loader.d.ts.map +1 -1
  232. package/out/resources/whosonfirst/loader.js.map +1 -1
  233. package/out/resources/whosonfirst/placetypes/Placetype.d.ts +6 -9
  234. package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
  235. package/out/resources/whosonfirst/placetypes/Placetype.js +7 -10
  236. package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
  237. package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -2
  238. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  239. package/out/resources/whosonfirst/placetypes/admin.js +1 -2
  240. package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
  241. package/out/resources/whosonfirst/placetypes/graph.d.ts +10 -10
  242. package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
  243. package/out/resources/whosonfirst/placetypes/graph.js +0 -0
  244. package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
  245. package/out/resources/whosonfirst/placetypes/mermaid.d.ts +16 -19
  246. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  247. package/out/resources/whosonfirst/placetypes/mermaid.js +15 -16
  248. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  249. package/out/resources/whosonfirst/placetypes/tree.d.ts +6 -7
  250. package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
  251. package/out/resources/whosonfirst/placetypes/tree.js +3 -4
  252. package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
  253. package/out/routing/index.d.ts +2 -3
  254. package/out/routing/index.d.ts.map +1 -1
  255. package/out/routing/index.js +1 -1
  256. package/out/routing/index.js.map +1 -1
  257. package/out/solver/HashMapSolver.d.ts.map +1 -1
  258. package/out/solver/HashMapSolver.js.map +1 -1
  259. package/out/solver/Solution.d.ts +2 -2
  260. package/out/solver/Solution.d.ts.map +1 -1
  261. package/out/solver/Solution.js +2 -2
  262. package/out/solver/Solution.js.map +1 -1
  263. package/out/solver/mask.d.ts.map +1 -1
  264. package/out/solver/mask.js.map +1 -1
  265. package/out/solvers/LeadingAreaDeclassifier.d.ts.map +1 -1
  266. package/out/solvers/LeadingAreaDeclassifier.js.map +1 -1
  267. package/out/solvers/MultiStreetSolver.d.ts +10 -15
  268. package/out/solvers/MultiStreetSolver.d.ts.map +1 -1
  269. package/out/solvers/MultiStreetSolver.js +10 -15
  270. package/out/solvers/MultiStreetSolver.js.map +1 -1
  271. package/out/solvers/PostcodePositionPenalty.d.ts +2 -2
  272. package/out/solvers/PostcodePositionPenalty.d.ts.map +1 -1
  273. package/out/solvers/PostcodePositionPenalty.js +2 -2
  274. package/out/solvers/PostcodePositionPenalty.js.map +1 -1
  275. package/out/tokenization/Span.d.ts +1 -3
  276. package/out/tokenization/Span.d.ts.map +1 -1
  277. package/out/tokenization/Span.js +1 -3
  278. package/out/tokenization/Span.js.map +1 -1
  279. package/out/tokenization/context.d.ts +1 -2
  280. package/out/tokenization/context.d.ts.map +1 -1
  281. package/out/tokenization/context.js +1 -2
  282. package/out/tokenization/context.js.map +1 -1
  283. package/out/tokenization/normalizer.js +2 -2
  284. package/out/tokenization/permutate.d.ts +2 -3
  285. package/out/tokenization/permutate.d.ts.map +1 -1
  286. package/out/tokenization/permutate.js +4 -5
  287. package/out/tokenization/permutate.js.map +1 -1
  288. package/out/types/classifier.d.ts +21 -23
  289. package/out/types/classifier.d.ts.map +1 -1
  290. package/out/types/component.d.ts +6 -7
  291. package/out/types/component.d.ts.map +1 -1
  292. package/out/types/component.js +5 -6
  293. package/out/types/component.js.map +1 -1
  294. package/out/types/mapping.d.ts +8 -8
  295. package/out/types/mapping.d.ts.map +1 -1
  296. package/out/types/mapping.js +13 -13
  297. package/out/types/mapping.js.map +1 -1
  298. package/out/utils/data-root.d.ts +5 -5
  299. package/out/utils/data-root.js +7 -7
  300. package/out/utils/repo.d.ts +3 -3
  301. package/out/utils/repo.d.ts.map +1 -1
  302. package/out/utils/repo.js +16 -19
  303. package/out/utils/repo.js.map +1 -1
  304. package/out/vitest.config.d.ts.map +1 -1
  305. package/out/vitest.config.js.map +1 -1
  306. package/package.json +18 -18
  307. package/data/chromium-i18n/ssl-address-download.sh +0 -15
  308. package/data/libpostal/resources-download.sh +0 -44
  309. package/out/logging/tables.d.ts +0 -7
  310. package/out/logging/tables.d.ts.map +0 -1
  311. package/out/logging/tables.js +0 -75
  312. package/out/logging/tables.js.map +0 -1
  313. package/out/sets.d.ts +0 -2
  314. package/out/sets.d.ts.map +0 -1
  315. package/out/sets.js +0 -2
  316. package/out/sets.js.map +0 -1
@@ -11,9 +11,9 @@
11
11
  */
12
12
  import { COARSE_CLASSES, FEATURE_DIM, featurize } from "./featurize.js";
13
13
  /**
14
- * Dequantize a per-row int8 weight matrix back to fp32: `W[c][i] = int8[c*dim + i] * scales[c]`.
15
- * The predict path stays fp32 (identical math); quantization only shrinks the serialized/wire
16
- * artifact. Pure — usable in the browser loader too.
14
+ * Dequantize a per-row int8 weight matrix back to fp32: `W[c][i] = int8[c*dim + i] * scales[c]`. The predict path stays
15
+ * fp32 (identical math); quantization only shrinks the serialized/wire artifact. Pure — usable in the browser loader
16
+ * too.
17
17
  */
18
18
  export function dequantizeInt8Weights(int8, scales, classCount, dim) {
19
19
  const expected = classCount * dim;
@@ -53,10 +53,10 @@ export class CoarsePlacer {
53
53
  }
54
54
  /**
55
55
  * Load a placer from an artifact directory holding `meta.json` + `weights.bin` (the layout
56
- * `scripts/coarse-placer/train.mjs` and `quantize.mjs` write). Handles both the fp32 artifact
57
- * (`weights.bin` is a `Float32Array`) and the int8 artifact (`meta.quantization ===
58
- * "int8-per-row"`, `weights.bin` is an `Int8Array` dequantized via `meta.scales`). Node-only —
59
- * the `node:` imports are dynamic so bundling the class for the browser doesn't pull them in.
56
+ * `scripts/coarse-placer/train.mjs` and `quantize.mjs` write). Handles both the fp32 artifact (`weights.bin` is a
57
+ * `Float32Array`) and the int8 artifact (`meta.quantization === "int8-per-row"`, `weights.bin` is an `Int8Array`
58
+ * dequantized via `meta.scales`). Node-only — the `node:` imports are dynamic so bundling the class for the browser
59
+ * doesn't pull them in.
60
60
  */
61
61
  static async fromArtifactDir(dir, opts) {
62
62
  const { readFile } = await import("node:fs/promises");
@@ -78,11 +78,10 @@ export class CoarsePlacer {
78
78
  return new CoarsePlacer({ classes: meta.classes, featureDim: meta.featureDim, temperature: meta.temperature, bias: meta.bias, weights }, opts);
79
79
  }
80
80
  /**
81
- * Load the int8 model bundled in `@mailwoman/core` (`core/data/coarse-placer/`). Node-only — uses
82
- * the package path builder (the #481-corrected `__isCompiledTree` makes this resolve to the
83
- * shipped `data/` in source, compiled, AND installed-package layouts). Override the directory
84
- * with `$MAILWOMAN_COARSE_PLACER_DIR`. Callers set `abstainBelow` per their use (the
85
- * soft-country-prior wiring passes 0.9 — see
81
+ * Load the int8 model bundled in `@mailwoman/core` (`core/data/coarse-placer/`). Node-only — uses the package path
82
+ * builder (the #481-corrected `__isCompiledTree` makes this resolve to the shipped `data/` in source, compiled, AND
83
+ * installed-package layouts). Override the directory with `$MAILWOMAN_COARSE_PLACER_DIR`. Callers set `abstainBelow`
84
+ * per their use (the soft-country-prior wiring passes 0.9 — see
86
85
  * docs/articles/plan/2026-06-14-coarse-placer-soft-signal-spec.md).
87
86
  */
88
87
  static async fromBundled(opts) {
@@ -159,14 +158,12 @@ export class CoarsePlacer {
159
158
  }
160
159
  }
161
160
  /**
162
- * The in-map posterior for the soft-prior DISTRIBUTION wiring (#244 residual upgrade): the
163
- * per-in-map-country marginals (every class except `OTHER`) from a prediction, or `null` when the
164
- * model abstained / routed off-map. Fed straight to the resolver's `anchorPosterior` so it boosts
165
- * EVERY plausible in-map country proportionally — and breaks country-ambiguous ties (mass split
166
- * across several in-map countries) with its own place-level evidence — instead of committing to the
167
- * single argmax (the one-hot the M2 wiring shipped). Raw marginals (un-renormalized; they sum to
168
- * the in-map mass `1 - P(OTHER)`), matching the one-hot's `confidence` scale so `anchorWeight` is
169
- * unchanged.
161
+ * The in-map posterior for the soft-prior DISTRIBUTION wiring (#244 residual upgrade): the per-in-map-country marginals
162
+ * (every class except `OTHER`) from a prediction, or `null` when the model abstained / routed off-map. Fed straight to
163
+ * the resolver's `anchorPosterior` so it boosts EVERY plausible in-map country proportionally — and breaks
164
+ * country-ambiguous ties (mass split across several in-map countries) with its own place-level evidence — instead of
165
+ * committing to the single argmax (the one-hot the M2 wiring shipped). Raw marginals (un-renormalized; they sum to the
166
+ * in-map mass `1 - P(OTHER)`), matching the one-hot's `confidence` scale so `anchorWeight` is unchanged.
170
167
  */
171
168
  export function inMapPosterior(prediction) {
172
169
  if (prediction.country === null || prediction.country === "OTHER")
@@ -1 +1 @@
1
- {"version":3,"file":"coarse-placer.js","sourceRoot":"","sources":["../../coarse-placer/coarse-placer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AA6BvE;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACpC,IAAe,EACf,MAAyB,EACzB,UAAkB,EAClB,GAAW;IAEX,MAAM,QAAQ,GAAG,UAAU,GAAG,GAAG,CAAA;IACjC,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,CAAC,MAAM,kBAAkB,QAAQ,EAAE,CAAC,CAAA;IACjH,IAAI,MAAM,CAAC,MAAM,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,eAAe,MAAM,CAAC,MAAM,aAAa,UAAU,UAAU,CAAC,CAAA;IAChH,MAAM,GAAG,GAAG,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAA;IACtC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAE,CAAA;QACpB,MAAM,IAAI,GAAG,CAAC,GAAG,GAAG,CAAA;QACpB,KAAK,IAAI,CAAC,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-15,33 +15,31 @@
15
15
  * coarsely" tier.
16
16
  */
17
17
  /**
18
- * The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU
19
- * expansion, and `OTHER` — the explicit off-map class (milestone 2) trained on non-Latin/non-CJK
20
- * scripts via outlier exposure, so the model learns the edge of its competence and routes "probably
21
- * off my loaded map" instead of a confident mis-placement. Index order is the label id.
18
+ * The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU expansion, and `OTHER` — the
19
+ * explicit off-map class (milestone 2) trained on non-Latin/non-CJK scripts via outlier exposure, so the model learns
20
+ * the edge of its competence and routes "probably off my loaded map" instead of a confident mis-placement. Index order
21
+ * is the label id.
22
22
  *
23
- * The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the
24
- * placer previously couldn't emit — ambiguous names there (FI "Helsinki", PL "Rybnik") landed
25
- * off-continent in the population-first candidate gazetteer because no country prior pinned them.
26
- * They're trained from the Overture per-country addresses theme (`build-dataset.mjs`), and they're
27
- * pulled OUT of the Latin off-map OTHER outlier set (`build-outlier-latin.mjs`) that used to teach
28
- * PL/PT/CZ → OTHER. Widening the class set is the soft-prior lever; it never hard-filters, so a
29
- * neighbour confusion (DK↔NO, EE↔LT↔LV) still keeps resolution in-region, off the global-pop
30
- * attractors. Adding a class requires a retrain + a fresh artifact — the bundled meta.json carries
31
- * its own `classes`, so this constant only drives training (`train.mjs`), not inference.
23
+ * The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the placer previously
24
+ * couldn't emit — ambiguous names there (FI "Helsinki", PL "Rybnik") landed off-continent in the population-first
25
+ * candidate gazetteer because no country prior pinned them. They're trained from the Overture per-country addresses
26
+ * theme (`build-dataset.mjs`), and they're pulled OUT of the Latin off-map OTHER outlier set
27
+ * (`build-outlier-latin.mjs`) that used to teach PL/PT/CZ → OTHER. Widening the class set is the soft-prior lever; it
28
+ * never hard-filters, so a neighbour confusion (DK↔NO, EE↔LT↔LV) still keeps resolution in-region, off the global-pop
29
+ * attractors. Adding a class requires a retrain + a fresh artifact — the bundled meta.json carries its own `classes`,
30
+ * so this constant only drives training (`train.mjs`), not inference.
32
31
  */
33
32
  export declare const COARSE_CLASSES: readonly ["US", "FR", "GB", "CN", "NL", "IT", "DE", "JP", "ES", "KR", "TW", "AT", "BE", "CH", "CZ", "DK", "EE", "FI", "HR", "LT", "LU", "LV", "NO", "PL", "PT", "SI", "SK", "OTHER"];
34
33
  export type CoarseClass = (typeof COARSE_CLASSES)[number];
35
34
  /**
36
- * Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8)
37
- * while collisions stay tolerable for a linear bag-of-features model; the discriminative n-grams
38
- * are few.
35
+ * Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8) while collisions stay
36
+ * tolerable for a linear bag-of-features model; the discriminative n-grams are few.
39
37
  */
40
38
  export declare const FEATURE_DIM: number;
41
39
  /**
42
- * Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the
43
- * lowercased, boundary-marked string + one presence token per Unicode script seen (+ the dominant
44
- * script). Non-Latin characters are PRESERVED (lowercasing only touches cased scripts).
40
+ * Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the lowercased,
41
+ * boundary-marked string + one presence token per Unicode script seen (+ the dominant script). Non-Latin characters are
42
+ * PRESERVED (lowercasing only touches cased scripts).
45
43
  */
46
44
  export declare function featurize(text: string): number[];
47
45
  //# sourceMappingURL=featurize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"featurize.d.ts","sourceRoot":"","sources":["../../coarse-placer/featurize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,sLA6BjB,CAAA;AACV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAU,CAAA;AA8ClC;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA8BhD"}
1
+ {"version":3,"file":"featurize.d.ts","sourceRoot":"","sources":["../../coarse-placer/featurize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc,sLA6BjB,CAAA;AACV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD;;;GAGG;AACH,eAAO,MAAM,WAAW,QAAU,CAAA;AAyDlC;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAoChD"}
@@ -15,20 +15,19 @@
15
15
  * coarsely" tier.
16
16
  */
17
17
  /**
18
- * The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU
19
- * expansion, and `OTHER` — the explicit off-map class (milestone 2) trained on non-Latin/non-CJK
20
- * scripts via outlier exposure, so the model learns the edge of its competence and routes "probably
21
- * off my loaded map" instead of a confident mis-placement. Index order is the label id.
18
+ * The trained classes: the well-represented corpus countries, the #743 Overture-sourced EU expansion, and `OTHER` — the
19
+ * explicit off-map class (milestone 2) trained on non-Latin/non-CJK scripts via outlier exposure, so the model learns
20
+ * the edge of its competence and routes "probably off my loaded map" instead of a confident mis-placement. Index order
21
+ * is the label id.
22
22
  *
23
- * The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the
24
- * placer previously couldn't emit — ambiguous names there (FI "Helsinki", PL "Rybnik") landed
25
- * off-continent in the population-first candidate gazetteer because no country prior pinned them.
26
- * They're trained from the Overture per-country addresses theme (`build-dataset.mjs`), and they're
27
- * pulled OUT of the Latin off-map OTHER outlier set (`build-outlier-latin.mjs`) that used to teach
28
- * PL/PT/CZ → OTHER. Widening the class set is the soft-prior lever; it never hard-filters, so a
29
- * neighbour confusion (DK↔NO, EE↔LT↔LV) still keeps resolution in-region, off the global-pop
30
- * attractors. Adding a class requires a retrain + a fresh artifact — the bundled meta.json carries
31
- * its own `classes`, so this constant only drives training (`train.mjs`), not inference.
23
+ * The first 11 are the original v0.5.0-corpus countries. The next 16 (#743) are EU locales the placer previously
24
+ * couldn't emit — ambiguous names there (FI "Helsinki", PL "Rybnik") landed off-continent in the population-first
25
+ * candidate gazetteer because no country prior pinned them. They're trained from the Overture per-country addresses
26
+ * theme (`build-dataset.mjs`), and they're pulled OUT of the Latin off-map OTHER outlier set
27
+ * (`build-outlier-latin.mjs`) that used to teach PL/PT/CZ → OTHER. Widening the class set is the soft-prior lever; it
28
+ * never hard-filters, so a neighbour confusion (DK↔NO, EE↔LT↔LV) still keeps resolution in-region, off the global-pop
29
+ * attractors. Adding a class requires a retrain + a fresh artifact — the bundled meta.json carries its own `classes`,
30
+ * so this constant only drives training (`train.mjs`), not inference.
32
31
  */
33
32
  export const COARSE_CLASSES = [
34
33
  "US",
@@ -61,9 +60,8 @@ export const COARSE_CLASSES = [
61
60
  "OTHER",
62
61
  ];
63
62
  /**
64
- * Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8)
65
- * while collisions stay tolerable for a linear bag-of-features model; the discriminative n-grams
66
- * are few.
63
+ * Hashed-feature dimensionality (2^16). Keeps the weight matrix small (28×65536 ≈ 1.8 MB int8) while collisions stay
64
+ * tolerable for a linear bag-of-features model; the discriminative n-grams are few.
67
65
  */
68
66
  export const FEATURE_DIM = 1 << 16;
69
67
  /** Coarse Unicode-script buckets — strong priors the n-grams refine. */
@@ -113,9 +111,9 @@ function bucket(s, salt) {
113
111
  return (h >>> 0) % FEATURE_DIM;
114
112
  }
115
113
  /**
116
- * Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the
117
- * lowercased, boundary-marked string + one presence token per Unicode script seen (+ the dominant
118
- * script). Non-Latin characters are PRESERVED (lowercasing only touches cased scripts).
114
+ * Featurize an address into a deduped list of active feature indices: char 3/4/5-grams over the lowercased,
115
+ * boundary-marked string + one presence token per Unicode script seen (+ the dominant script). Non-Latin characters are
116
+ * PRESERVED (lowercasing only touches cased scripts).
119
117
  */
120
118
  export function featurize(text) {
121
119
  const norm = text.toLowerCase().replace(/\s+/g, " ").trim();
@@ -1 +1 @@
1
- {"version":3,"file":"featurize.js","sourceRoot":"","sources":["../../coarse-placer/featurize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;CACE,CAAA;AAGV;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,CAAA;AAElC,wEAAwE;AACxE,MAAM,OAAO,GAAG;IACf,OAAO;IACP,KAAK;IACL,UAAU;IACV,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,MAAM;IACN,OAAO;IACP,OAAO;CACE,CAAA;AAGV,SAAS,QAAQ,CAAC,EAAU;IAC3B,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI;QAAE,OAAO,OAAO,CAAA;IAC5C,IAAI,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,KAAK,CAAC;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,IAAI,QAAQ,GAAW,OAAO,CAAA;IAC9B,IAAI,GAAG,GAAG,CAAC,CAAC,CAAA;IAEZ,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;QAEpC,IAAI,EAAE,KAAK,OAAO,IAAI,EAAE,KAAK,OAAO,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;YACjD,GAAG,GAAG,CAAC,CAAA;YACP,QAAQ,GAAG,EAAE,CAAA;QACd,CAAC;IACF,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;IAE1C,wDAAwD;IACxD,MAAM,MAAM,GAAG,IAAI,IAAI,GAAG,CAAA;IAE1B,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7C,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAC9C,CAAC;IACF,CAAC;IAED,OAAO,CAAC,GAAG,MAAM,CAAC,CAAA;AACnB,CAAC"}
@@ -29,8 +29,7 @@ export declare function take<T>(collection: Iterable<T>, batchSize: number): Ite
29
29
  */
30
30
  export declare function iterateInParallel<T>(asyncIterable: AsyncIterable<T>): Promise<void>;
31
31
  /**
32
- * Given an iterable of values, maps each value to a record of the value and the result of the
33
- * callback.
32
+ * Given an iterable of values, maps each value to a record of the value and the result of the callback.
34
33
  *
35
34
  * This is a convenience function when an iterable needs mapping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AAC,GAAG,OAAO;AAC9F;;GAEG;AACH,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AACrB;;GAEG;AACH,QAAQ,EAAE,CAAC,GACT,UAAU,CAAC,CAAC,CAAC,SAAS,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CA6B/F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,CAElE;AAED;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAC;IAChE,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAA;CACtB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,eAAe,CAAC,CAAC,CAAC,CAEpF"}
@@ -45,8 +45,7 @@ export async function iterateInParallel(asyncIterable) {
45
45
  }
46
46
  }
47
47
  /**
48
- * Given an iterable of values, maps each value to a record of the value and the result of the
49
- * callback.
48
+ * Given an iterable of values, maps each value to a record of the value and the result of the callback.
50
49
  *
51
50
  * This is a convenience function when an iterable needs mapping to an object-like structure.
52
51
  *
@@ -1 +1 @@
1
- {"version":3,"file":"collections.js","sourceRoot":"","sources":["../collections.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH;;GAEG;AACH,MAAM,UAAU,KAAK,CAAmB,QAAqB,EAAE,IAA0B;IACxF,IAAI,KAAK,GAAG,CAAC,CAAA;IAEb,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC7B,KAAK,IAAI,IAAI,CAAC,IAAI,CAAW,CAAA;IAC9B,CAA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AW,CAAC,OAAO,CAAC,CAAA;IAEjD,OAAO,aAEoB,CAAA;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAI,KAAc;IAC3C,OAAO,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,KAAK,CAAC,CAAA;AACxC,CAAC;AASD;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAI,KAAkB;IACtD,OAAO,KAAK,IAAI,OAAQ,KAAyB,CAAC,GAAG,KAAK,UAAU,CAAA;AACrE,CAAC"}
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @copyright Sister Software
4
+ * @license AGPL-3.0
5
+ * @author Teffen Ellis, et al.
6
+ *
7
+ * Download Google/Chromium's per-country `ssl-address` postal-address metadata — the
8
+ * {@link https://github.com/google/libaddressinput libaddressinput} AddressValidationMetadata that
9
+ * seeds the per-locale field order, required-field, and upper-casing conventions.
10
+ *
11
+ * See: https://github.com/google/libaddressinput/wiki/AddressValidationMetadata
12
+ *
13
+ * Replaces the bash `ssl-address-download.sh` (curl + jq) with native `fetch` + `JSON.parse`. The
14
+ * country list lives at `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's
15
+ * record is then fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
16
+ *
17
+ * ## Usage
18
+ *
19
+ * ```sh
20
+ * node core/data/chromium-i18n/ssl-address-download.ts
21
+ * node core/data/chromium-i18n/ssl-address-download.ts --concurrency 16
22
+ * ```
23
+ *
24
+ * ## Flags
25
+ *
26
+ * - `--out-dir <path>` — destination directory; default `./ssl-address` (next to this script)
27
+ * - `--concurrency <n>` — parallel per-country fetches; default `8`
28
+ */
29
+ export {};
30
+ //# sourceMappingURL=ssl-address-download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssl-address-download.d.ts","sourceRoot":"","sources":["../../../data/chromium-i18n/ssl-address-download.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG"}
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @copyright Sister Software
4
+ * @license AGPL-3.0
5
+ * @author Teffen Ellis, et al.
6
+ *
7
+ * Download Google/Chromium's per-country `ssl-address` postal-address metadata — the
8
+ * {@link https://github.com/google/libaddressinput libaddressinput} AddressValidationMetadata that
9
+ * seeds the per-locale field order, required-field, and upper-casing conventions.
10
+ *
11
+ * See: https://github.com/google/libaddressinput/wiki/AddressValidationMetadata
12
+ *
13
+ * Replaces the bash `ssl-address-download.sh` (curl + jq) with native `fetch` + `JSON.parse`. The
14
+ * country list lives at `…/ssl-address/data` as a `~`-delimited `.countries` string; each country's
15
+ * record is then fetched from `…/ssl-address/data/<CC>` and written to `<out-dir>/<CC>.json`.
16
+ *
17
+ * ## Usage
18
+ *
19
+ * ```sh
20
+ * node core/data/chromium-i18n/ssl-address-download.ts
21
+ * node core/data/chromium-i18n/ssl-address-download.ts --concurrency 16
22
+ * ```
23
+ *
24
+ * ## Flags
25
+ *
26
+ * - `--out-dir <path>` — destination directory; default `./ssl-address` (next to this script)
27
+ * - `--concurrency <n>` — parallel per-country fetches; default `8`
28
+ */
29
+ ///<reference types="node" />
30
+ import { mkdir, writeFile } from "node:fs/promises";
31
+ import { join } from "node:path";
32
+ import { fileURLToPath } from "node:url";
33
+ import { parseArgs } from "node:util";
34
+ const BASE_URL = "https://chromium-i18n.appspot.com/ssl-address/data";
35
+ function parseCLIArgs() {
36
+ const { values } = parseArgs({
37
+ options: {
38
+ "out-dir": { type: "string", default: fileURLToPath(new URL("./ssl-address/", import.meta.url)) },
39
+ concurrency: { type: "string", default: "8" },
40
+ },
41
+ });
42
+ return {
43
+ outDir: values["out-dir"],
44
+ concurrency: Number.parseInt(values.concurrency, 10),
45
+ };
46
+ }
47
+ /** Fetch the `~`-delimited country list and return it as an array of ISO codes. */
48
+ async function fetchCountryCodes() {
49
+ const res = await fetch(BASE_URL, { signal: AbortSignal.timeout(60_000) });
50
+ if (!res.ok)
51
+ throw new Error(`HTTP ${res.status} ${res.statusText} fetching country list`);
52
+ const data = (await res.json());
53
+ return (data.countries ?? "").split("~").filter(Boolean);
54
+ }
55
+ /** Fetch a single country's metadata record and write its raw JSON body to `<outDir>/<cc>.json`. */
56
+ async function fetchCountry(cc, outDir) {
57
+ const res = await fetch(`${BASE_URL}/${cc}`, { signal: AbortSignal.timeout(60_000) });
58
+ if (!res.ok)
59
+ throw new Error(`HTTP ${res.status} ${res.statusText} on ${cc}`);
60
+ await writeFile(join(outDir, `${cc}.json`), await res.text());
61
+ }
62
+ async function main() {
63
+ const { outDir, concurrency } = parseCLIArgs();
64
+ await mkdir(outDir, { recursive: true });
65
+ const codes = await fetchCountryCodes();
66
+ process.stderr.write(`=== ssl-address: ${codes.length} countries → ${outDir}\n`);
67
+ let nextSlot = 0;
68
+ let failures = 0;
69
+ const workers = Array.from({ length: Math.min(concurrency, codes.length) }, async () => {
70
+ while (true) {
71
+ const slot = nextSlot++;
72
+ if (slot >= codes.length)
73
+ return;
74
+ const cc = codes[slot];
75
+ try {
76
+ await fetchCountry(cc, outDir);
77
+ process.stderr.write(` ✓ ${cc}\n`);
78
+ }
79
+ catch (err) {
80
+ failures++;
81
+ process.stderr.write(` ✗ ${cc}: ${err.message}\n`);
82
+ }
83
+ }
84
+ });
85
+ await Promise.all(workers);
86
+ process.stderr.write(`\n=== done: ${codes.length - failures}/${codes.length} written, ${failures} failed\n`);
87
+ if (failures > 0)
88
+ process.exitCode = 1;
89
+ }
90
+ // Run main() only when invoked directly (the import-safe equivalent of Python's `if __name__ ==
91
+ // "__main__"`), so importing this module evaluates it without firing the download.
92
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
93
+ main().catch((err) => {
94
+ process.stderr.write(`fatal: ${err.message}\n${err.stack}\n`);
95
+ process.exitCode = 1;
96
+ });
97
+ }
98
+ //# sourceMappingURL=ssl-address-download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssl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@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @copyright Sister Software
4
+ * @license AGPL-3.0
5
+ * @author Teffen Ellis, et al.
6
+ *
7
+ * Download + alphabetize libpostal's `resources/dictionaries` — the per-language abbreviation,
8
+ * street-type, and synonym tables the normalizer expands against. Shallow-clones
9
+ * {@link https://github.com/openvenues/libpostal openvenues/libpostal}, sorts each dictionary file
10
+ * in place, and copies the `dictionaries/` tree next to this script.
11
+ *
12
+ * Replaces the bash `resources-download.sh`. `git clone` runs through zx's `$` (no clean native
13
+ * equivalent); everything else is `node:fs` / `node:os`. Sorting is done in-process with a plain
14
+ * code-point `Array.sort()`, which matches `LC_ALL=C sort` byte order — deterministic and free of
15
+ * the shell `sort`'s locale dependency (the original relied on the ambient locale).
16
+ *
17
+ * ## Usage
18
+ *
19
+ * ```sh
20
+ * node core/data/libpostal/resources-download.ts
21
+ * node core/data/libpostal/resources-download.ts --force # overwrite an existing ./dictionaries
22
+ * ```
23
+ *
24
+ * ## Flags
25
+ *
26
+ * - `--force` — delete an existing `./dictionaries` directory instead of erroring out
27
+ */
28
+ export {};
29
+ //# sourceMappingURL=resources-download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-download.d.ts","sourceRoot":"","sources":["../../../data/libpostal/resources-download.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG"}
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @copyright Sister Software
4
+ * @license AGPL-3.0
5
+ * @author Teffen Ellis, et al.
6
+ *
7
+ * Download + alphabetize libpostal's `resources/dictionaries` — the per-language abbreviation,
8
+ * street-type, and synonym tables the normalizer expands against. Shallow-clones
9
+ * {@link https://github.com/openvenues/libpostal openvenues/libpostal}, sorts each dictionary file
10
+ * in place, and copies the `dictionaries/` tree next to this script.
11
+ *
12
+ * Replaces the bash `resources-download.sh`. `git clone` runs through zx's `$` (no clean native
13
+ * equivalent); everything else is `node:fs` / `node:os`. Sorting is done in-process with a plain
14
+ * code-point `Array.sort()`, which matches `LC_ALL=C sort` byte order — deterministic and free of
15
+ * the shell `sort`'s locale dependency (the original relied on the ambient locale).
16
+ *
17
+ * ## Usage
18
+ *
19
+ * ```sh
20
+ * node core/data/libpostal/resources-download.ts
21
+ * node core/data/libpostal/resources-download.ts --force # overwrite an existing ./dictionaries
22
+ * ```
23
+ *
24
+ * ## Flags
25
+ *
26
+ * - `--force` — delete an existing `./dictionaries` directory instead of erroring out
27
+ */
28
+ ///<reference types="node" />
29
+ import { cp, mkdtemp, readdir, readFile, rm, stat, writeFile } from "node:fs/promises";
30
+ import { tmpdir } from "node:os";
31
+ import { join } from "node:path";
32
+ import { fileURLToPath } from "node:url";
33
+ import { parseArgs } from "node:util";
34
+ import { $ } from "zx";
35
+ const REPO_URL = "https://github.com/openvenues/libpostal.git";
36
+ const DICTIONARIES_DIR = fileURLToPath(new URL("./dictionaries", import.meta.url));
37
+ function parseCLIArgs() {
38
+ const { values } = parseArgs({
39
+ options: {
40
+ force: { type: "boolean", default: false },
41
+ },
42
+ });
43
+ return { force: values.force };
44
+ }
45
+ /** Whether a path exists and is a directory. */
46
+ async function isDirectory(path) {
47
+ try {
48
+ return (await stat(path)).isDirectory();
49
+ }
50
+ catch {
51
+ return false;
52
+ }
53
+ }
54
+ /**
55
+ * Sort a single dictionary file in place by code point (matching `LC_ALL=C sort`). Blank lines sort to the top, exactly
56
+ * as `sort` orders empty strings; a trailing newline is preserved.
57
+ */
58
+ async function sortFileInPlace(path) {
59
+ const text = await readFile(path, "utf8");
60
+ const hadTrailingNewline = text.endsWith("\n");
61
+ const lines = text.split("\n");
62
+ // Drop the empty element produced by a trailing newline so it isn't re-sorted as a blank line.
63
+ if (hadTrailingNewline)
64
+ lines.pop();
65
+ lines.sort();
66
+ await writeFile(path, lines.join("\n") + (hadTrailingNewline ? "\n" : ""));
67
+ }
68
+ async function main() {
69
+ const { force } = parseCLIArgs();
70
+ // Guard the destination exactly as the bash version did: refuse to clobber unless --force.
71
+ if (await isDirectory(DICTIONARIES_DIR)) {
72
+ if (force) {
73
+ process.stderr.write("Warning: The dictionaries directory already exists. Deleting it due to --force flag.\n");
74
+ await rm(DICTIONARIES_DIR, { recursive: true, force: true });
75
+ }
76
+ else {
77
+ process.stderr.write("Error: The dictionaries directory already exists. Please remove it first or use the --force flag.\n");
78
+ process.exitCode = 1;
79
+ return;
80
+ }
81
+ }
82
+ const tempDir = await mkdtemp(join(tmpdir(), "libpostal-"));
83
+ try {
84
+ const cloneDir = join(tempDir, "libpostal");
85
+ await $ `git clone --depth 1 ${REPO_URL} ${cloneDir}`;
86
+ const sourceDicts = join(cloneDir, "resources", "dictionaries");
87
+ // Alphabetize the contents of each dictionary file in place.
88
+ for (const entry of await readdir(sourceDicts, { withFileTypes: true })) {
89
+ if (entry.isFile())
90
+ await sortFileInPlace(join(sourceDicts, entry.name));
91
+ }
92
+ // Copy the (now-sorted) dictionaries tree next to this script.
93
+ await cp(sourceDicts, DICTIONARIES_DIR, { recursive: true });
94
+ }
95
+ finally {
96
+ await rm(tempDir, { recursive: true, force: true });
97
+ }
98
+ }
99
+ // Run main() only when invoked directly (the import-safe equivalent of Python's `if __name__ ==
100
+ // "__main__"`), so importing this module evaluates it without cloning anything.
101
+ if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
102
+ main().catch((err) => {
103
+ process.stderr.write(`fatal: ${err.message}\n${err.stack}\n`);
104
+ process.exitCode = 1;
105
+ });
106
+ }
107
+ //# sourceMappingURL=resources-download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resources-download.js","sourceRoot":"","sources":["../../../data/libpostal/resources-download.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,6BAA6B;AAE7B,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACt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AAK,CAAC,IAAI,CAAC,CAAC,CAAA;QACzE,CAAC;QAED,+DAA+D;QAC/D,MAAM,EAAE,CAAC,WAAW,EAAE,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7D,CAAC;YAAS,CAAC;QACV,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACpD,CAAC;AACF,CAAC;AAED,gGAAgG;AAChG,gFAAgF;AAChF,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3E,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAU,EAAE,EAAE;QAC3B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,CAAC,OAAO,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAA;QAC7D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IACrB,CAAC,CAAC,CAAA;AACH,CAAC"}
@@ -14,8 +14,8 @@
14
14
  */
15
15
  /**
16
16
  * Empty schema marker. Consumers declare their own schema interface and pass it directly to `new
17
- * Kysely<MySchema>({...})` or instantiate `new DatabaseClient<MySchema>(...)` once `DatabaseClient`
18
- * becomes generic (Phase 4.2 work).
17
+ * Kysely<MySchema>({...})` or instantiate `new DatabaseClient<MySchema>(...)` once `DatabaseClient` becomes generic
18
+ * (Phase 4.2 work).
19
19
  */
20
20
  export type Database = Record<string, never>;
21
21
  //# sourceMappingURL=schema.d.ts.map
@@ -34,9 +34,9 @@
34
34
  import type { ClassificationProposal } from "../types/index.js";
35
35
  import type { AddressTree } from "./types.js";
36
36
  /**
37
- * Edit the nested neural argmax tree with the solved v0 (rule) parse under the `rule_preferred`
38
- * route — relabel same-span tag disagreements toward rule, add rule-only non-overlapping missing
39
- * tags. Containment-preserving (no flatten, no restructure). Input is not mutated.
37
+ * Edit the nested neural argmax tree with the solved v0 (rule) parse under the `rule_preferred` route — relabel
38
+ * same-span tag disagreements toward rule, add rule-only non-overlapping missing tags. Containment-preserving (no
39
+ * flatten, no restructure). Input is not mutated.
40
40
  *
41
41
  * @param tree The neural argmax `AddressTree`.
42
42
  * @param ruleProposals Proposals from the solved v0 parse (`solutionToProposals`).
@@ -1 +1 @@
1
- {"version":3,"file":"arbitrate-tree.d.ts","sourceRoot":"","sources":["../../decoder/arbitrate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAU1D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,sBAAsB,EAAE,GAAG,WAAW,CAgDrH"}
1
+ {"version":3,"file":"arbitrate-tree.d.ts","sourceRoot":"","sources":["../../decoder/arbitrate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAU1D;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,sBAAsB,EAAE,GAAG,WAAW,CAuDrH"}