@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
@@ -136,6 +136,10 @@ export function nameSlotsFor(rec: WOFRecord): Array<{ key: string; value: string
136
136
  return slots
137
137
  }
138
138
 
139
+ /**
140
+ * Registry id for this adapter. Stamped into every row it emits, so a corpus record can be traced back to the dataset
141
+ * it came from.
142
+ */
139
143
  export const WOF_POSTALCODE_ADAPTER_ID = "wof-postalcode"
140
144
 
141
145
  export function createWOFPostalcodeAdapter(): CorpusAdapter {
@@ -163,7 +167,7 @@ export function createWOFPostalcodeAdapter(): CorpusAdapter {
163
167
  const ancestry = buildAncestryIndex(byID)
164
168
 
165
169
  // Pass 2: emit postcode rows only, sorted by id for determinism.
166
- const ids = [...byID.keys()].sort((a, b) => a - b)
170
+ const ids = [...byID.keys()].toSorted((a, b) => a - b)
167
171
  let emitted = 0
168
172
 
169
173
  for (const id of ids) {
@@ -186,7 +190,7 @@ export function createWOFPostalcodeAdapter(): CorpusAdapter {
186
190
  if (!raw) continue
187
191
  const aligned = reconcileComponents(variant.components, raw)
188
192
 
189
- if (Object.keys(aligned).length === 0) continue
193
+ if (!Object.keys(aligned).length) continue
190
194
 
191
195
  yield {
192
196
  raw,
@@ -198,6 +202,7 @@ export function createWOFPostalcodeAdapter(): CorpusAdapter {
198
202
  corpus_version: "",
199
203
  license: "CC0-1.0",
200
204
  }
205
+
201
206
  emitted++
202
207
  }
203
208
  }
@@ -206,4 +211,7 @@ export function createWOFPostalcodeAdapter(): CorpusAdapter {
206
211
  }
207
212
  }
208
213
 
214
+ /**
215
+ * The configured adapter instance registered with the corpus builder.
216
+ */
209
217
  export const wofPostalcodeAdapter = createWOFPostalcodeAdapter()
package/src/align.ts CHANGED
@@ -39,9 +39,13 @@ import { distance as levenshteinDistance } from "fastest-levenshtein"
39
39
  import { whitespaceTokenizer, type TokenSpan, type Tokenizer } from "./tokenize.ts"
40
40
  import type { CanonicalRow, LabeledRow, QuarantinedRow } from "./types.ts"
41
41
 
42
- /** Options for `alignRow`. */
42
+ /**
43
+ * Options for `alignRow`.
44
+ */
43
45
  export interface AlignOptions {
44
- /** Tokenizer to use. Defaults to `whitespaceTokenizer()`. */
46
+ /**
47
+ * Tokenizer to use. Defaults to `whitespaceTokenizer()`.
48
+ */
45
49
  tokenizer?: Tokenizer
46
50
 
47
51
  /**
@@ -60,7 +64,9 @@ export interface AlignOptions {
60
64
  caseInsensitive?: boolean
61
65
  }
62
66
 
63
- /** Either a successful labeled row or a quarantined one. */
67
+ /**
68
+ * Either a successful labeled row or a quarantined one.
69
+ */
64
70
  export type AlignmentResult = { kind: "labeled"; row: LabeledRow } | { kind: "quarantined"; row: QuarantinedRow }
65
71
 
66
72
  /**
@@ -73,7 +79,9 @@ export interface ComponentSpan {
73
79
  end: number
74
80
  }
75
81
 
76
- /** Align a single row. */
82
+ /**
83
+ * Align a single row.
84
+ */
77
85
  export function alignRow(row: CanonicalRow, opts: AlignOptions = {}): AlignmentResult {
78
86
  const tokenizer = opts.tokenizer ?? whitespaceTokenizer()
79
87
  const maxEditDistance = opts.maxEditDistance ?? 2
@@ -107,7 +115,7 @@ export function alignRow(row: CanonicalRow, opts: AlignOptions = {}): AlignmentR
107
115
  // component owns ("Alaska Regional Dr, Alaska" — region "Alaska" stealing the street's first
108
116
  // word quarantined the street; pilot2's residual class). Emit order is unaffected — spans are
109
117
  // re-sorted by start below.
110
- const entries = (Object.entries(components) as Array<[ComponentTag, string | undefined]>).sort(
118
+ const entries = (Object.entries(components) as Array<[ComponentTag, string | undefined]>).toSorted(
111
119
  (a, b) => (b[1]?.length ?? 0) - (a[1]?.length ?? 0)
112
120
  )
113
121
 
@@ -220,7 +228,7 @@ function locateSpan(args: {
220
228
  }): { start: number; end: number } | undefined {
221
229
  const { haystack, needle, claimed, maxEditDistance } = args
222
230
 
223
- if (needle.length === 0) return undefined
231
+ if (!needle.length) return undefined
224
232
 
225
233
  // Pass 1: verbatim substring. Word-boundary-aligned matches are PREFERRED over intra-word ones
226
234
  // — leftmost-substring alone let a short value claim the inside of an earlier word (region "AK"
@@ -234,13 +242,14 @@ function locateSpan(args: {
234
242
  while (true) {
235
243
  const idx = haystack.indexOf(needle, from)
236
244
 
237
- if (idx < 0) break
245
+ if (idx === -1) break
238
246
  const end = idx + needle.length
239
247
 
240
248
  if (!overlapsClaimed(idx, end, claimed)) {
241
249
  if (isBoundaryAligned(haystack, idx, end)) return { start: idx, end }
242
250
  intraWord ??= { start: idx, end }
243
251
  }
252
+
244
253
  from = idx + 1
245
254
  }
246
255
 
@@ -267,7 +276,9 @@ function locateSpan(args: {
267
276
 
268
277
  const WORD_CHAR = /[\p{L}\p{N}]/u
269
278
 
270
- /** Both needle edges sit on word boundaries of the haystack (string edges count as boundaries). */
279
+ /**
280
+ * Both needle edges sit on word boundaries of the haystack (string edges count as boundaries).
281
+ */
271
282
  function isBoundaryAligned(haystack: string, start: number, end: number): boolean {
272
283
  const before = start === 0 || !WORD_CHAR.test(haystack[start - 1]!)
273
284
  const after = end === haystack.length || !WORD_CHAR.test(haystack[end]!)
@@ -307,9 +318,11 @@ function labelTokens(tokens: readonly TokenSpan[], spans: readonly ComponentSpan
307
318
  } else {
308
319
  assigned = `I-${s.tag}` as BIOLabel
309
320
  }
321
+
310
322
  break
311
323
  }
312
324
  }
325
+
313
326
  out.push(assigned)
314
327
  }
315
328
 
package/src/build.ts CHANGED
@@ -69,15 +69,23 @@ import {
69
69
  import { defaultAugmentationsForCountry, synthesizeRow } from "./synthesize.ts"
70
70
  import type { AdapterOptions, CanonicalRow, CorpusAdapter, LabeledRow } from "./types.ts"
71
71
 
72
- /** Stage tags surfaced to `onProgress`. */
72
+ /**
73
+ * Stage tags surfaced to `onProgress`.
74
+ */
73
75
  export type BuildStage = "adapter-run" | "align" | "split" | "shard" | "manifest"
74
76
 
75
- /** Per-invocation options for `buildCorpus`. */
77
+ /**
78
+ * Per-invocation options for `buildCorpus`.
79
+ */
76
80
  export interface BuildCorpusOptions {
77
- /** Root output directory. All build artifacts land beneath it. */
81
+ /**
82
+ * Root output directory. All build artifacts land beneath it.
83
+ */
78
84
  outputDir: string
79
85
 
80
- /** Corpus version (e.g. `"0.1.0"`). Stamped onto every row + into the output dir name. */
86
+ /**
87
+ * Corpus version (e.g. `"0.1.0"`). Stamped onto every row + into the output dir name.
88
+ */
81
89
  corpusVersion: string
82
90
 
83
91
  /**
@@ -92,13 +100,19 @@ export interface BuildCorpusOptions {
92
100
  */
93
101
  adapterInputs: Record<string, AdapterOptions>
94
102
 
95
- /** Enable synthesis pass. Default `true`. Set `false` for fixture-driven smoke tests. */
103
+ /**
104
+ * Enable synthesis pass. Default `true`. Set `false` for fixture-driven smoke tests.
105
+ */
96
106
  synthesize?: boolean
97
107
 
98
- /** Forwarded to `writeShards`. Default 1_000_000. */
108
+ /**
109
+ * Forwarded to `writeShards`. Default 1_000_000.
110
+ */
99
111
  rowsPerShard?: number
100
112
 
101
- /** Progress hook. Errors thrown abort the build. */
113
+ /**
114
+ * Progress hook. Errors thrown abort the build.
115
+ */
102
116
  onProgress?: (stage: BuildStage, message: string) => void
103
117
 
104
118
  /**
@@ -110,7 +124,9 @@ export interface BuildCorpusOptions {
110
124
  excludeLicenses?: readonly RegExp[]
111
125
  }
112
126
 
113
- /** Top-level manifest tying every stage together. */
127
+ /**
128
+ * Top-level manifest tying every stage together.
129
+ */
114
130
  export interface BuildCorpusManifest {
115
131
  corpus_version: string
116
132
  built_at: string
@@ -155,8 +171,10 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
155
171
  if (!adapterOptions) {
156
172
  skipped.push(adapter.id)
157
173
  opts.onProgress?.("adapter-run", `skipped ${adapter.id} (no input configured)`)
174
+
158
175
  continue
159
176
  }
177
+
160
178
  // Opt-in resume (MAILWOMAN_RESUME=1): if a complete per-adapter canonical.jsonl + MANIFEST.json
161
179
  // already exist, reuse them instead of re-emitting. The MANIFEST is written only after the
162
180
  // canonical is fully flushed, so its presence guarantees completeness; row order is identical,
@@ -173,15 +191,19 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
173
191
  const cached = JSON.parse(readFileSync(cachedManifest, "utf8")) as AdapterRunManifest
174
192
  opts.onProgress?.("adapter-run", `resumed ${adapter.id} (reused ${cached.yielded} canonical rows)`)
175
193
  adapterRuns.push(cached)
194
+
176
195
  continue
177
196
  }
197
+
178
198
  opts.onProgress?.("adapter-run", `running ${adapter.id}`)
199
+
179
200
  const m = await runAdapter({
180
201
  adapter,
181
202
  adapterOptions,
182
203
  outputDir: intermediateDir,
183
204
  corpusVersion: opts.corpusVersion,
184
205
  })
206
+
185
207
  adapterRuns.push(m)
186
208
  }
187
209
 
@@ -195,11 +217,13 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
195
217
  val: join(intermediateDir, "labeled-val.jsonl"),
196
218
  test: join(intermediateDir, "labeled-test.jsonl"),
197
219
  }
220
+
198
221
  const labeledStreams: Record<SplitName, WriteStream> = {
199
222
  train: createWriteStream(labeledPaths.train, { encoding: "utf8" }),
200
223
  val: createWriteStream(labeledPaths.val, { encoding: "utf8" }),
201
224
  test: createWriteStream(labeledPaths.test, { encoding: "utf8" }),
202
225
  }
226
+
203
227
  const quarantinePath = join(intermediateDir, "quarantine.jsonl")
204
228
  const quarantineStream = createWriteStream(quarantinePath, { encoding: "utf8" })
205
229
 
@@ -230,8 +254,10 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
230
254
  // set reflects what the corpus actually CONTAINED, and `excluded_by_license` what was cut.
231
255
  if (licenseExcluded(row.license, excludeLicenses)) {
232
256
  excludedByLicense++
257
+
233
258
  continue
234
259
  }
260
+
235
261
  const fanned: CanonicalRow[] = [row]
236
262
 
237
263
  if (synthesize) {
@@ -245,23 +271,28 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
245
271
 
246
272
  try {
247
273
  result = alignRow(r)
248
- } catch (err) {
274
+ } catch (error) {
249
275
  // Last-resort robustness (2026-06-12): no single row may crash a multi-hour build.
250
276
  // alignRow's targeted paths normalize/quarantine known issues with specific reasons;
251
277
  // this catches any UNKNOWN throw (e.g. assertSpanInvariants on an unforeseen span
252
278
  // shape) → quarantine + continue. A spike in `align-threw` reasons is a finding.
253
- writeQuarantine(r, `align-threw:${(err as Error).message.slice(0, 160)}`)
279
+ writeQuarantine(r, `align-threw:${(error as Error).message.slice(0, 160)}`)
280
+
254
281
  quarantined++
282
+
255
283
  continue
256
284
  }
257
285
 
258
286
  if (result.kind === "labeled") {
259
287
  const split = splitForRow(result.row, holdouts)
260
288
  labeledStreams[split].write(`${JSON.stringify(result.row)}\n`)
289
+
261
290
  counts[split]++
291
+
262
292
  aligned++
263
293
  } else {
264
294
  writeQuarantine(r, result.row.reason)
295
+
265
296
  quarantined++
266
297
  }
267
298
  }
@@ -271,6 +302,7 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
271
302
  for (const s of Object.values(labeledStreams)) {
272
303
  s.end()
273
304
  }
305
+
274
306
  quarantineStream.end()
275
307
  await Promise.all([...Object.values(labeledStreams).map(streamEnd), streamEnd(quarantineStream)])
276
308
 
@@ -279,6 +311,7 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
279
311
  // manifests with disk spill for splits that exceed in-memory thresholds.
280
312
  opts.onProgress?.("split", `splitting ${aligned} aligned rows`)
281
313
  const splitsDir = join(opts.outputDir, "splits")
314
+
282
315
  const splitCounts = await writeSplitManifestsFromLabeledFiles({
283
316
  labeledPaths,
284
317
  outputDir: splitsDir,
@@ -290,6 +323,7 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
290
323
  // 5. Parquet shards — per-split labeled JSONL streams in, sharded `.parquet` out. The prior
291
324
  // `splitFor(source_id)` callback (and the `Map<source_id, SplitName>` behind it) is gone.
292
325
  opts.onProgress?.("shard", "writing parquet shards")
326
+
293
327
  const shardManifest = await writeShards(
294
328
  {
295
329
  train: streamJSONL<LabeledRow>(labeledPaths.train),
@@ -305,7 +339,8 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
305
339
 
306
340
  // License-set visibility (#26): loudly report the resolved license set so a build is an obvious
307
341
  // deliberate act — especially a proprietary-weights build (did you pass --exclude-share-alike?).
308
- const licenseSummary = [...licenseCounts.entries()].sort((a, b) => b[1] - a[1])
342
+ const licenseSummary = [...licenseCounts.entries()].toSorted((a, b) => b[1] - a[1])
343
+
309
344
  opts.onProgress?.(
310
345
  "manifest",
311
346
  `license set: ${licenseSummary.map(([l, c]) => `${l}=${c}`).join(", ")}` +
@@ -316,6 +351,7 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
316
351
 
317
352
  // 6. Top-level manifest.
318
353
  opts.onProgress?.("manifest", "writing top-level MANIFEST.json")
354
+
319
355
  const manifest: BuildCorpusManifest = {
320
356
  corpus_version: opts.corpusVersion,
321
357
  built_at,
@@ -328,6 +364,7 @@ export async function buildCorpus(opts: BuildCorpusOptions): Promise<BuildCorpus
328
364
  licenses: Object.fromEntries(licenseSummary),
329
365
  excluded_by_license: excludedByLicense,
330
366
  }
367
+
331
368
  await writeFile(join(opts.outputDir, "MANIFEST.json"), `${JSON.stringify(manifest, null, 2)}\n`, "utf8")
332
369
 
333
370
  return manifest
@@ -13,7 +13,9 @@
13
13
  * join.
14
14
  */
15
15
 
16
- /** Per-state record: two-letter postal abbreviation + full canonical display name. */
16
+ /**
17
+ * Per-state record: two-letter postal abbreviation + full canonical display name.
18
+ */
17
19
  export interface USStateInfo {
18
20
  abbreviation: string
19
21
  name: string
@@ -83,7 +85,9 @@ export const US_FIPS_STATE: Readonly<Record<string, USStateInfo>> = Object.freez
83
85
  "78": { abbreviation: "VI", name: "Virgin Islands" },
84
86
  })
85
87
 
86
- /** Lookup helper. Returns null when the FIPS code isn't recognized. */
88
+ /**
89
+ * Lookup helper. Returns null when the FIPS code isn't recognized.
90
+ */
87
91
  export function lookupFipsState(statefp: string | null | undefined): USStateInfo | null {
88
92
  if (!statefp) return null
89
93
 
package/src/golden.ts CHANGED
@@ -28,7 +28,9 @@ import { reconcileComponents } from "./format.ts"
28
28
 
29
29
  const TAG_SET = new Set<string>(COMPONENT_TAGS as readonly string[])
30
30
 
31
- /** One entry in a golden `.jsonl` file. */
31
+ /**
32
+ * One entry in a golden `.jsonl` file.
33
+ */
32
34
  export interface GoldenEntry {
33
35
  raw: string
34
36
  components: Partial<Record<ComponentTag, string>>
@@ -37,25 +39,31 @@ export interface GoldenEntry {
37
39
  notes?: string
38
40
  }
39
41
 
40
- /** Per-entry validation failure. */
42
+ /**
43
+ * Per-entry validation failure.
44
+ */
41
45
  export interface GoldenIssue {
42
46
  file: string
43
47
  line: number
44
48
  reason: string
45
49
  }
46
50
 
47
- /** Aggregate report from `validateGoldenDir`. */
51
+ /**
52
+ * Aggregate report from `validateGoldenDir`.
53
+ */
48
54
  export interface GoldenReport {
49
55
  entries: number
50
56
  files: number
51
57
  issues: GoldenIssue[]
52
58
  }
53
59
 
54
- /** Parse a single JSONL line into a `GoldenEntry`. Throws on schema violations. */
60
+ /**
61
+ * Parse a single JSONL line into a `GoldenEntry`. Throws on schema violations.
62
+ */
55
63
  export function parseGoldenLine(line: string): GoldenEntry {
56
64
  const obj = JSON.parse(line) as Partial<GoldenEntry> & Record<string, unknown>
57
65
 
58
- if (typeof obj.raw !== "string" || obj.raw.length === 0) {
66
+ if (typeof obj.raw !== "string" || !obj.raw.length) {
59
67
  throw new Error("missing/empty raw")
60
68
  }
61
69
 
@@ -66,12 +74,13 @@ export function parseGoldenLine(line: string): GoldenEntry {
66
74
  if (obj.source !== "golden") {
67
75
  throw new Error(`source must be "golden" (got ${JSON.stringify(obj.source)})`)
68
76
  }
77
+
69
78
  const components = (obj.components ?? {}) as Record<string, unknown>
70
79
 
71
80
  for (const [k, v] of Object.entries(components)) {
72
81
  if (!TAG_SET.has(k)) throw new Error(`unknown ComponentTag: ${k}`)
73
82
 
74
- if (typeof v !== "string" || v.length === 0) {
83
+ if (typeof v !== "string" || !v.length) {
75
84
  throw new Error(`components.${k} must be a non-empty string`)
76
85
  }
77
86
  }
@@ -85,7 +94,9 @@ export function parseGoldenLine(line: string): GoldenEntry {
85
94
  }
86
95
  }
87
96
 
88
- /** Check that every component in `entry` appears in `entry.raw` (reconciliation-equivalent). */
97
+ /**
98
+ * Check that every component in `entry` appears in `entry.raw` (reconciliation-equivalent).
99
+ */
89
100
  export function unreachableComponents(entry: GoldenEntry): ComponentTag[] {
90
101
  const reconciled = reconcileComponents(entry.components, entry.raw)
91
102
  const missing: ComponentTag[] = []
@@ -99,7 +110,9 @@ export function unreachableComponents(entry: GoldenEntry): ComponentTag[] {
99
110
  return missing
100
111
  }
101
112
 
102
- /** Validate one `.jsonl` file end-to-end, returning a list of issues. */
113
+ /**
114
+ * Validate one `.jsonl` file end-to-end, returning a list of issues.
115
+ */
103
116
  export async function validateGoldenFile(path: string): Promise<GoldenIssue[]> {
104
117
  const text = await readFile(path, "utf8")
105
118
  const lines = text.split("\n")
@@ -114,24 +127,26 @@ export async function validateGoldenFile(path: string): Promise<GoldenIssue[]> {
114
127
  const entry = parseGoldenLine(line)
115
128
  const unreachable = unreachableComponents(entry)
116
129
 
117
- if (unreachable.length > 0) {
130
+ if (unreachable.length) {
118
131
  issues.push({
119
132
  file: path,
120
133
  line: i + 1,
121
134
  reason: `components not reachable in raw: ${unreachable.join(", ")}`,
122
135
  })
123
136
  }
124
- } catch (err) {
125
- issues.push({ file: path, line: i + 1, reason: (err as Error).message })
137
+ } catch (error) {
138
+ issues.push({ file: path, line: i + 1, reason: (error as Error).message })
126
139
  }
127
140
  }
128
141
 
129
142
  return issues
130
143
  }
131
144
 
132
- /** Validate every `.jsonl` in a golden directory. */
145
+ /**
146
+ * Validate every `.jsonl` in a golden directory.
147
+ */
133
148
  export async function validateGoldenDir(dir: string): Promise<GoldenReport> {
134
- const files = (await readdir(dir)).filter((n) => extname(n) === ".jsonl").sort()
149
+ const files = (await readdir(dir)).filter((n) => extname(n) === ".jsonl").toSorted()
135
150
  const issues: GoldenIssue[] = []
136
151
  let entries = 0
137
152
 
package/src/license.ts CHANGED
@@ -37,10 +37,12 @@ export function compileLicenseExcludes(spec: string): RegExp[] {
37
37
  .split(",")
38
38
  .map((s) => s.trim())
39
39
  .filter(Boolean)
40
- .map((s) => new RegExp("^" + s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i"))
40
+ .map((s) => new RegExp("^" + s.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i"))
41
41
  }
42
42
 
43
- /** True iff `license` matches any of the exclude `patterns` (empty patterns → never excluded). */
43
+ /**
44
+ * True iff `license` matches any of the exclude `patterns` (empty patterns → never excluded).
45
+ */
44
46
  export function licenseExcluded(license: string | undefined, patterns: readonly RegExp[]): boolean {
45
47
  const l = license ?? ""
46
48
 
@@ -12,9 +12,11 @@ import { ParquetReader as BaseParquetReader } from "@dsnp/parquetjs"
12
12
  import type { BufferReaderOptions } from "@dsnp/parquetjs/dist/lib/bufferReader.js"
13
13
  import { ParquetEnvelopeReader } from "@dsnp/parquetjs/dist/lib/reader.js"
14
14
 
15
- import { type ParquetRecordLike, ParquetSchema } from "./schema.ts"
15
+ import type { ParquetSchema, ParquetRecordLike } from "./schema.ts"
16
16
 
17
- /** A typed Parquet reader, wrapping the base Parquet reader. */
17
+ /**
18
+ * A typed Parquet reader, wrapping the base Parquet reader.
19
+ */
18
20
  export class ParquetReader<T extends ParquetRecordLike> extends BaseParquetReader implements AsyncDisposable {
19
21
  declare schema: ParquetSchema<T>
20
22
 
@@ -47,9 +49,9 @@ export class ParquetReader<T extends ParquetRecordLike> extends BaseParquetReade
47
49
  const metadata = await envelopeReader.readFooter()
48
50
 
49
51
  return new ParquetReader<T>(metadata, envelopeReader, opts)
50
- } catch (err) {
52
+ } catch (error) {
51
53
  await envelopeReader.close()
52
- throw err
54
+ throw error
53
55
  }
54
56
  }
55
57
 
@@ -21,22 +21,26 @@ import type { createSBBFParams as BloomFilterCreation } from "@dsnp/parquetjs/di
21
21
  import type { FieldDefinition } from "@dsnp/parquetjs/dist/lib/declare.js"
22
22
  import { LRUCache } from "lru-cache"
23
23
 
24
- /** A Parquet record-like object, i.e. a record with string keys and JSON-serializable values. */
25
- export type ParquetRecordLike = {
26
- [key: string]: unknown | undefined
27
- }
24
+ /**
25
+ * A Parquet record-like object, i.e. a record with string keys and JSON-serializable values.
26
+ */
27
+ export type ParquetRecordLike = Record<string, unknown | undefined>
28
28
 
29
- /** Typed Parquet schema definition. */
30
- export type ParquetSchemaDefinition<T = ParquetRecordLike> = {
31
- [field in Extract<keyof T, string>]: FieldDefinition
32
- }
29
+ /**
30
+ * Typed Parquet schema definition.
31
+ */
32
+ export type ParquetSchemaDefinition<T = ParquetRecordLike> = Record<Extract<keyof T, string>, FieldDefinition>
33
33
 
34
- /** Typed Parquet schema. */
34
+ /**
35
+ * Typed Parquet schema.
36
+ */
35
37
  export class ParquetSchema<T> extends BaseParquetSchema {
36
38
  declare schema: ParquetSchemaDefinition<T>
37
39
  }
38
40
 
39
- /** Given a Parquet schema and a list of columns, create a list of Bloom filters for those columns. */
41
+ /**
42
+ * Given a Parquet schema and a list of columns, create a list of Bloom filters for those columns.
43
+ */
40
44
  export function createBloomFilters<T>(
41
45
  parquetSchemaDef: ParquetSchemaDefinition<T>,
42
46
  columns: Extract<keyof T, string>[]
@@ -51,7 +51,9 @@ export class ParquetWriter<T extends ParquetRecordLike> extends BaseParquetWrite
51
51
  return new ParquetWriter<T>(schema, envelopeWriter, opts)
52
52
  }
53
53
 
54
- /** Convenience method to create a new buffered parquet writer that writes to the specified file. */
54
+ /**
55
+ * Convenience method to create a new buffered parquet writer that writes to the specified file.
56
+ */
55
57
  static override async openFile<T extends ParquetRecordLike>(
56
58
  schemaLike: ParquetSchema<T> | ParquetSchemaDefinition<T>,
57
59
  sourcePath: string | Buffer | URL,
@@ -67,17 +69,23 @@ export class ParquetWriter<T extends ParquetRecordLike> extends BaseParquetWrite
67
69
  }
68
70
 
69
71
  // @note This fixes invalid Markdown in the base class JSDoc.
70
- /** Set a metadata key-value pair on the writer. */
72
+ /**
73
+ * Set a metadata key-value pair on the writer.
74
+ */
71
75
  public override setMetadata(key: string, value: string): void {
72
76
  return super.setMetadata(key, value)
73
77
  }
74
78
 
75
- /** Append a row to the buffer. If the buffer is full, the data will be written to disk. */
79
+ /**
80
+ * Append a row to the buffer. If the buffer is full, the data will be written to disk.
81
+ */
76
82
  public override async appendRow(row: T): Promise<void> {
77
83
  return super.appendRow(row)
78
84
  }
79
85
 
80
- /** Flush all buffered data to disk, close the file, and release resources. */
86
+ /**
87
+ * Flush all buffered data to disk, close the file, and release resources.
88
+ */
81
89
  public override async close(): Promise<void> {
82
90
  await this.#flushing
83
91