@mailwoman/corpus 8.0.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) hide show
  1. package/out/src/adapter.d.ts +15 -5
  2. package/out/src/adapter.d.ts.map +1 -1
  3. package/out/src/adapter.js +11 -9
  4. package/out/src/adapter.js.map +1 -1
  5. package/out/src/adapters/ban/adapter.d.ts +7 -0
  6. package/out/src/adapters/ban/adapter.d.ts.map +1 -1
  7. package/out/src/adapters/ban/adapter.js +9 -2
  8. package/out/src/adapters/ban/adapter.js.map +1 -1
  9. package/out/src/adapters/ban/street-decompose.d.ts.map +1 -1
  10. package/out/src/adapters/ban/street-decompose.js +5 -1
  11. package/out/src/adapters/ban/street-decompose.js.map +1 -1
  12. package/out/src/adapters/fcc-bdc/adapter.d.ts +14 -1
  13. package/out/src/adapters/fcc-bdc/adapter.d.ts.map +1 -1
  14. package/out/src/adapters/fcc-bdc/adapter.js +15 -2
  15. package/out/src/adapters/fcc-bdc/adapter.js.map +1 -1
  16. package/out/src/adapters/geonames/adapter.d.ts +11 -0
  17. package/out/src/adapters/geonames/adapter.d.ts.map +1 -1
  18. package/out/src/adapters/geonames/adapter.js +24 -5
  19. package/out/src/adapters/geonames/adapter.js.map +1 -1
  20. package/out/src/adapters/geonames-postal/adapter.d.ts +11 -0
  21. package/out/src/adapters/geonames-postal/adapter.d.ts.map +1 -1
  22. package/out/src/adapters/geonames-postal/adapter.js +14 -1
  23. package/out/src/adapters/geonames-postal/adapter.js.map +1 -1
  24. package/out/src/adapters/gnaf/adapter.d.ts +10 -1
  25. package/out/src/adapters/gnaf/adapter.d.ts.map +1 -1
  26. package/out/src/adapters/gnaf/adapter.js +11 -2
  27. package/out/src/adapters/gnaf/adapter.js.map +1 -1
  28. package/out/src/adapters/gnaf/assemble.d.ts +18 -6
  29. package/out/src/adapters/gnaf/assemble.d.ts.map +1 -1
  30. package/out/src/adapters/gnaf/assemble.js +16 -6
  31. package/out/src/adapters/gnaf/assemble.js.map +1 -1
  32. package/out/src/adapters/index.d.ts.map +1 -1
  33. package/out/src/adapters/index.js.map +1 -1
  34. package/out/src/adapters/openaddresses/adapter.d.ts +11 -0
  35. package/out/src/adapters/openaddresses/adapter.d.ts.map +1 -1
  36. package/out/src/adapters/openaddresses/adapter.js +18 -3
  37. package/out/src/adapters/openaddresses/adapter.js.map +1 -1
  38. package/out/src/adapters/overture/adapter.d.ts +11 -0
  39. package/out/src/adapters/overture/adapter.d.ts.map +1 -1
  40. package/out/src/adapters/overture/adapter.js +12 -1
  41. package/out/src/adapters/overture/adapter.js.map +1 -1
  42. package/out/src/adapters/state-hi-schools/adapter.d.ts +11 -0
  43. package/out/src/adapters/state-hi-schools/adapter.d.ts.map +1 -1
  44. package/out/src/adapters/state-hi-schools/adapter.js +11 -0
  45. package/out/src/adapters/state-hi-schools/adapter.js.map +1 -1
  46. package/out/src/adapters/state-ia-contractors/adapter.d.ts +11 -0
  47. package/out/src/adapters/state-ia-contractors/adapter.d.ts.map +1 -1
  48. package/out/src/adapters/state-ia-contractors/adapter.js +11 -0
  49. package/out/src/adapters/state-ia-contractors/adapter.js.map +1 -1
  50. package/out/src/adapters/state-ny-notaries/adapter.d.ts +11 -0
  51. package/out/src/adapters/state-ny-notaries/adapter.d.ts.map +1 -1
  52. package/out/src/adapters/state-ny-notaries/adapter.js +11 -0
  53. package/out/src/adapters/state-ny-notaries/adapter.js.map +1 -1
  54. package/out/src/adapters/state-tx-notaries/adapter.d.ts +11 -0
  55. package/out/src/adapters/state-tx-notaries/adapter.d.ts.map +1 -1
  56. package/out/src/adapters/state-tx-notaries/adapter.js +15 -2
  57. package/out/src/adapters/state-tx-notaries/adapter.js.map +1 -1
  58. package/out/src/adapters/synth-po-box/adapter.d.ts +11 -0
  59. package/out/src/adapters/synth-po-box/adapter.d.ts.map +1 -1
  60. package/out/src/adapters/synth-po-box/adapter.js +13 -2
  61. package/out/src/adapters/synth-po-box/adapter.js.map +1 -1
  62. package/out/src/adapters/tiger/adapter.d.ts +14 -1
  63. package/out/src/adapters/tiger/adapter.d.ts.map +1 -1
  64. package/out/src/adapters/tiger/adapter.js +19 -4
  65. package/out/src/adapters/tiger/adapter.js.map +1 -1
  66. package/out/src/adapters/tiger/street-decompose.d.ts.map +1 -1
  67. package/out/src/adapters/tiger/street-decompose.js.map +1 -1
  68. package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts +11 -0
  69. package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts.map +1 -1
  70. package/out/src/adapters/usgov-hrsa-fqhc/adapter.js +12 -1
  71. package/out/src/adapters/usgov-hrsa-fqhc/adapter.js.map +1 -1
  72. package/out/src/adapters/usgov-imls-pls/adapter.d.ts +11 -0
  73. package/out/src/adapters/usgov-imls-pls/adapter.d.ts.map +1 -1
  74. package/out/src/adapters/usgov-imls-pls/adapter.js +11 -0
  75. package/out/src/adapters/usgov-imls-pls/adapter.js.map +1 -1
  76. package/out/src/adapters/usgov-irs-bmf/adapter.d.ts +11 -0
  77. package/out/src/adapters/usgov-irs-bmf/adapter.d.ts.map +1 -1
  78. package/out/src/adapters/usgov-irs-bmf/adapter.js +17 -2
  79. package/out/src/adapters/usgov-irs-bmf/adapter.js.map +1 -1
  80. package/out/src/adapters/usgov-nad/adapter.d.ts +11 -0
  81. package/out/src/adapters/usgov-nad/adapter.d.ts.map +1 -1
  82. package/out/src/adapters/usgov-nad/adapter.js +12 -1
  83. package/out/src/adapters/usgov-nad/adapter.js.map +1 -1
  84. package/out/src/adapters/usgov-nppes/adapter.d.ts +11 -0
  85. package/out/src/adapters/usgov-nppes/adapter.d.ts.map +1 -1
  86. package/out/src/adapters/usgov-nppes/adapter.js +11 -0
  87. package/out/src/adapters/usgov-nppes/adapter.js.map +1 -1
  88. package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.d.ts +11 -0
  89. package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.d.ts.map +1 -1
  90. package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.js +15 -2
  91. package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.js.map +1 -1
  92. package/out/src/adapters/wof-admin-jp/adapter.d.ts +7 -0
  93. package/out/src/adapters/wof-admin-jp/adapter.d.ts.map +1 -1
  94. package/out/src/adapters/wof-admin-jp/adapter.js +18 -3
  95. package/out/src/adapters/wof-admin-jp/adapter.js.map +1 -1
  96. package/out/src/adapters/wof-admin-json/adapter.d.ts +13 -3
  97. package/out/src/adapters/wof-admin-json/adapter.d.ts.map +1 -1
  98. package/out/src/adapters/wof-admin-json/adapter.js +15 -5
  99. package/out/src/adapters/wof-admin-json/adapter.js.map +1 -1
  100. package/out/src/adapters/wof-postalcode-json/adapter.d.ts +7 -0
  101. package/out/src/adapters/wof-postalcode-json/adapter.d.ts.map +1 -1
  102. package/out/src/adapters/wof-postalcode-json/adapter.js +9 -2
  103. package/out/src/adapters/wof-postalcode-json/adapter.js.map +1 -1
  104. package/out/src/align.d.ts +12 -4
  105. package/out/src/align.d.ts.map +1 -1
  106. package/out/src/align.js +9 -5
  107. package/out/src/align.js.map +1 -1
  108. package/out/src/build.d.ts +24 -8
  109. package/out/src/build.d.ts.map +1 -1
  110. package/out/src/build.js +3 -3
  111. package/out/src/build.js.map +1 -1
  112. package/out/src/codex/us-fips-state.d.ts +6 -2
  113. package/out/src/codex/us-fips-state.d.ts.map +1 -1
  114. package/out/src/codex/us-fips-state.js +3 -1
  115. package/out/src/codex/us-fips-state.js.map +1 -1
  116. package/out/src/golden.d.ts +21 -7
  117. package/out/src/golden.d.ts.map +1 -1
  118. package/out/src/golden.js +18 -10
  119. package/out/src/golden.js.map +1 -1
  120. package/out/src/license.d.ts +3 -1
  121. package/out/src/license.d.ts.map +1 -1
  122. package/out/src/license.js +4 -2
  123. package/out/src/license.js.map +1 -1
  124. package/out/src/parquet-wrapper/reader.d.ts +4 -2
  125. package/out/src/parquet-wrapper/reader.d.ts.map +1 -1
  126. package/out/src/parquet-wrapper/reader.js +5 -4
  127. package/out/src/parquet-wrapper/reader.js.map +1 -1
  128. package/out/src/parquet-wrapper/schema.d.ts +14 -10
  129. package/out/src/parquet-wrapper/schema.d.ts.map +1 -1
  130. package/out/src/parquet-wrapper/schema.js +6 -2
  131. package/out/src/parquet-wrapper/schema.js.map +1 -1
  132. package/out/src/parquet-wrapper/writer.d.ts +12 -4
  133. package/out/src/parquet-wrapper/writer.d.ts.map +1 -1
  134. package/out/src/parquet-wrapper/writer.js +12 -4
  135. package/out/src/parquet-wrapper/writer.js.map +1 -1
  136. package/out/src/parquet.d.ts +21 -7
  137. package/out/src/parquet.d.ts.map +1 -1
  138. package/out/src/parquet.js +15 -4
  139. package/out/src/parquet.js.map +1 -1
  140. package/out/src/runner.d.ts +39 -13
  141. package/out/src/runner.d.ts.map +1 -1
  142. package/out/src/runner.js +7 -3
  143. package/out/src/runner.js.map +1 -1
  144. package/out/src/shard-recipes/anchor-absorption.d.ts +4 -0
  145. package/out/src/shard-recipes/anchor-absorption.d.ts.map +1 -1
  146. package/out/src/shard-recipes/anchor-absorption.js +14 -5
  147. package/out/src/shard-recipes/anchor-absorption.js.map +1 -1
  148. package/out/src/shard-recipes/boundary-stress.d.ts +4 -0
  149. package/out/src/shard-recipes/boundary-stress.d.ts.map +1 -1
  150. package/out/src/shard-recipes/boundary-stress.js +13 -7
  151. package/out/src/shard-recipes/boundary-stress.js.map +1 -1
  152. package/out/src/shard-recipes/country-balanced.d.ts +4 -0
  153. package/out/src/shard-recipes/country-balanced.d.ts.map +1 -1
  154. package/out/src/shard-recipes/country-balanced.js +39 -11
  155. package/out/src/shard-recipes/country-balanced.js.map +1 -1
  156. package/out/src/shard-recipes/cz-pcfirst-preposition.d.ts +4 -0
  157. package/out/src/shard-recipes/cz-pcfirst-preposition.d.ts.map +1 -1
  158. package/out/src/shard-recipes/cz-pcfirst-preposition.js +4 -0
  159. package/out/src/shard-recipes/cz-pcfirst-preposition.js.map +1 -1
  160. package/out/src/shard-recipes/fr-admin-split.d.ts +4 -0
  161. package/out/src/shard-recipes/fr-admin-split.d.ts.map +1 -1
  162. package/out/src/shard-recipes/fr-admin-split.js +14 -3
  163. package/out/src/shard-recipes/fr-admin-split.js.map +1 -1
  164. package/out/src/shard-recipes/fr-bare-street.d.ts +4 -0
  165. package/out/src/shard-recipes/fr-bare-street.d.ts.map +1 -1
  166. package/out/src/shard-recipes/fr-bare-street.js +4 -0
  167. package/out/src/shard-recipes/fr-bare-street.js.map +1 -1
  168. package/out/src/shard-recipes/fr-fragment.d.ts +4 -0
  169. package/out/src/shard-recipes/fr-fragment.d.ts.map +1 -1
  170. package/out/src/shard-recipes/fr-fragment.js +25 -8
  171. package/out/src/shard-recipes/fr-fragment.js.map +1 -1
  172. package/out/src/shard-recipes/fr-lieudit.d.ts +4 -0
  173. package/out/src/shard-recipes/fr-lieudit.d.ts.map +1 -1
  174. package/out/src/shard-recipes/fr-lieudit.js +21 -8
  175. package/out/src/shard-recipes/fr-lieudit.js.map +1 -1
  176. package/out/src/shard-recipes/fr-order.d.ts +4 -0
  177. package/out/src/shard-recipes/fr-order.d.ts.map +1 -1
  178. package/out/src/shard-recipes/fr-order.js +27 -8
  179. package/out/src/shard-recipes/fr-order.js.map +1 -1
  180. package/out/src/shard-recipes/german.d.ts +4 -0
  181. package/out/src/shard-recipes/german.d.ts.map +1 -1
  182. package/out/src/shard-recipes/german.js +16 -6
  183. package/out/src/shard-recipes/german.js.map +1 -1
  184. package/out/src/shard-recipes/house-venue.d.ts +4 -0
  185. package/out/src/shard-recipes/house-venue.d.ts.map +1 -1
  186. package/out/src/shard-recipes/house-venue.js +4 -0
  187. package/out/src/shard-recipes/house-venue.js.map +1 -1
  188. package/out/src/shard-recipes/index.d.ts +9 -3
  189. package/out/src/shard-recipes/index.d.ts.map +1 -1
  190. package/out/src/shard-recipes/index.js +12 -4
  191. package/out/src/shard-recipes/index.js.map +1 -1
  192. package/out/src/shard-recipes/intersection.d.ts +4 -0
  193. package/out/src/shard-recipes/intersection.d.ts.map +1 -1
  194. package/out/src/shard-recipes/intersection.js +27 -13
  195. package/out/src/shard-recipes/intersection.js.map +1 -1
  196. package/out/src/shard-recipes/locale.d.ts +4 -0
  197. package/out/src/shard-recipes/locale.d.ts.map +1 -1
  198. package/out/src/shard-recipes/locale.js +9 -4
  199. package/out/src/shard-recipes/locale.js.map +1 -1
  200. package/out/src/shard-recipes/nl-postcode.d.ts +4 -0
  201. package/out/src/shard-recipes/nl-postcode.d.ts.map +1 -1
  202. package/out/src/shard-recipes/nl-postcode.js +8 -2
  203. package/out/src/shard-recipes/nl-postcode.js.map +1 -1
  204. package/out/src/shard-recipes/no-fragment.d.ts +4 -0
  205. package/out/src/shard-recipes/no-fragment.d.ts.map +1 -1
  206. package/out/src/shard-recipes/no-fragment.js +8 -2
  207. package/out/src/shard-recipes/no-fragment.js.map +1 -1
  208. package/out/src/shard-recipes/no-street-led.d.ts +4 -0
  209. package/out/src/shard-recipes/no-street-led.d.ts.map +1 -1
  210. package/out/src/shard-recipes/no-street-led.js +5 -1
  211. package/out/src/shard-recipes/no-street-led.js.map +1 -1
  212. package/out/src/shard-recipes/no-street.d.ts +4 -0
  213. package/out/src/shard-recipes/no-street.d.ts.map +1 -1
  214. package/out/src/shard-recipes/no-street.js +4 -0
  215. package/out/src/shard-recipes/no-street.js.map +1 -1
  216. package/out/src/shard-recipes/po-box-cedex.d.ts +4 -0
  217. package/out/src/shard-recipes/po-box-cedex.d.ts.map +1 -1
  218. package/out/src/shard-recipes/po-box-cedex.js +99 -43
  219. package/out/src/shard-recipes/po-box-cedex.js.map +1 -1
  220. package/out/src/shard-recipes/po-box.d.ts +4 -0
  221. package/out/src/shard-recipes/po-box.d.ts.map +1 -1
  222. package/out/src/shard-recipes/po-box.js +4 -0
  223. package/out/src/shard-recipes/po-box.js.map +1 -1
  224. package/out/src/shard-recipes/scaffold.d.ts +48 -16
  225. package/out/src/shard-recipes/scaffold.d.ts.map +1 -1
  226. package/out/src/shard-recipes/scaffold.js +10 -6
  227. package/out/src/shard-recipes/scaffold.js.map +1 -1
  228. package/out/src/shard-recipes/si-bare-village.d.ts +4 -0
  229. package/out/src/shard-recipes/si-bare-village.d.ts.map +1 -1
  230. package/out/src/shard-recipes/si-bare-village.js +4 -0
  231. package/out/src/shard-recipes/si-bare-village.js.map +1 -1
  232. package/out/src/shard-recipes/street-affix.d.ts +4 -0
  233. package/out/src/shard-recipes/street-affix.d.ts.map +1 -1
  234. package/out/src/shard-recipes/street-affix.js +29 -10
  235. package/out/src/shard-recipes/street-affix.js.map +1 -1
  236. package/out/src/shard-recipes/street-bare.d.ts +4 -0
  237. package/out/src/shard-recipes/street-bare.d.ts.map +1 -1
  238. package/out/src/shard-recipes/street-bare.js +4 -0
  239. package/out/src/shard-recipes/street-bare.js.map +1 -1
  240. package/out/src/shard-recipes/street.d.ts +4 -0
  241. package/out/src/shard-recipes/street.d.ts.map +1 -1
  242. package/out/src/shard-recipes/street.js +4 -0
  243. package/out/src/shard-recipes/street.js.map +1 -1
  244. package/out/src/shard-recipes/unit.d.ts +4 -0
  245. package/out/src/shard-recipes/unit.d.ts.map +1 -1
  246. package/out/src/shard-recipes/unit.js +45 -14
  247. package/out/src/shard-recipes/unit.js.map +1 -1
  248. package/out/src/split.d.ts +18 -6
  249. package/out/src/split.d.ts.map +1 -1
  250. package/out/src/split.js +4 -2
  251. package/out/src/split.js.map +1 -1
  252. package/out/src/synthesize-anchor-absorption.d.ts +7 -1
  253. package/out/src/synthesize-anchor-absorption.d.ts.map +1 -1
  254. package/out/src/synthesize-anchor-absorption.js +28 -14
  255. package/out/src/synthesize-anchor-absorption.js.map +1 -1
  256. package/out/src/synthesize-boundary-stress.d.ts +3 -1
  257. package/out/src/synthesize-boundary-stress.d.ts.map +1 -1
  258. package/out/src/synthesize-boundary-stress.js +35 -28
  259. package/out/src/synthesize-boundary-stress.js.map +1 -1
  260. package/out/src/synthesize-german.d.ts +15 -5
  261. package/out/src/synthesize-german.d.ts.map +1 -1
  262. package/out/src/synthesize-german.js +9 -3
  263. package/out/src/synthesize-german.js.map +1 -1
  264. package/out/src/synthesize-house-venue.d.ts.map +1 -1
  265. package/out/src/synthesize-house-venue.js +15 -15
  266. package/out/src/synthesize-house-venue.js.map +1 -1
  267. package/out/src/synthesize-intersection.d.ts +9 -3
  268. package/out/src/synthesize-intersection.d.ts.map +1 -1
  269. package/out/src/synthesize-intersection.js +25 -6
  270. package/out/src/synthesize-intersection.js.map +1 -1
  271. package/out/src/synthesize-no-street.d.ts +3 -1
  272. package/out/src/synthesize-no-street.d.ts.map +1 -1
  273. package/out/src/synthesize-no-street.js +5 -6
  274. package/out/src/synthesize-no-street.js.map +1 -1
  275. package/out/src/synthesize-po-box.d.ts +15 -5
  276. package/out/src/synthesize-po-box.d.ts.map +1 -1
  277. package/out/src/synthesize-po-box.js +21 -7
  278. package/out/src/synthesize-po-box.js.map +1 -1
  279. package/out/src/synthesize-street.d.ts +3 -1
  280. package/out/src/synthesize-street.d.ts.map +1 -1
  281. package/out/src/synthesize-street.js +6 -1
  282. package/out/src/synthesize-street.js.map +1 -1
  283. package/out/src/synthesize.d.ts +39 -13
  284. package/out/src/synthesize.d.ts.map +1 -1
  285. package/out/src/synthesize.js +66 -36
  286. package/out/src/synthesize.js.map +1 -1
  287. package/out/src/tokenize.d.ts +15 -5
  288. package/out/src/tokenize.d.ts.map +1 -1
  289. package/out/src/tokenize.js.map +1 -1
  290. package/out/src/tools/align-shard.d.ts.map +1 -1
  291. package/out/src/tools/align-shard.js +3 -1
  292. package/out/src/tools/align-shard.js.map +1 -1
  293. package/out/src/tools/audit.d.ts.map +1 -1
  294. package/out/src/tools/audit.js +20 -8
  295. package/out/src/tools/audit.js.map +1 -1
  296. package/out/src/tools/corpus-stats.d.ts.map +1 -1
  297. package/out/src/tools/corpus-stats.js.map +1 -1
  298. package/out/src/tools/fetch/ban.d.ts.map +1 -1
  299. package/out/src/tools/fetch/ban.js +17 -10
  300. package/out/src/tools/fetch/ban.js.map +1 -1
  301. package/out/src/tools/fetch/download.d.ts +30 -10
  302. package/out/src/tools/fetch/download.d.ts.map +1 -1
  303. package/out/src/tools/fetch/download.js +26 -6
  304. package/out/src/tools/fetch/download.js.map +1 -1
  305. package/out/src/tools/fetch/hrsa.d.ts.map +1 -1
  306. package/out/src/tools/fetch/hrsa.js.map +1 -1
  307. package/out/src/tools/fetch/imls-pls.d.ts.map +1 -1
  308. package/out/src/tools/fetch/imls-pls.js +18 -18
  309. package/out/src/tools/fetch/imls-pls.js.map +1 -1
  310. package/out/src/tools/fetch/index.d.ts +3 -1
  311. package/out/src/tools/fetch/index.d.ts.map +1 -1
  312. package/out/src/tools/fetch/index.js +3 -1
  313. package/out/src/tools/fetch/index.js.map +1 -1
  314. package/out/src/tools/fetch/nad.d.ts +21 -7
  315. package/out/src/tools/fetch/nad.d.ts.map +1 -1
  316. package/out/src/tools/fetch/nad.js +5 -5
  317. package/out/src/tools/fetch/nad.js.map +1 -1
  318. package/out/src/tools/fetch/nppes.d.ts.map +1 -1
  319. package/out/src/tools/fetch/nppes.js +9 -15
  320. package/out/src/tools/fetch/nppes.js.map +1 -1
  321. package/out/src/tools/fetch/openaddresses.d.ts +3 -1
  322. package/out/src/tools/fetch/openaddresses.d.ts.map +1 -1
  323. package/out/src/tools/fetch/openaddresses.js +32 -23
  324. package/out/src/tools/fetch/openaddresses.js.map +1 -1
  325. package/out/src/tools/fetch/ppd.d.ts +3 -1
  326. package/out/src/tools/fetch/ppd.d.ts.map +1 -1
  327. package/out/src/tools/fetch/ppd.js +14 -3
  328. package/out/src/tools/fetch/ppd.js.map +1 -1
  329. package/out/src/tools/fetch/state-hi-schools.d.ts.map +1 -1
  330. package/out/src/tools/fetch/state-hi-schools.js +13 -6
  331. package/out/src/tools/fetch/state-hi-schools.js.map +1 -1
  332. package/out/src/tools/fetch/state-sources.d.ts.map +1 -1
  333. package/out/src/tools/fetch/state-sources.js +8 -3
  334. package/out/src/tools/fetch/state-sources.js.map +1 -1
  335. package/out/src/tools/fetch/tiger-full.d.ts +9 -3
  336. package/out/src/tools/fetch/tiger-full.d.ts.map +1 -1
  337. package/out/src/tools/fetch/tiger-full.js +35 -20
  338. package/out/src/tools/fetch/tiger-full.js.map +1 -1
  339. package/out/src/tools/gb-title-case.d.ts.map +1 -1
  340. package/out/src/tools/gb-title-case.js.map +1 -1
  341. package/out/src/tools/golden-expand.d.ts +24 -8
  342. package/out/src/tools/golden-expand.d.ts.map +1 -1
  343. package/out/src/tools/golden-expand.js +20 -12
  344. package/out/src/tools/golden-expand.js.map +1 -1
  345. package/out/src/tools/golden-promote.d.ts +18 -6
  346. package/out/src/tools/golden-promote.d.ts.map +1 -1
  347. package/out/src/tools/golden-promote.js +22 -7
  348. package/out/src/tools/golden-promote.js.map +1 -1
  349. package/out/src/tools/ingest-csv.d.ts +3 -1
  350. package/out/src/tools/ingest-csv.d.ts.map +1 -1
  351. package/out/src/tools/ingest-csv.js +17 -19
  352. package/out/src/tools/ingest-csv.js.map +1 -1
  353. package/out/src/tools/jsonl-to-parquet.d.ts +18 -6
  354. package/out/src/tools/jsonl-to-parquet.d.ts.map +1 -1
  355. package/out/src/tools/jsonl-to-parquet.js +11 -5
  356. package/out/src/tools/jsonl-to-parquet.js.map +1 -1
  357. package/out/src/tools/lint-shard-vocab.d.ts +36 -12
  358. package/out/src/tools/lint-shard-vocab.d.ts.map +1 -1
  359. package/out/src/tools/lint-shard-vocab.js +25 -11
  360. package/out/src/tools/lint-shard-vocab.js.map +1 -1
  361. package/out/src/tools/lint-shard.d.ts +30 -10
  362. package/out/src/tools/lint-shard.d.ts.map +1 -1
  363. package/out/src/tools/lint-shard.js +33 -20
  364. package/out/src/tools/lint-shard.js.map +1 -1
  365. package/out/src/tools/overlay-manifest.d.ts.map +1 -1
  366. package/out/src/tools/overlay-manifest.js +6 -4
  367. package/out/src/tools/overlay-manifest.js.map +1 -1
  368. package/out/src/tools/shard-kryptonite.d.ts +6 -2
  369. package/out/src/tools/shard-kryptonite.d.ts.map +1 -1
  370. package/out/src/tools/shard-kryptonite.js +1 -1
  371. package/out/src/tools/shard-kryptonite.js.map +1 -1
  372. package/out/src/tools/shard-translit.d.ts +9 -3
  373. package/out/src/tools/shard-translit.d.ts.map +1 -1
  374. package/out/src/tools/shard-translit.js +2 -2
  375. package/out/src/tools/shard-translit.js.map +1 -1
  376. package/out/src/types.d.ts +51 -17
  377. package/out/src/types.d.ts.map +1 -1
  378. package/out/src/wof-json.d.ts +9 -3
  379. package/out/src/wof-json.d.ts.map +1 -1
  380. package/out/src/wof-json.js +6 -4
  381. package/out/src/wof-json.js.map +1 -1
  382. package/package.json +7 -6
  383. package/src/adapter.ts +24 -13
  384. package/src/adapters/ban/adapter.ts +12 -2
  385. package/src/adapters/ban/street-decompose.ts +7 -1
  386. package/src/adapters/fcc-bdc/adapter.ts +19 -3
  387. package/src/adapters/geonames/adapter.ts +28 -5
  388. package/src/adapters/geonames-postal/adapter.ts +17 -1
  389. package/src/adapters/gnaf/adapter.ts +15 -2
  390. package/src/adapters/gnaf/assemble.ts +40 -10
  391. package/src/adapters/index.ts +13 -0
  392. package/src/adapters/openaddresses/adapter.ts +22 -3
  393. package/src/adapters/overture/adapter.ts +18 -2
  394. package/src/adapters/state-hi-schools/adapter.ts +15 -0
  395. package/src/adapters/state-ia-contractors/adapter.ts +15 -0
  396. package/src/adapters/state-ny-notaries/adapter.ts +15 -0
  397. package/src/adapters/state-tx-notaries/adapter.ts +18 -2
  398. package/src/adapters/synth-po-box/adapter.ts +19 -2
  399. package/src/adapters/tiger/adapter.ts +23 -4
  400. package/src/adapters/tiger/street-decompose.ts +1 -0
  401. package/src/adapters/usgov-hrsa-fqhc/adapter.ts +18 -2
  402. package/src/adapters/usgov-imls-pls/adapter.ts +15 -0
  403. package/src/adapters/usgov-irs-bmf/adapter.ts +19 -2
  404. package/src/adapters/usgov-nad/adapter.ts +14 -1
  405. package/src/adapters/usgov-nppes/adapter.ts +13 -0
  406. package/src/adapters/usgov-samhsa-treatment-locator/adapter.ts +21 -3
  407. package/src/adapters/wof-admin-jp/adapter.ts +20 -3
  408. package/src/adapters/wof-admin-json/adapter.ts +22 -7
  409. package/src/adapters/wof-postalcode-json/adapter.ts +10 -2
  410. package/src/align.ts +21 -8
  411. package/src/build.ts +48 -11
  412. package/src/codex/us-fips-state.ts +6 -2
  413. package/src/golden.ts +28 -13
  414. package/src/license.ts +4 -2
  415. package/src/parquet-wrapper/reader.ts +6 -4
  416. package/src/parquet-wrapper/schema.ts +14 -10
  417. package/src/parquet-wrapper/writer.ts +12 -4
  418. package/src/parquet.ts +39 -8
  419. package/src/runner.ts +49 -15
  420. package/src/shard-recipes/anchor-absorption.ts +21 -5
  421. package/src/shard-recipes/boundary-stress.ts +20 -7
  422. package/src/shard-recipes/country-balanced.ts +78 -13
  423. package/src/shard-recipes/cz-pcfirst-preposition.ts +9 -0
  424. package/src/shard-recipes/fr-admin-split.ts +30 -5
  425. package/src/shard-recipes/fr-bare-street.ts +10 -0
  426. package/src/shard-recipes/fr-fragment.ts +33 -8
  427. package/src/shard-recipes/fr-lieudit.ts +35 -9
  428. package/src/shard-recipes/fr-order.ts +47 -9
  429. package/src/shard-recipes/german.ts +32 -6
  430. package/src/shard-recipes/house-venue.ts +7 -0
  431. package/src/shard-recipes/index.ts +12 -4
  432. package/src/shard-recipes/intersection.ts +63 -14
  433. package/src/shard-recipes/locale.ts +37 -4
  434. package/src/shard-recipes/nl-postcode.ts +12 -2
  435. package/src/shard-recipes/no-fragment.ts +12 -2
  436. package/src/shard-recipes/no-street-led.ts +11 -1
  437. package/src/shard-recipes/no-street.ts +7 -0
  438. package/src/shard-recipes/po-box-cedex.ts +145 -45
  439. package/src/shard-recipes/po-box.ts +7 -0
  440. package/src/shard-recipes/scaffold.ts +52 -20
  441. package/src/shard-recipes/si-bare-village.ts +9 -0
  442. package/src/shard-recipes/street-affix.ts +88 -13
  443. package/src/shard-recipes/street-bare.ts +10 -0
  444. package/src/shard-recipes/street.ts +7 -0
  445. package/src/shard-recipes/unit.ts +79 -16
  446. package/src/split.ts +28 -7
  447. package/src/synthesize-anchor-absorption.ts +41 -14
  448. package/src/synthesize-boundary-stress.ts +57 -30
  449. package/src/synthesize-german.ts +30 -7
  450. package/src/synthesize-house-venue.ts +22 -16
  451. package/src/synthesize-intersection.ts +34 -7
  452. package/src/synthesize-no-street.ts +18 -10
  453. package/src/synthesize-po-box.ts +42 -10
  454. package/src/synthesize-street.ts +10 -2
  455. package/src/synthesize.ts +81 -38
  456. package/src/tokenize.ts +15 -5
  457. package/src/tools/align-shard.ts +6 -1
  458. package/src/tools/audit.ts +57 -11
  459. package/src/tools/corpus-stats.ts +9 -0
  460. package/src/tools/fetch/ban.ts +32 -10
  461. package/src/tools/fetch/download.ts +49 -12
  462. package/src/tools/fetch/hrsa.ts +3 -0
  463. package/src/tools/fetch/imls-pls.ts +28 -18
  464. package/src/tools/fetch/index.ts +3 -1
  465. package/src/tools/fetch/nad.ts +39 -12
  466. package/src/tools/fetch/nppes.ts +17 -15
  467. package/src/tools/fetch/openaddresses.ts +52 -24
  468. package/src/tools/fetch/ppd.ts +22 -3
  469. package/src/tools/fetch/state-hi-schools.ts +17 -6
  470. package/src/tools/fetch/state-sources.ts +16 -3
  471. package/src/tools/fetch/tiger-full.ts +66 -23
  472. package/src/tools/gb-title-case.ts +1 -0
  473. package/src/tools/golden-expand.ts +64 -20
  474. package/src/tools/golden-promote.ts +53 -13
  475. package/src/tools/ingest-csv.ts +41 -26
  476. package/src/tools/jsonl-to-parquet.ts +30 -10
  477. package/src/tools/lint-shard-vocab.ts +75 -24
  478. package/src/tools/lint-shard.ts +75 -31
  479. package/src/tools/overlay-manifest.ts +7 -4
  480. package/src/tools/shard-kryptonite.ts +11 -3
  481. package/src/tools/shard-translit.ts +20 -5
  482. package/src/types.ts +51 -17
  483. package/src/wof-json.ts +18 -7
@@ -51,6 +51,12 @@
51
51
 
52
52
  import type { CanonicalRow } from "./types.ts"
53
53
 
54
+ /* oxlint-disable sister-software/no-unnamed-threshold -- the bare decimals below are weighted-sampler
55
+ cutoffs, not thresholds: `const r = random()` followed by a cascade of `r < 0.4` branches IS the
56
+ output distribution, and reading the cascade top-to-bottom is how you see it. Naming each cutoff
57
+ would hide the distribution behind a wall of identifiers. Genuine thresholds in these files are
58
+ extracted as named constants above. */
59
+
54
60
  export type BoundaryStressTemplate =
55
61
  | "street-eats-affix"
56
62
  | "comma-less-city-state"
@@ -59,7 +65,9 @@ export type BoundaryStressTemplate =
59
65
  // Added 2026-06-18 after the v1.6.0 probes (the shard's NARROW distribution over-fit "full structured
60
66
  // address" and regressed OOD). These two re-balance the contexts the model actually sees:
61
67
  | "bare-locality" // the ship-blocker fix: locality with NO street (the 84%-dropped "City, STATE" rows)
62
- | "house-number-before-street" // the confounding mirror of house-number-after-street (number position)
68
+ | "house-number-before-street"
69
+
70
+ // the confounding mirror of house-number-after-street (number position)
63
71
 
64
72
  export interface BoundaryStressBaseTuple {
65
73
  locality: string
@@ -70,7 +78,9 @@ export interface BoundaryStressBaseTuple {
70
78
 
71
79
  export interface BoundaryStressSynthesisOpts {
72
80
  random?: () => number
73
- /** Force a specific shape (tests + balanced shard composition). */
81
+ /**
82
+ * Force a specific shape (tests + balanced shard composition).
83
+ */
74
84
  forceTemplate?: BoundaryStressTemplate
75
85
  }
76
86
 
@@ -85,10 +95,12 @@ function pick<T>(arr: ReadonlyArray<T>, random: () => number): T {
85
95
  return arr[Math.floor(random() * arr.length)]!
86
96
  }
87
97
 
88
- // Multi-word street names — the suffix boundary only bites when "Club" could be read as part of the
89
- // name. Single-word names alone teach nothing about the suffix edge.
90
- // Multi-word names are what make the suffix boundary BITE (the model must not read the trailing
91
- // suffix word as part of the name). Kept diverse so the shard teaches the boundary, not the lexeme.
98
+ /**
99
+ * Multi-word street names — the suffix boundary only bites when "Club" could be read as part of the name. Single-word
100
+ * names alone teach nothing about the suffix edge. Multi-word names are what make the suffix boundary BITE (the model
101
+ * must not read the trailing suffix word as part of the name). Kept diverse so the shard teaches the boundary, not the
102
+ * lexeme.
103
+ */
92
104
  const MULTIWORD_STREETS = [
93
105
  "Country Club",
94
106
  "Martin Luther King",
@@ -136,6 +148,7 @@ const MULTIWORD_STREETS = [
136
148
  "Queens Gate",
137
149
  "Princeton Junction",
138
150
  ] as const
151
+
139
152
  const SINGLE_STREETS = [
140
153
  "Main",
141
154
  "Oak",
@@ -177,6 +190,7 @@ const SINGLE_STREETS = [
177
190
  "12th",
178
191
  "42nd",
179
192
  ] as const
193
+
180
194
  const SUFFIXES = [
181
195
  "St",
182
196
  "Street",
@@ -209,10 +223,13 @@ const SUFFIXES = [
209
223
  "Row",
210
224
  "Walk",
211
225
  ] as const
226
+
212
227
  const DIRECTIONALS = ["N", "S", "E", "W", "NE", "NW", "SE", "SW"] as const
213
228
 
214
- // FR street-type prefixes + hyphenated honorific street names (the hyphen is incidental; the boundary
215
- // stress is the prefix↔name split + the number-after-street order).
229
+ /**
230
+ * FR street-type prefixes + hyphenated honorific street names (the hyphen is incidental; the boundary stress is the
231
+ * prefix↔name split + the number-after-street order).
232
+ */
216
233
  const FR_PREFIXES = [
217
234
  "Rue",
218
235
  "Avenue",
@@ -229,6 +246,7 @@ const FR_PREFIXES = [
229
246
  "Sentier",
230
247
  "Promenade",
231
248
  ] as const
249
+
232
250
  const FR_NAMES = [
233
251
  "Jean-Baptiste Lebas",
234
252
  "Neuve-des-Capucines",
@@ -256,19 +274,18 @@ const FR_NAMES = [
256
274
  "Aristide-Briand",
257
275
  ] as const
258
276
 
259
- // Org/venue prefixes for the bare-locality shape — the v1.6.0 locality drop hit org-PREFIXED real rows
260
- // hardest ("LISBON PUBLIC LIBRARY, …, Lisbon ND"; "Alburg Health Center"). Teaching the locality WITH a
261
- // leading venue keeps the model emitting it on facility-style addresses (NPPES/HRSA shapes). `venue` is a
262
- // base ComponentTag.
263
- //
264
- // #511-LINTED 2026-06-18 (scripts/lint-venue-vocab — scan of nppes/hrsa/tiger/nad/wof-admin): every token
265
- // here is venue-DOMINANT in the base, so the shard agrees with it. The first draft was naive — 9 terms
266
- // were dropped because their tokens are dominantly street/locality and would CONTRADICT the base the way
267
- // Madison-as-street did (#511): "Fire" 93% street, "Veterans" 94% street, "City" 68% locality, "Hall" 63%
268
- // street, "Memorial"/"Hospital" 62-63% street, "Recreation" 79% street, "Town" 48% locality, "Library" 51%
269
- // street, "County" 68% street, "Arts"/"Courthouse"/"Municipal" dependent_locality. Kept tokens: Clinic 98%,
270
- // Practice 98%, Dental 100%, Health 99%, Medical 88%, Community 92%, Department 90%, Group 87%, Center 65%,
271
- // School 70%, Public 89%, Elementary/Family 97% (all venue).
277
+ /**
278
+ * Org/venue prefixes for the bare-locality shape — the v1.6.0 locality drop hit org-PREFIXED real rows hardest ("LISBON
279
+ * PUBLIC LIBRARY, …, Lisbon ND"; "Alburg Health Center"). Teaching the locality WITH a leading venue keeps the model
280
+ * emitting it on facility-style addresses (NPPES/HRSA shapes). `venue` is a base ComponentTag. #511-LINTED 2026-06-18
281
+ * (scripts/lint-venue-vocab — scan of nppes/hrsa/tiger/nad/wof-admin): every token here is venue-DOMINANT in the base,
282
+ * so the shard agrees with it. The first draft was naive — 9 terms were dropped because their tokens are dominantly
283
+ * street/locality and would CONTRADICT the base the way Madison-as-street did (#511): "Fire" 93% street, "Veterans" 94%
284
+ * street, "City" 68% locality, "Hall" 63% street, "Memorial"/"Hospital" 62-63% street, "Recreation" 79% street, "Town"
285
+ * 48% locality, "Library" 51% street, "County" 68% street, "Arts"/"Courthouse"/"Municipal" dependent_locality. Kept
286
+ * tokens: Clinic 98%, Practice 98%, Dental 100%, Health 99%, Medical 88%, Community 92%, Department 90%, Group 87%,
287
+ * Center 65%, School 70%, Public 89%, Elementary/Family 97% (all venue).
288
+ */
272
289
  const VENUES = [
273
290
  "Community Center",
274
291
  "Health Center",
@@ -286,10 +303,12 @@ const VENUES = [
286
303
  "Public School",
287
304
  ] as const
288
305
 
289
- // Localities DERIVED from the base corpus (#511): every name here is verified locality-DOMINANT in the
290
- // training data (B-locality ≫ I-street), so the shard agrees with the base instead of fighting it. The
291
- // night's targeted scan caught the prior vocab (Madison, Portland, Springfield IL…) at 92–100% STREET
292
- // in the base ("Madison Ave"), the "5th Avenue Theatre" #511 trap. See 2026-06-17-locality-vocab-fix.
306
+ /**
307
+ * Localities DERIVED from the base corpus (#511): every name here is verified locality-DOMINANT in the training data
308
+ * (B-locality ≫ I-street), so the shard agrees with the base instead of fighting it. The night's targeted scan caught
309
+ * the prior vocab (Madison, Portland, Springfield IL…) at 92–100% STREET in the base ("Madison Ave"), the "5th Avenue
310
+ * Theatre" #511 trap. See 2026-06-17-locality-vocab-fix.
311
+ */
293
312
  const US_TUPLES: ReadonlyArray<BoundaryStressBaseTuple> = [
294
313
  { locality: "Albuquerque", region: "NM", postcode: "87102", country: "US" },
295
314
  { locality: "Indianapolis", region: "IN", postcode: "46203", country: "US" },
@@ -320,11 +339,14 @@ const US_TUPLES: ReadonlyArray<BoundaryStressBaseTuple> = [
320
339
  { locality: "Chicago", region: "IL", postcode: "60625", country: "US" },
321
340
  { locality: "Springfield", region: "MA", postcode: "01108", country: "US" },
322
341
  ]
323
- // FR localities DERIVED from the FR (ban) shards specifically — where these famous cities are 95–99%
324
- // locality-DOMINANT (Paris 515605/24789, Marseille 247014/1752, Lyon 106239/3114). NB: the all-shard
325
- // scan falsely flagged them street-dominant by undersampling the FR block (parts 180–209) and mixing in
326
- // US street-contexts; the FR-block scan is the honest distribution. Dept-diverse (28 depts), region
327
- // empty (French addresses carry no region token; the generator's region-optional path handles it).
342
+
343
+ /**
344
+ * FR localities DERIVED from the FR (ban) shards specifically — where these famous cities are 95–99% locality-DOMINANT
345
+ * (Paris 515605/24789, Marseille 247014/1752, Lyon 106239/3114). NB: the all-shard scan falsely flagged them
346
+ * street-dominant by undersampling the FR block (parts 180–209) and mixing in US street-contexts; the FR-block scan is
347
+ * the honest distribution. Dept-diverse (28 depts), region empty (French addresses carry no region token; the
348
+ * generator's region-optional path handles it).
349
+ */
328
350
  const FR_TUPLES: ReadonlyArray<BoundaryStressBaseTuple> = [
329
351
  { locality: "Paris", region: "", postcode: "75003", country: "FR" },
330
352
  { locality: "Marseille", region: "", postcode: "13016", country: "FR" },
@@ -345,6 +367,7 @@ const FR_TUPLES: ReadonlyArray<BoundaryStressBaseTuple> = [
345
367
  { locality: "Brunoy", region: "", postcode: "91800", country: "FR" },
346
368
  { locality: "Rambouillet", region: "", postcode: "78120", country: "FR" },
347
369
  ]
370
+
348
371
  // NB: no DE_TUPLES — German cities are street-dominated too ("Berliner Straße"), and the base yielded
349
372
  // zero locality-dominant DE towns in the scan, so house-number-after-street is FR-only here. DE's
350
373
  // native-order number-after-street is covered by the dedicated synth-german shard.
@@ -400,6 +423,7 @@ export function synthesizeBoundaryStressRow(
400
423
  template,
401
424
  }
402
425
  }
426
+
403
427
  const withZip = random() < 0.5
404
428
  const comma = random() < 0.6 ? "," : "" // include the comma-LESS "City STATE" form too
405
429
  // "United States" (United 98% / States 98% country in the base), NOT "USA" — the #511 lint found
@@ -465,6 +489,7 @@ export function synthesizeBoundaryStressRow(
465
489
  template,
466
490
  }
467
491
  }
492
+
468
493
  // house-number-after-street: "{name} {hn}, {postcode} {locality}" — number FOLLOWS the street.
469
494
  const raw = `${name} ${hn}, ${b.postcode} ${b.locality}`
470
495
 
@@ -484,6 +509,7 @@ export function synthesizeBoundaryStressRow(
484
509
  const name = random() < 0.7 ? pick(MULTIWORD_STREETS, random) : pick(SINGLE_STREETS, random)
485
510
  const suffix = pick(SUFFIXES, random)
486
511
  const streetCore = `${dir ? `${dir} ` : ""}${name} ${suffix}`
512
+
487
513
  const components: CanonicalRow["components"] = {
488
514
  house_number: hn,
489
515
  ...(dir ? { street_prefix: dir } : {}),
@@ -493,6 +519,7 @@ export function synthesizeBoundaryStressRow(
493
519
  region: b.region,
494
520
  postcode: b.postcode,
495
521
  }
522
+
496
523
  const raw =
497
524
  template === "comma-less-city-state"
498
525
  ? // no commas anywhere — the segmentation cue is gone
@@ -25,7 +25,15 @@
25
25
  import { formatAddress } from "./format.ts"
26
26
  import type { CanonicalRow } from "./types.ts"
27
27
 
28
- /** A real address tuple (e.g. one OpenAddresses row): street + locality required, rest optional. */
28
+ /**
29
+ * A real address tuple (e.g. one OpenAddresses row): street + locality required, rest optional.
30
+ */
31
+ /* oxlint-disable sister-software/no-unnamed-threshold -- the bare decimals below are weighted-sampler
32
+ cutoffs, not thresholds: `const r = random()` followed by a cascade of `r < 0.4` branches IS the
33
+ output distribution, and reading the cascade top-to-bottom is how you see it. Naming each cutoff
34
+ would hide the distribution behind a wall of identifiers. Genuine thresholds in these files are
35
+ extracted as named constants above. */
36
+
29
37
  export interface LocaleBaseTuple {
30
38
  house_number?: string
31
39
  street: string
@@ -39,7 +47,10 @@ export interface LocaleBaseTuple {
39
47
  region?: string
40
48
  postcode?: string
41
49
  }
42
- /** @deprecated Alias — use LocaleBaseTuple. */
50
+
51
+ /**
52
+ * @deprecated Alias — use LocaleBaseTuple.
53
+ */
43
54
  export type GermanBaseTuple = LocaleBaseTuple
44
55
 
45
56
  export interface SynthesizedLocaleRow {
@@ -47,7 +58,10 @@ export interface SynthesizedLocaleRow {
47
58
  components: CanonicalRow["components"]
48
59
  locale: string
49
60
  }
50
- /** @deprecated Alias — use SynthesizedLocaleRow. */
61
+
62
+ /**
63
+ * @deprecated Alias — use SynthesizedLocaleRow.
64
+ */
51
65
  export type SynthesizedGermanRow = SynthesizedLocaleRow
52
66
 
53
67
  export interface LocaleSynthesisOpts {
@@ -80,10 +94,15 @@ export interface LocaleSynthesisOpts {
80
94
  */
81
95
  nativeHouseJoin?: "template" | "space"
82
96
  }
83
- /** @deprecated Alias — use LocaleSynthesisOpts. */
97
+
98
+ /**
99
+ * @deprecated Alias — use LocaleSynthesisOpts.
100
+ */
84
101
  export type GermanSynthesisOpts = LocaleSynthesisOpts
85
102
 
86
- /** ISO-3166 alpha-2 → BCP-47 tag for the emitted rows (primary language per country). */
103
+ /**
104
+ * ISO-3166 alpha-2 → BCP-47 tag for the emitted rows (primary language per country).
105
+ */
87
106
  const LOCALE_TAG: Record<string, string> = {
88
107
  DE: "de-DE",
89
108
  ES: "es-ES",
@@ -111,7 +130,9 @@ function normalizePostcode(postcode: string, country: string): string {
111
130
  return postcode
112
131
  }
113
132
 
114
- /** True when `value` appears verbatim AND as a standalone token (so BIO alignment lands cleanly). */
133
+ /**
134
+ * True when `value` appears verbatim AND as a standalone token (so BIO alignment lands cleanly).
135
+ */
115
136
  function tokenPresent(raw: string, value: string): boolean {
116
137
  if (!raw.includes(value)) return false
117
138
  // Reject substring-of-a-larger-number collisions (e.g. house "2" inside postcode "12623").
@@ -218,7 +239,9 @@ export function synthesizeLocaleRow(
218
239
  return { raw, components, locale: LOCALE_TAG[country] ?? country.toLowerCase() }
219
240
  }
220
241
 
221
- /** German wrapper over {@link synthesizeLocaleRow}. Kept for the build-german-shard caller + tests. */
242
+ /**
243
+ * German wrapper over {@link synthesizeLocaleRow}. Kept for the build-german-shard caller + tests.
244
+ */
222
245
  export function synthesizeGermanRow(
223
246
  base: LocaleBaseTuple,
224
247
  opts: LocaleSynthesisOpts = {}
@@ -41,7 +41,9 @@ export interface HouseVenueBaseTuple {
41
41
 
42
42
  export type HouseVenueTemplate =
43
43
  | "venue-after-street" // "123 Main St, Sunrise Bakery, Springfield, IL 02101"
44
- | "venue-before-street" // "Sunrise Bakery, 123 Main St, Springfield, IL 02101"
44
+ | "venue-before-street"
45
+
46
+ // "Sunrise Bakery, 123 Main St, Springfield, IL 02101"
45
47
 
46
48
  export interface HouseVenueSynthesisOpts {
47
49
  random?: () => number
@@ -55,12 +57,12 @@ export interface SynthesizedHouseVenueRow {
55
57
  template: HouseVenueTemplate
56
58
  }
57
59
 
58
- // ---------------------------------------------------------------------------------------------
59
- // Venue pool — PLAIN, no street-typing tokens. The point of this shard is to teach
60
- // house_number + venue coexistence, NOT to re-introduce decompose-mode pressure.
61
- // Adversarial venue names live in `synthesize-no-street.ts`.
62
- // ---------------------------------------------------------------------------------------------
60
+ //#region Venue pool
63
61
 
62
+ /**
63
+ * PLAIN venue names, carrying no street-typing tokens. This shard teaches house_number + venue coexistence, NOT
64
+ * decompose-mode pressure — adversarial venue names live in `synthesize-no-street.ts`.
65
+ */
64
66
  const PLAIN_VENUES: ReadonlyArray<string> = [
65
67
  "Bob's Pizza",
66
68
  "Acme Corporation",
@@ -84,11 +86,13 @@ const PLAIN_VENUES: ReadonlyArray<string> = [
84
86
  "Westwood Realty",
85
87
  ]
86
88
 
87
- // ---------------------------------------------------------------------------------------------
88
- // Fallback street pool for tuples that didn't carry a `street` field. Plain street names
89
- // without typing-token ambiguity.
90
- // ---------------------------------------------------------------------------------------------
89
+ //#endregion
91
90
 
91
+ //#region Fallback street pool
92
+
93
+ /**
94
+ * Stand-in streets for tuples that carried no `street` field. Plain names, no typing-token ambiguity.
95
+ */
92
96
  const FALLBACK_STREETS: ReadonlyArray<string> = [
93
97
  "Main St",
94
98
  "Oak Ave",
@@ -107,9 +111,9 @@ const FALLBACK_STREETS: ReadonlyArray<string> = [
107
111
  "Forest Blvd",
108
112
  ]
109
113
 
110
- // ---------------------------------------------------------------------------------------------
111
- // House-number generator
112
- // ---------------------------------------------------------------------------------------------
114
+ //#endregion
115
+
116
+ //#region House-number generator
113
117
 
114
118
  function randomHouseNumber(random: () => number): string {
115
119
  // Generate a plain numeric house number 1-9999. No fractions/ranges — those land in
@@ -144,9 +148,9 @@ function countryToLocale(country: string): string {
144
148
  }
145
149
  }
146
150
 
147
- // ---------------------------------------------------------------------------------------------
148
- // Synthesis
149
- // ---------------------------------------------------------------------------------------------
151
+ //#endregion
152
+
153
+ //#region Synthesis
150
154
 
151
155
  export function synthesizeHouseVenueRow(
152
156
  base: HouseVenueBaseTuple,
@@ -190,3 +194,5 @@ export function synthesizeHouseVenueRow(
190
194
  export function hasHouseNumberAndVenue(components: CanonicalRow["components"]): boolean {
191
195
  return components.house_number !== undefined && components.venue !== undefined
192
196
  }
197
+
198
+ //#endregion
@@ -21,7 +21,21 @@
21
21
 
22
22
  import type { CanonicalRow } from "./types.ts"
23
23
 
24
- /** Street name cores (no suffix) — proper-noun streets that often appear bare. */
24
+ /**
25
+ * Street name cores (no suffix) — proper-noun streets that often appear bare.
26
+ */
27
+
28
+ /**
29
+ * Attempts to draw a second street distinct from the first before giving up on the pair.
30
+ */
31
+ const MAX_DISTINCT_STREET_TRIES = 8
32
+
33
+ /* oxlint-disable sister-software/no-unnamed-threshold -- the bare decimals below are weighted-sampler
34
+ cutoffs, not thresholds: `const r = random()` followed by a cascade of `r < 0.4` branches IS the
35
+ output distribution, and reading the cascade top-to-bottom is how you see it. Naming each cutoff
36
+ would hide the distribution behind a wall of identifiers. Genuine thresholds in these files are
37
+ extracted as named constants above. */
38
+
25
39
  const STREET_CORES = [
26
40
  "Main",
27
41
  "Oak",
@@ -47,7 +61,9 @@ const STREET_CORES = [
47
61
  "Spring",
48
62
  ] as const
49
63
 
50
- /** Bare proper-noun streets that idiomatically take NO suffix. */
64
+ /**
65
+ * Bare proper-noun streets that idiomatically take NO suffix.
66
+ */
51
67
  const BARE_NAMES = ["Broadway", "Wall", "Bourbon", "Esplanade", "Riverside", "Lakeshore"] as const
52
68
 
53
69
  const ORDINALS = [
@@ -79,7 +95,9 @@ const CONNECTORS = [" & ", " and ", " at ", " / ", " @ "] as const
79
95
  export interface IntersectionBaseTuple {
80
96
  locality: string
81
97
  region: string
82
- /** ZIP — optional; ~30% of synthetic intersections omit it (idiomatic). */
98
+ /**
99
+ * ZIP — optional; ~30% of synthetic intersections omit it (idiomatic).
100
+ */
83
101
  postcode?: string
84
102
  country: string
85
103
  }
@@ -98,7 +116,9 @@ function pick<T>(arr: ReadonlyArray<T>, random: () => number): T {
98
116
  return arr[Math.floor(random() * arr.length)]!
99
117
  }
100
118
 
101
- /** Build a single street surface form, e.g. "W 42nd St", "Broadway", "Main St", "N Oak Ave". */
119
+ /**
120
+ * Build a single street surface form, e.g. "W 42nd St", "Broadway", "Main St", "N Oak Ave".
121
+ */
102
122
  function buildStreetName(random: () => number): string {
103
123
  // ~20% bare proper-noun street (no suffix), else directional? + core/ordinal + suffix.
104
124
  if (random() < 0.2) return pick(BARE_NAMES, random)
@@ -108,6 +128,7 @@ function buildStreetName(random: () => number): string {
108
128
  if (random() < 0.35) {
109
129
  parts.push(pick(DIRECTIONALS, random))
110
130
  }
131
+
111
132
  parts.push(random() < 0.45 ? pick(ORDINALS, random) : pick(STREET_CORES, random))
112
133
  parts.push(pick(SUFFIXES, random))
113
134
 
@@ -131,7 +152,7 @@ export function synthesizeIntersectionRow(
131
152
  // Ensure distinct surface forms (and not a substring of each other — alignment needs unambiguous spans).
132
153
  let tries = 0
133
154
 
134
- while ((b === a || a.includes(b) || b.includes(a)) && tries++ < 8) {
155
+ while ((b === a || a.includes(b) || b.includes(a)) && tries++ < MAX_DISTINCT_STREET_TRIES) {
135
156
  b = buildStreetName(random)
136
157
  }
137
158
 
@@ -153,9 +174,11 @@ export function synthesizeIntersectionRow(
153
174
  raw = `${cornerPrefix}${a}${connector}${b}`
154
175
  } else {
155
176
  const includePostcode = base.postcode != null && random() < 0.7
177
+
156
178
  const tail = includePostcode
157
179
  ? `, ${base.locality}, ${base.region} ${base.postcode}`
158
180
  : `, ${base.locality}, ${base.region}`
181
+
159
182
  raw = `${cornerPrefix}${a}${connector}${b}${tail}`
160
183
  components.locality = base.locality
161
184
  components.region = base.region
@@ -168,7 +191,9 @@ export function synthesizeIntersectionRow(
168
191
  return { raw, components, locale: "en-US" }
169
192
  }
170
193
 
171
- /** A small built-in US city/region/zip pool for standalone shard generation + tests. */
194
+ /**
195
+ * A small built-in US city/region/zip pool for standalone shard generation + tests.
196
+ */
172
197
  export const DEFAULT_US_BASES: ReadonlyArray<IntersectionBaseTuple> = [
173
198
  { locality: "New York", region: "NY", postcode: "10036", country: "US" },
174
199
  { locality: "Chicago", region: "IL", postcode: "60613", country: "US" },
@@ -182,7 +207,9 @@ export const DEFAULT_US_BASES: ReadonlyArray<IntersectionBaseTuple> = [
182
207
  { locality: "Atlanta", region: "GA", postcode: "30303", country: "US" },
183
208
  ]
184
209
 
185
- /** Generate `count` intersection rows over the provided bases (round-robin). */
210
+ /**
211
+ * Generate `count` intersection rows over the provided bases (round-robin).
212
+ */
186
213
  export function generateIntersectionRows(
187
214
  count: number,
188
215
  bases: ReadonlyArray<IntersectionBaseTuple> = DEFAULT_US_BASES,
@@ -39,9 +39,13 @@
39
39
 
40
40
  import type { CanonicalRow } from "./types.ts"
41
41
 
42
- // -------------------------------------------------------------------------------------------------
43
- // Types
44
- // -------------------------------------------------------------------------------------------------
42
+ //#region Types
43
+
44
+ /* oxlint-disable sister-software/no-unnamed-threshold -- the bare decimals below are weighted-sampler
45
+ cutoffs, not thresholds: `const r = random()` followed by a cascade of `r < 0.4` branches IS the
46
+ output distribution, and reading the cascade top-to-bottom is how you see it. Naming each cutoff
47
+ would hide the distribution behind a wall of identifiers. Genuine thresholds in these files are
48
+ extracted as named constants above. */
45
49
 
46
50
  export interface NoStreetBaseTuple {
47
51
  locality: string
@@ -60,7 +64,9 @@ export type NoStreetTemplate =
60
64
 
61
65
  export interface NoStreetSynthesisOpts {
62
66
  random?: () => number
63
- /** Override the template selection entirely (used by tests for deterministic coverage). */
67
+ /**
68
+ * Override the template selection entirely (used by tests for deterministic coverage).
69
+ */
64
70
  forceTemplate?: NoStreetTemplate
65
71
  }
66
72
 
@@ -71,9 +77,9 @@ export interface SynthesizedNoStreetRow {
71
77
  template: NoStreetTemplate
72
78
  }
73
79
 
74
- // -------------------------------------------------------------------------------------------------
75
- // Venue name pools
76
- // -------------------------------------------------------------------------------------------------
80
+ //#endregion
81
+
82
+ //#region Venue name pools
77
83
 
78
84
  /**
79
85
  * Plain venue names — businesses without street-typing words in the name. Used as the easy-mode positive class for
@@ -165,9 +171,9 @@ const COUNTRY_NAMES = new Map<string, ReadonlyArray<string>>([
165
171
  ["AU", ["Australia"]],
166
172
  ])
167
173
 
168
- // -------------------------------------------------------------------------------------------------
169
- // Synthesis
170
- // -------------------------------------------------------------------------------------------------
174
+ //#endregion
175
+
176
+ //#region Synthesis
171
177
 
172
178
  function pick<T>(arr: ReadonlyArray<T>, random: () => number): T {
173
179
  return arr[Math.floor(random() * arr.length)]!
@@ -339,3 +345,5 @@ export function hasAnyStreetSideTag(components: CanonicalRow["components"]): boo
339
345
 
340
346
  return false
341
347
  }
348
+
349
+ //#endregion
@@ -26,6 +26,22 @@
26
26
 
27
27
  import type { CanonicalRow } from "./types.ts"
28
28
 
29
+ /**
30
+ * Digits a box number needs before a thousands comma is plausible (`1,234`).
31
+ */
32
+ const MIN_DIGITS_FOR_COMMA_GROUPING = 4
33
+
34
+ /**
35
+ * Digits a box number needs before a hyphen group is plausible (`12-34`).
36
+ */
37
+ const MIN_DIGITS_FOR_HYPHEN_GROUPING = 3
38
+
39
+ /* oxlint-disable sister-software/no-unnamed-threshold -- the bare decimals below are weighted-sampler
40
+ cutoffs, not thresholds: `const r = random()` followed by a cascade of `r < 0.4` branches IS the
41
+ output distribution, and reading the cascade top-to-bottom is how you see it. Naming each cutoff
42
+ would hide the distribution behind a wall of identifiers. Genuine thresholds in these files are
43
+ extracted as named constants above. */
44
+
29
45
  export interface PoBoxBaseTuple {
30
46
  locality: string
31
47
  region: string
@@ -99,14 +115,16 @@ const LEADERS_BY_LOCALE = new Map<string, LocaleTemplate>(PO_BOX_LOCALE_TEMPLATE
99
115
  */
100
116
  export function maybeNoisifyBoxNumber(num: string, random: () => number): string {
101
117
  if (random() > 0.1) return num
118
+
102
119
  const variants: Array<(s: string) => string> = [
103
120
  // Thousand-separator comma (real input: "Box 1,234")
104
- (s) => (s.length >= 4 ? `${s.slice(0, -3)},${s.slice(-3)}` : s),
121
+ (s) => (s.length >= MIN_DIGITS_FOR_COMMA_GROUPING ? `${s.slice(0, -3)},${s.slice(-3)}` : s),
105
122
  // Embedded dash (real input: "PMB-200")
106
- (s) => (s.length >= 3 ? `${s.slice(0, -2)}-${s.slice(-2)}` : s),
123
+ (s) => (s.length >= MIN_DIGITS_FOR_HYPHEN_GROUPING ? `${s.slice(0, -2)}-${s.slice(-2)}` : s),
107
124
  // Embedded spaces (real input from OCR: "1 2 3 4")
108
125
  (s) => s.split("").join(" "),
109
126
  ]
127
+
110
128
  const f = variants[Math.floor(random() * variants.length)]!
111
129
 
112
130
  return f(num)
@@ -129,11 +147,17 @@ export interface SynthesizedPoBoxRow {
129
147
  }
130
148
 
131
149
  export interface PoBoxSynthesisOpts {
132
- /** Random function — pass deterministic seed for tests. Default Math.random. */
150
+ /**
151
+ * Random function — pass deterministic seed for tests. Default Math.random.
152
+ */
133
153
  random?: () => number
134
- /** Number generator. Default uniform over 1..99999. */
154
+ /**
155
+ * Number generator. Default uniform over 1..99999.
156
+ */
135
157
  pickNumber?: (random: () => number) => string
136
- /** PMB probability when locale supports it (and a street is provided in the base tuple). */
158
+ /**
159
+ * PMB probability when locale supports it (and a street is provided in the base tuple).
160
+ */
137
161
  pmbRatio?: number
138
162
  }
139
163
 
@@ -150,7 +174,7 @@ function defaultPickNumber(random: () => number): string {
150
174
  if (r < 0.95) return String(1000 + Math.floor(random() * 9000))
151
175
 
152
176
  // 1000-9999
153
- return String(10000 + Math.floor(random() * 90000)) // 10000-99999
177
+ return String(10_000 + Math.floor(random() * 90_000)) // 10000-99999
154
178
  }
155
179
 
156
180
  /**
@@ -163,7 +187,7 @@ export function synthesizePoBoxRow(
163
187
  ): SynthesizedPoBoxRow | null {
164
188
  const random = opts.random ?? Math.random
165
189
  const pickNumber = opts.pickNumber ?? defaultPickNumber
166
- const pmbRatio = opts.pmbRatio ?? 0.0
190
+ const pmbRatio = opts.pmbRatio ?? 0
167
191
 
168
192
  const locale = countryToLocale(base.country)
169
193
  const tpl = LEADERS_BY_LOCALE.get(locale)
@@ -231,15 +255,21 @@ const MIL_UNITS: ReadonlyArray<{ code: string; boxRequired: boolean }> = [
231
255
  { code: "CMR", boxRequired: true },
232
256
  { code: "Unit", boxRequired: false },
233
257
  ]
258
+
234
259
  const MIL_PO_CODES = ["APO", "FPO", "DPO"] as const
235
- // region → plausible ZIP prefix (AE Europe 09xxx, AP Pacific 962-966xx, AA Americas 340xx).
260
+
261
+ /**
262
+ * Region → plausible ZIP prefix (AE Europe 09xxx, AP Pacific 962-966xx, AA Americas 340xx).
263
+ */
236
264
  const MIL_REGION_ZIP: ReadonlyArray<{ region: string; zip: (r: () => number) => string }> = [
237
265
  { region: "AE", zip: (r) => `09${String(Math.floor(r() * 1000)).padStart(3, "0")}` },
238
266
  { region: "AP", zip: (r) => `96${String(200 + Math.floor(r() * 100)).padStart(3, "0")}` },
239
267
  { region: "AA", zip: (r) => `340${String(Math.floor(r() * 100)).padStart(2, "0")}` },
240
268
  ]
241
269
 
242
- /** Generate one US military/diplomatic PO-box row (#517). Self-contained — draws no base tuple. */
270
+ /**
271
+ * Generate one US military/diplomatic PO-box row (#517). Self-contained — draws no base tuple.
272
+ */
243
273
  export function synthesizeMilitaryPoBoxRow(opts: PoBoxSynthesisOpts = {}): SynthesizedPoBoxRow {
244
274
  const random = opts.random ?? Math.random
245
275
  const unit = MIL_UNITS[Math.floor(random() * MIL_UNITS.length)]!
@@ -293,7 +323,9 @@ export function countryToLocale(country: string): string {
293
323
  return "en-US"
294
324
  }
295
325
 
296
- /** All locales we synthesize for. Exposed for tests and for source-weight tuning. */
326
+ /**
327
+ * All locales we synthesize for. Exposed for tests and for source-weight tuning.
328
+ */
297
329
  export function supportedLocales(): ReadonlyArray<string> {
298
330
  return PO_BOX_LOCALE_TEMPLATES.map((t) => t.locale)
299
331
  }