@mailwoman/registry 10.0.0 → 10.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 (231) hide show
  1. package/README.md +11 -14
  2. package/lib/address-key.ts +14 -10
  3. package/lib/geocode-handler.ts +7 -5
  4. package/lib/geojson.ts +13 -7
  5. package/lib/ingest.ts +70 -92
  6. package/lib/learned-scorer.ts +38 -44
  7. package/lib/map-html.ts +26 -72
  8. package/lib/models/crosssource-gbt-en-us.ts +9 -7
  9. package/lib/models/dedup-gbt-en-us.ts +9 -8
  10. package/lib/models/org-crosssource-gbt-en-us.ts +10 -8
  11. package/lib/reconcile.ts +45 -54
  12. package/lib/resolve.ts +187 -130
  13. package/lib/types.ts +35 -29
  14. package/out/address-key.d.ts +14 -10
  15. package/out/address-key.d.ts.map +1 -1
  16. package/out/address-key.js +14 -10
  17. package/out/address-key.js.map +1 -1
  18. package/out/geocode-handler.d.ts +6 -4
  19. package/out/geocode-handler.d.ts.map +1 -1
  20. package/out/geocode-handler.js +7 -5
  21. package/out/geocode-handler.js.map +1 -1
  22. package/out/geojson.d.ts +9 -5
  23. package/out/geojson.d.ts.map +1 -1
  24. package/out/geojson.js +13 -7
  25. package/out/geojson.js.map +1 -1
  26. package/out/ingest.d.ts +49 -76
  27. package/out/ingest.d.ts.map +1 -1
  28. package/out/ingest.js +37 -62
  29. package/out/ingest.js.map +1 -1
  30. package/out/learned-scorer.d.ts +29 -26
  31. package/out/learned-scorer.d.ts.map +1 -1
  32. package/out/learned-scorer.js +31 -39
  33. package/out/learned-scorer.js.map +1 -1
  34. package/out/map-html.d.ts +13 -32
  35. package/out/map-html.d.ts.map +1 -1
  36. package/out/map-html.js +11 -64
  37. package/out/map-html.js.map +1 -1
  38. package/out/models/crosssource-gbt-en-us.d.ts +9 -7
  39. package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
  40. package/out/models/crosssource-gbt-en-us.js +9 -7
  41. package/out/models/crosssource-gbt-en-us.js.map +1 -1
  42. package/out/models/dedup-gbt-en-us.d.ts +9 -8
  43. package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
  44. package/out/models/dedup-gbt-en-us.js +9 -8
  45. package/out/models/dedup-gbt-en-us.js.map +1 -1
  46. package/out/models/org-crosssource-gbt-en-us.d.ts +10 -8
  47. package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
  48. package/out/models/org-crosssource-gbt-en-us.js +10 -8
  49. package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
  50. package/out/reconcile.d.ts +36 -50
  51. package/out/reconcile.d.ts.map +1 -1
  52. package/out/reconcile.js +18 -42
  53. package/out/reconcile.js.map +1 -1
  54. package/out/resolve.d.ts +152 -91
  55. package/out/resolve.d.ts.map +1 -1
  56. package/out/resolve.js +67 -68
  57. package/out/resolve.js.map +1 -1
  58. package/out/tools/coverage-reconciliation.d.ts +23 -23
  59. package/out/tools/coverage-reconciliation.d.ts.map +1 -1
  60. package/out/tools/coverage-reconciliation.js +15 -26
  61. package/out/tools/coverage-reconciliation.js.map +1 -1
  62. package/out/tools/cross/dataset-correlation.d.ts +23 -27
  63. package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
  64. package/out/tools/cross/dataset-correlation.js +9 -61
  65. package/out/tools/cross/dataset-correlation.js.map +1 -1
  66. package/out/tools/cross/source-threshold-sweep.d.ts +20 -26
  67. package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -1
  68. package/out/tools/cross/source-threshold-sweep.js +14 -40
  69. package/out/tools/cross/source-threshold-sweep.js.map +1 -1
  70. package/out/tools/dedup-ceiling.d.ts +23 -26
  71. package/out/tools/dedup-ceiling.d.ts.map +1 -1
  72. package/out/tools/dedup-ceiling.js +22 -41
  73. package/out/tools/dedup-ceiling.js.map +1 -1
  74. package/out/tools/eval-geocoder.d.ts +25 -16
  75. package/out/tools/eval-geocoder.d.ts.map +1 -1
  76. package/out/tools/eval-geocoder.js +5 -6
  77. package/out/tools/eval-geocoder.js.map +1 -1
  78. package/out/tools/geocoder/namesake-probe.d.ts +9 -8
  79. package/out/tools/geocoder/namesake-probe.d.ts.map +1 -1
  80. package/out/tools/geocoder/namesake-probe.js +6 -7
  81. package/out/tools/geocoder/namesake-probe.js.map +1 -1
  82. package/out/tools/geocoder/vs-provided-coords.d.ts +18 -15
  83. package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -1
  84. package/out/tools/geocoder/vs-provided-coords.js +30 -27
  85. package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
  86. package/out/tools/gold-set-sample.d.ts +27 -18
  87. package/out/tools/gold-set-sample.d.ts.map +1 -1
  88. package/out/tools/gold-set-sample.js +18 -22
  89. package/out/tools/gold-set-sample.js.map +1 -1
  90. package/out/tools/learned/scorer/clustering-eval.d.ts +30 -27
  91. package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -1
  92. package/out/tools/learned/scorer/clustering-eval.js +28 -38
  93. package/out/tools/learned/scorer/clustering-eval.js.map +1 -1
  94. package/out/tools/learned/scorer/crossstate-eval.d.ts +24 -18
  95. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -1
  96. package/out/tools/learned/scorer/crossstate-eval.js +19 -25
  97. package/out/tools/learned/scorer/crossstate-eval.js.map +1 -1
  98. package/out/tools/learned/scorer/eval.d.ts +26 -39
  99. package/out/tools/learned/scorer/eval.d.ts.map +1 -1
  100. package/out/tools/learned/scorer/eval.js +11 -71
  101. package/out/tools/learned/scorer/eval.js.map +1 -1
  102. package/out/tools/matcher-scale.d.ts +12 -17
  103. package/out/tools/matcher-scale.d.ts.map +1 -1
  104. package/out/tools/matcher-scale.js +11 -29
  105. package/out/tools/matcher-scale.js.map +1 -1
  106. package/out/tools/nppes/dedup-benchmark.d.ts +22 -41
  107. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
  108. package/out/tools/nppes/dedup-benchmark.js +21 -67
  109. package/out/tools/nppes/dedup-benchmark.js.map +1 -1
  110. package/out/tools/nppes/org-name.d.ts +5 -11
  111. package/out/tools/nppes/org-name.d.ts.map +1 -1
  112. package/out/tools/nppes/org-name.js +2 -9
  113. package/out/tools/nppes/org-name.js.map +1 -1
  114. package/out/tools/nppes/overmerge-packet.d.ts +15 -11
  115. package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
  116. package/out/tools/nppes/overmerge-packet.js +6 -7
  117. package/out/tools/nppes/overmerge-packet.js.map +1 -1
  118. package/out/tools/nppes/report.d.ts +17 -13
  119. package/out/tools/nppes/report.d.ts.map +1 -1
  120. package/out/tools/nppes/report.js +6 -14
  121. package/out/tools/nppes/report.js.map +1 -1
  122. package/out/tools/nppes/sample.d.ts +29 -18
  123. package/out/tools/nppes/sample.d.ts.map +1 -1
  124. package/out/tools/nppes/sample.js +24 -28
  125. package/out/tools/nppes/sample.js.map +1 -1
  126. package/out/tools/nppes/scoring.d.ts +7 -6
  127. package/out/tools/nppes/scoring.d.ts.map +1 -1
  128. package/out/tools/nppes/scoring.js +6 -5
  129. package/out/tools/nppes/scoring.js.map +1 -1
  130. package/out/tools/nppes/settings.d.ts +10 -7
  131. package/out/tools/nppes/settings.d.ts.map +1 -1
  132. package/out/tools/nppes/settings.js +16 -16
  133. package/out/tools/nppes/settings.js.map +1 -1
  134. package/out/tools/nppes/truth-grains.d.ts +36 -23
  135. package/out/tools/nppes/truth-grains.d.ts.map +1 -1
  136. package/out/tools/nppes/truth-grains.js +36 -20
  137. package/out/tools/nppes/truth-grains.js.map +1 -1
  138. package/out/tools/shared.d.ts +68 -72
  139. package/out/tools/shared.d.ts.map +1 -1
  140. package/out/tools/shared.js +50 -67
  141. package/out/tools/shared.js.map +1 -1
  142. package/out/tools/train/cross-gbt.d.ts +37 -26
  143. package/out/tools/train/cross-gbt.d.ts.map +1 -1
  144. package/out/tools/train/cross-gbt.js +14 -25
  145. package/out/tools/train/cross-gbt.js.map +1 -1
  146. package/out/tools/train/gbt.d.ts +36 -20
  147. package/out/tools/train/gbt.d.ts.map +1 -1
  148. package/out/tools/train/gbt.js +27 -31
  149. package/out/tools/train/gbt.js.map +1 -1
  150. package/out/tools/train/org-cross-gbt.d.ts +38 -24
  151. package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
  152. package/out/tools/train/org-cross-gbt.js +18 -22
  153. package/out/tools/train/org-cross-gbt.js.map +1 -1
  154. package/out/tools/txhhsc-to-oarow.d.ts +14 -9
  155. package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
  156. package/out/tools/txhhsc-to-oarow.js +16 -15
  157. package/out/tools/txhhsc-to-oarow.js.map +1 -1
  158. package/out/tools/viz/browser.d.ts +6 -5
  159. package/out/tools/viz/browser.d.ts.map +1 -1
  160. package/out/tools/viz/browser.js +6 -5
  161. package/out/tools/viz/browser.js.map +1 -1
  162. package/out/tools/viz/cross-dataset-map.d.ts +7 -4
  163. package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
  164. package/out/tools/viz/cross-dataset-map.js +9 -6
  165. package/out/tools/viz/cross-dataset-map.js.map +1 -1
  166. package/out/tools/viz/geocode-first-surface.d.ts +11 -5
  167. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  168. package/out/tools/viz/geocode-first-surface.js +16 -11
  169. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  170. package/out/tools/viz/render/map.d.ts +5 -5
  171. package/out/tools/viz/render/map.d.ts.map +1 -1
  172. package/out/tools/viz/render/map.js +6 -5
  173. package/out/tools/viz/render/map.js.map +1 -1
  174. package/out/tools/viz/{render/index.d.ts → render.d.ts} +13 -9
  175. package/out/tools/viz/render.d.ts.map +1 -0
  176. package/out/tools/viz/{render/index.js → render.js} +9 -8
  177. package/out/tools/viz/render.js.map +1 -0
  178. package/out/tools/viz/source-provenance-map.d.ts +19 -7
  179. package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
  180. package/out/tools/viz/source-provenance-map.js +11 -8
  181. package/out/tools/viz/source-provenance-map.js.map +1 -1
  182. package/out/tools/viz/yardstick-figure.d.ts +2 -21
  183. package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
  184. package/out/tools/viz/yardstick-figure.js +3 -39
  185. package/out/tools/viz/yardstick-figure.js.map +1 -1
  186. package/out/types.d.ts +35 -29
  187. package/out/types.d.ts.map +1 -1
  188. package/out/types.js +2 -2
  189. package/out/types.js.map +1 -1
  190. package/package.json +42 -185
  191. package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
  192. package/{lib/tools → tools}/cross/dataset-correlation.ts +35 -73
  193. package/{lib/tools → tools}/cross/source-threshold-sweep.ts +29 -46
  194. package/{lib/tools → tools}/dedup-ceiling.ts +34 -45
  195. package/tools/eval-geocoder.ts +77 -0
  196. package/{lib/tools → tools}/geocoder/namesake-probe.ts +9 -8
  197. package/{lib/tools → tools}/geocoder/vs-provided-coords.ts +40 -31
  198. package/{lib/tools → tools}/gold-set-sample.ts +35 -29
  199. package/{lib/tools → tools}/learned/scorer/clustering-eval.ts +49 -45
  200. package/{lib/tools → tools}/learned/scorer/crossstate-eval.ts +34 -30
  201. package/{lib/tools → tools}/learned/scorer/eval.ts +39 -78
  202. package/{lib/tools → tools}/matcher-scale.ts +21 -33
  203. package/{lib/tools → tools}/nppes/dedup-benchmark.ts +39 -83
  204. package/tools/nppes/org-name.ts +15 -0
  205. package/{lib/tools → tools}/nppes/overmerge-packet.ts +16 -12
  206. package/{lib/tools → tools}/nppes/report.ts +32 -25
  207. package/{lib/tools → tools}/nppes/sample.ts +43 -38
  208. package/{lib/tools → tools}/nppes/scoring.ts +7 -6
  209. package/{lib/tools → tools}/nppes/settings.ts +16 -16
  210. package/{lib/tools → tools}/nppes/truth-grains.ts +46 -26
  211. package/{lib/tools → tools}/shared.ts +79 -98
  212. package/{lib/tools → tools}/train/cross-gbt.ts +39 -34
  213. package/{lib/tools → tools}/train/gbt.ts +55 -41
  214. package/{lib/tools → tools}/train/org-cross-gbt.ts +40 -30
  215. package/{lib/tools → tools}/txhhsc-to-oarow.ts +24 -18
  216. package/{lib/tools → tools}/viz/browser.ts +6 -5
  217. package/{lib/tools → tools}/viz/cross-dataset-map.ts +15 -9
  218. package/{lib/tools → tools}/viz/geocode-first-surface.ts +29 -17
  219. package/{lib/tools → tools}/viz/render/map.ts +7 -6
  220. package/{lib/tools/viz/render/index.ts → tools/viz/render.ts} +16 -11
  221. package/{lib/tools → tools}/viz/source-provenance-map.ts +30 -15
  222. package/{lib/tools → tools}/viz/yardstick-figure.ts +6 -43
  223. package/lib/tools/eval-geocoder.ts +0 -67
  224. package/lib/tools/index.ts +0 -31
  225. package/lib/tools/nppes/org-name.ts +0 -23
  226. package/out/tools/index.d.ts +0 -31
  227. package/out/tools/index.d.ts.map +0 -1
  228. package/out/tools/index.js +0 -31
  229. package/out/tools/index.js.map +0 -1
  230. package/out/tools/viz/render/index.d.ts.map +0 -1
  231. package/out/tools/viz/render/index.js.map +0 -1
package/lib/types.ts CHANGED
@@ -3,11 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The application's data shapes — the messy record that goes in, and the canonical entity that
6
+ * The application's data shapes — the messy record that goes in and the canonical entity that
7
7
  * comes out. Plain interfaces over the `@mailwoman/record` types.
8
8
  */
9
9
 
10
- import type { OrganizationName, PersonName, PostalAddress, ResolutionTier } from "@mailwoman/record"
10
+ import type { ResolutionTier } from "@mailwoman/annotations/geo"
11
+ import type { OrganizationName, PersonName, PostalAddress } from "@mailwoman/record"
11
12
 
12
13
  /**
13
14
  * A single source record: one row of a messy contact/organization dataset, after normalization.
@@ -20,32 +21,35 @@ export interface SourceRecord {
20
21
  /**
21
22
  * Provenance: which file / dataset this came from.
22
23
  */
23
- source?: string | null
24
+ source: string | null
24
25
  /**
25
26
  * Parsed person name, when the record is a contact.
26
27
  */
27
- name?: PersonName | null
28
+ name: PersonName | null
28
29
  /**
29
30
  * Canonicalized organization name, when the record is an org.
30
31
  */
31
- organization?: OrganizationName | null
32
+ organization: OrganizationName | null
32
33
  /**
33
34
  * The address, normalized + (ideally) geocoded.
34
35
  */
35
- address?: PostalAddress | null
36
- phone?: string | null
37
- email?: string | null
36
+ address: PostalAddress | null
37
+ phone: string | null
38
+ email: string | null
38
39
  /**
39
- * Additional secondary-identifier fields, normalized — anything that helps tell two records apart or confirm they're
40
- * the same beyond name/org/address/phone (an authorized-official name, a provider taxonomy, a license number…). Used
41
- * as extra comparisons + corroborators when the model is built with matching `discriminators`. Keyed by a stable
42
- * field name the model references.
40
+ * Additional secondary-identifier fields, normalized.
41
+ *
42
+ * Anything that helps tell two records apart or confirm they're the same beyond
43
+ * name/org/address/phone (an authorized-official name, a provider taxonomy, a license number…).
44
+ *
45
+ * Used as extra comparisons + corroborators when the model is built with matching `discriminators`.
46
+ * Keyed by a stable field name the model references.
43
47
  */
44
- attributes?: Record<string, string>
48
+ attributes: Record<string, string> | null
45
49
  /**
46
50
  * The original row, verbatim, for audit.
47
51
  */
48
- raw?: Record<string, string>
52
+ raw: Record<string, string> | null
49
53
  }
50
54
 
51
55
  /**
@@ -67,7 +71,7 @@ export interface ResolvedEntity {
67
71
  /**
68
72
  * The entity's location, from the representative's geocode.
69
73
  */
70
- coordinate?: { latitude: number; longitude: number }
74
+ coordinate: { latitude: number; longitude: number } | null
71
75
  /**
72
76
  * Weakest within-cluster link weight in bits (how tightly it holds together); `null` for a singleton.
73
77
  */
@@ -81,24 +85,26 @@ export type ReconciliationBucket = "enrolled" | "eligible-not-enrolled" | "funde
81
85
 
82
86
  export interface EntityGeoData {
83
87
  entityID: string
84
- sourceIDs?: string[]
85
- recordCount?: number
86
- cohesion?: number | null
88
+ sourceIDs: string[]
89
+ recordCount: number
90
+ cohesion: number | null
87
91
  sources: string[]
88
92
  name: string | null
89
- organization?: string | null
90
- address?: string | null
91
- geocodeTier?: ResolutionTier | null
92
- bucket?: ReconciliationBucket
93
+ organization: string | null
94
+ address: string | null
95
+ geocodeTier: ResolutionTier | null
96
+ bucket: ReconciliationBucket | null
93
97
  }
94
98
 
95
99
  /**
96
- * Feature properties the map renderer consumes — {@link EntityGeoData} with every field optional, plus an unconstrained
97
- * `bucket`. The renderer assigns a color per DISTINCT bucket value in first-seen order and builds its legend from that
98
- * set, so a bucket is any categorical label, not only a {@link ReconciliationBucket}; and a collection assembled from
99
- * something other than resolved entities (raw address points, links read back from a file) carries no entity id or
100
- * display name.
100
+ * Feature properties the map renderer consumes — {@link EntityGeoData} with every
101
+ * field optional, plus an unconstrained `bucket`.
102
+ *
103
+ * The renderer assigns a color per distinct bucket value in first-seen order and builds
104
+ * its legend from that set, so a bucket is any categorical label rather than only a
105
+ * {@link ReconciliationBucket}; and a collection assembled from something other than resolved
106
+ * entities (raw address points, links read back from a file) have no entity id or display name.
101
107
  */
102
- export type MapFeatureData = Partial<Omit<EntityGeoData, "bucket">> & { bucket?: string }
108
+ export type MapFeatureData = Partial<Omit<EntityGeoData, "bucket">> & { bucket?: string | null }
103
109
 
104
- //#endregion
110
+ // #endregion
@@ -3,13 +3,13 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The address-id consumer for the matcher (#259). Derives a stable {@link PostalAddressID} from a
7
- * resolved {@link SourceRecord} and exposes it as a blocking key — the deterministic,
6
+ * The address-id consumer for the matcher. Derives a stable {@link PostalAddressID} from a
7
+ * resolved {@link SourceRecord} and exposes it as a blocking key, the deterministic
8
8
  * exact-canonical-address complement to the fuzzy Fellegi-Sunter / GBT scoring. Two uses:
9
9
  *
10
- * - **As a pre-dedup / join key:** `GROUP BY postalAddressID(record)` collapses records that resolve
11
- * to the same place AND share a canonical address with NO scoring at all — the cheap, certain
12
- * slice of dedup before the matcher does the fuzzy rest.
10
+ * - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records that resolve
11
+ * to the same place and share a canonical address with no scoring at all. That is the cheap,
12
+ * certain part of dedup before the matcher does the fuzzy rest.
13
13
  * - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the blocking union, so
14
14
  * records sharing one are guaranteed to be compared.
15
15
  */
@@ -17,14 +17,18 @@ import { type PostalAddressID } from "@mailwoman/address-id";
17
17
  import { type BlockingKey } from "@mailwoman/match";
18
18
  import type { SourceRecord } from "#types";
19
19
  /**
20
- * The stable address primary key for a record, or null when it isn't geocoded (no coordinate → no locality cell) or
21
- * carries no raw address to hash. Uses the resolved coordinate + the raw address; the state prefix is plucked from the
22
- * address when present.
20
+ * The stable address primary key for a record, or null when it is not geocoded
21
+ * (no coordinate means no locality cell) or includes no raw address to hash.
22
+ *
23
+ * The state prefix is plucked from the address when present.
23
24
  */
24
25
  export declare function postalAddressID(record: SourceRecord): PostalAddressID | null;
25
26
  /**
26
- * A blocking key on the {@link postalAddressID} — records that resolve to the same place with the same canonical address
27
- * block together. Add it to {@link defaultBlockingKeys}'s union when an exact address join should never be missed.
27
+ * A blocking key on the {@link postalAddressID}.
28
+ *
29
+ * Records that resolve to the same place with the same canonical address block together.
30
+ *
31
+ * Add it to {@link defaultBlockingKeys}'s union when an exact address join should never be missed.
28
32
  */
29
33
  export declare function addressIDBlockingKey(): BlockingKey<SourceRecord>;
30
34
  //# sourceMappingURL=address-key.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"address-key.d.ts","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,kBAAkB,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,GAAG,IAAI,CAO5E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,YAAY,CAAC,CAEhE"}
1
+ {"version":3,"file":"address-key.d.ts","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,kBAAkB,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,GAAG,IAAI,CAO5E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,YAAY,CAAC,CAEhE"}
@@ -3,22 +3,23 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The address-id consumer for the matcher (#259). Derives a stable {@link PostalAddressID} from a
7
- * resolved {@link SourceRecord} and exposes it as a blocking key — the deterministic,
6
+ * The address-id consumer for the matcher. Derives a stable {@link PostalAddressID} from a
7
+ * resolved {@link SourceRecord} and exposes it as a blocking key, the deterministic
8
8
  * exact-canonical-address complement to the fuzzy Fellegi-Sunter / GBT scoring. Two uses:
9
9
  *
10
- * - **As a pre-dedup / join key:** `GROUP BY postalAddressID(record)` collapses records that resolve
11
- * to the same place AND share a canonical address with NO scoring at all — the cheap, certain
12
- * slice of dedup before the matcher does the fuzzy rest.
10
+ * - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records that resolve
11
+ * to the same place and share a canonical address with no scoring at all. That is the cheap,
12
+ * certain part of dedup before the matcher does the fuzzy rest.
13
13
  * - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the blocking union, so
14
14
  * records sharing one are guaranteed to be compared.
15
15
  */
16
16
  import { createPostalAddressID } from "@mailwoman/address-id";
17
17
  import { exactKey } from "@mailwoman/match";
18
18
  /**
19
- * The stable address primary key for a record, or null when it isn't geocoded (no coordinate → no locality cell) or
20
- * carries no raw address to hash. Uses the resolved coordinate + the raw address; the state prefix is plucked from the
21
- * address when present.
19
+ * The stable address primary key for a record, or null when it is not geocoded
20
+ * (no coordinate means no locality cell) or includes no raw address to hash.
21
+ *
22
+ * The state prefix is plucked from the address when present.
22
23
  */
23
24
  export function postalAddressID(record) {
24
25
  const coordinate = record.address?.geocode?.coordinate;
@@ -28,8 +29,11 @@ export function postalAddressID(record) {
28
29
  return createPostalAddressID({ coordinate, address });
29
30
  }
30
31
  /**
31
- * A blocking key on the {@link postalAddressID} — records that resolve to the same place with the same canonical address
32
- * block together. Add it to {@link defaultBlockingKeys}'s union when an exact address join should never be missed.
32
+ * A blocking key on the {@link postalAddressID}.
33
+ *
34
+ * Records that resolve to the same place with the same canonical address block together.
35
+ *
36
+ * Add it to {@link defaultBlockingKeys}'s union when an exact address join should never be missed.
33
37
  */
34
38
  export function addressIDBlockingKey() {
35
39
  return exactKey((record) => postalAddressID(record));
@@ -1 +1 @@
1
- {"version":3,"file":"address-key.js","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAI7D;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IACnD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAA;IACtD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,CAAA;IAEnC,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAExC,OAAO,qBAAqB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAA;AACtD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IACnC,OAAO,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAA;AACrD,CAAC"}
1
+ {"version":3,"file":"address-key.js","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAI7D;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IACnD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAA;IACtD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,CAAA;IAEnC,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAExC,OAAO,qBAAqB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAA;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB;IACnC,OAAO,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAA;AACrD,CAAC"}
@@ -9,10 +9,12 @@
9
9
  import { type ColumnMapping, type GeocodeAddress } from "#ingest";
10
10
  import type { SourceRecord } from "#types";
11
11
  /**
12
- * Build the handler `geocodeStream` runs per normalized record: recompute the joined address string from `record.raw` +
13
- * `mapping.address` (the worker can't receive the original closure), geocode it via `geocode`, and attach the result.
14
- * Records with no mapped address pass through untouched (no geocode call). The default separator matches
15
- * {@link ingestRow}'s `addressSeparator`.
12
+ * Build the handler `geocodeStream` runs per normalized record: recompute the joined address
13
+ * string from `record.raw` + `mapping.address` (the worker can't receive the original closure),
14
+ * geocode it via `geocode`, and attach the result.
15
+ *
16
+ * Records with no mapped address pass through untouched (no geocode call).
17
+ * The default separator matches {@link ingestRow}'s `addressSeparator`.
16
18
  */
17
19
  export declare function makeGeocodeHandler(geocode: GeocodeAddress, mapping: ColumnMapping, addressSeparator?: string): (record: SourceRecord) => Promise<SourceRecord>;
18
20
  //# sourceMappingURL=geocode-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"geocode-handler.d.ts","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAQ,MAAM,SAAS,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,aAAa,EACtB,gBAAgB,SAAO,GACrB,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAYjD"}
1
+ {"version":3,"file":"geocode-handler.d.ts","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAQ,MAAM,SAAS,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,aAAa,EACtB,gBAAgB,SAAO,GACrB,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAYjD"}
@@ -8,10 +8,12 @@
8
8
  */
9
9
  import { pick } from "#ingest";
10
10
  /**
11
- * Build the handler `geocodeStream` runs per normalized record: recompute the joined address string from `record.raw` +
12
- * `mapping.address` (the worker can't receive the original closure), geocode it via `geocode`, and attach the result.
13
- * Records with no mapped address pass through untouched (no geocode call). The default separator matches
14
- * {@link ingestRow}'s `addressSeparator`.
11
+ * Build the handler `geocodeStream` runs per normalized record: recompute the joined address
12
+ * string from `record.raw` + `mapping.address` (the worker can't receive the original closure),
13
+ * geocode it via `geocode`, and attach the result.
14
+ *
15
+ * Records with no mapped address pass through untouched (no geocode call).
16
+ * The default separator matches {@link ingestRow}'s `addressSeparator`.
15
17
  */
16
18
  export function makeGeocodeHandler(geocode, mapping, addressSeparator = ", ") {
17
19
  return async (record) => {
@@ -20,7 +22,7 @@ export function makeGeocodeHandler(geocode, mapping, addressSeparator = ", ") {
20
22
  const addressValue = pick(record.raw, mapping.address, addressSeparator);
21
23
  if (!addressValue)
22
24
  return record;
23
- const address = (await geocode(addressValue)) ?? undefined;
25
+ const address = (await geocode(addressValue)) ?? null;
24
26
  return { ...record, address };
25
27
  };
26
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geocode-handler.js","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAA2C,IAAI,EAAE,MAAM,SAAS,CAAA;AAGvE;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CACjC,OAAuB,EACvB,OAAsB,EACtB,gBAAgB,GAAG,IAAI;IAEvB,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE;QACvB,IAAI,CAAC,MAAM,CAAC,GAAG;YAAE,OAAO,MAAM,CAAA;QAE9B,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;QAExE,IAAI,CAAC,YAAY;YAAE,OAAO,MAAM,CAAA;QAEhC,MAAM,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,SAAS,CAAA;QAE1D,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAA;IAC9B,CAAC,CAAA;AACF,CAAC"}
1
+ {"version":3,"file":"geocode-handler.js","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAA2C,IAAI,EAAE,MAAM,SAAS,CAAA;AAGvE;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CACjC,OAAuB,EACvB,OAAsB,EACtB,gBAAgB,GAAG,IAAI;IAEvB,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE;QACvB,IAAI,CAAC,MAAM,CAAC,GAAG;YAAE,OAAO,MAAM,CAAA;QAE9B,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;QAExE,IAAI,CAAC,YAAY;YAAE,OAAO,MAAM,CAAA;QAEhC,MAAM,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,IAAI,CAAA;QAErD,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAA;IAC9B,CAAC,CAAA;AACF,CAAC"}
package/out/geojson.d.ts CHANGED
@@ -5,20 +5,24 @@
5
5
  *
6
6
  * Export resolved entities as GeoJSON — the bridge to QGIS and any web map. Each entity becomes a
7
7
  * Point at its resolved coordinate, carrying the properties an analyst needs: how many records
8
- * merged into it, how tightly (cohesion), the canonical name/org/address, and the geocode tier
8
+ * merged into it, how tightly (cohesion), the canonical name/org/address and the geocode tier
9
9
  * (so rooftop-precise entities can be styled apart from admin-centroid guesses). Entities without
10
10
  * a coordinate are omitted (a Point feature needs one).
11
11
  */
12
12
  import type { GeoFeature, GeoFeatureCollection, PointLiteral } from "@mailwoman/spatial";
13
13
  import type { EntityGeoData, ResolvedEntity } from "#types";
14
14
  /**
15
- * One entity → one GeoJSON Point feature. `extra` merges over (and may override) the standard properties — the
16
- * reconciliation flow adds its `bucket` and swaps the display name for the representative's org-or-person form.
15
+ * One entity → one GeoJSON Point feature.
16
+ *
17
+ * `extra` merges over (and may override) the standard properties.
18
+ * The reconciliation flow adds its `bucket` and swaps the display name for the
19
+ * representative's org-or-person form.
17
20
  */
18
21
  export declare function toFeature(entity: ResolvedEntity, extra?: Partial<EntityGeoData>): GeoFeature<PointLiteral, EntityGeoData>;
19
22
  /**
20
- * Convert resolved entities into a GeoJSON `FeatureCollection` of points, ready for QGIS. Entities with no resolved
21
- * coordinate are skipped.
23
+ * Convert resolved entities into a GeoJSON `FeatureCollection` of points, ready for QGIS.
24
+ *
25
+ * Entities with no resolved coordinate are skipped.
22
26
  */
23
27
  export declare function toGeoJSON(entities: readonly ResolvedEntity[]): GeoFeatureCollection<PointLiteral, EntityGeoData>;
24
28
  //# sourceMappingURL=geojson.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../lib/geojson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAgB,MAAM,QAAQ,CAAA;AASzE;;;GAGG;AACH,wBAAgB,SAAS,CACxB,MAAM,EAAE,cAAc,EACtB,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,UAAU,CAAC,YAAY,EAAE,aAAa,CAAC,CAwBzC;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,oBAAoB,CAAC,YAAY,EAAE,aAAa,CAAC,CAKhH"}
1
+ {"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../lib/geojson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAgB,MAAM,QAAQ,CAAA;AASzE;;;;;;GAMG;AACH,wBAAgB,SAAS,CACxB,MAAM,EAAE,cAAc,EACtB,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,UAAU,CAAC,YAAY,EAAE,aAAa,CAAC,CA0BzC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,oBAAoB,CAAC,YAAY,EAAE,aAAa,CAAC,CAKhH"}
package/out/geojson.js CHANGED
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * Export resolved entities as GeoJSON — the bridge to QGIS and any web map. Each entity becomes a
7
7
  * Point at its resolved coordinate, carrying the properties an analyst needs: how many records
8
- * merged into it, how tightly (cohesion), the canonical name/org/address, and the geocode tier
8
+ * merged into it, how tightly (cohesion), the canonical name/org/address and the geocode tier
9
9
  * (so rooftop-precise entities can be styled apart from admin-centroid guesses). Entities without
10
10
  * a coordinate are omitted (a Point feature needs one).
11
11
  */
@@ -14,11 +14,14 @@ import { formatPersonName } from "@mailwoman/record/name";
14
14
  * Assemble a display name from a record's parsed person name, if any.
15
15
  */
16
16
  function displayName(record) {
17
- return formatPersonName(record.name) || null;
17
+ return formatPersonName(record.name ?? null) || null;
18
18
  }
19
19
  /**
20
- * One entity → one GeoJSON Point feature. `extra` merges over (and may override) the standard properties — the
21
- * reconciliation flow adds its `bucket` and swaps the display name for the representative's org-or-person form.
20
+ * One entity → one GeoJSON Point feature.
21
+ *
22
+ * `extra` merges over (and may override) the standard properties.
23
+ * The reconciliation flow adds its `bucket` and swaps the display name for the
24
+ * representative's org-or-person form.
22
25
  */
23
26
  export function toFeature(entity, extra) {
24
27
  const rep = entity.representative;
@@ -34,19 +37,22 @@ export function toFeature(entity, extra) {
34
37
  recordCount: entity.records.length,
35
38
  cohesion: entity.cohesion,
36
39
  sourceIDs: entity.records.map((r) => r.id),
37
- // Distinct provenance labels the entity's records span — an entity with ≥2 is a cross-dataset link.
40
+ // Distinct provenance labels the entity's records span.
41
+ // An entity with ≥2 is a cross-dataset link.
38
42
  sources: [...new Set(entity.records.map((r) => r.source).filter((s) => !!s))].toSorted(),
39
43
  name: displayName(rep),
40
44
  organization: rep.organization?.canonical ?? null,
41
45
  address: rep.address?.formatted ?? null,
42
46
  geocodeTier: rep.address?.geocode?.tier ?? null,
47
+ bucket: null,
43
48
  ...extra,
44
49
  },
45
50
  };
46
51
  }
47
52
  /**
48
- * Convert resolved entities into a GeoJSON `FeatureCollection` of points, ready for QGIS. Entities with no resolved
49
- * coordinate are skipped.
53
+ * Convert resolved entities into a GeoJSON `FeatureCollection` of points, ready for QGIS.
54
+ *
55
+ * Entities with no resolved coordinate are skipped.
50
56
  */
51
57
  export function toGeoJSON(entities) {
52
58
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"geojson.js","sourceRoot":"","sources":["../lib/geojson.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAKzD;;GAEG;AACH,SAAS,WAAW,CAAC,MAAoB;IACxC,OAAO,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAA;AAC7C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CACxB,MAAsB,EACtB,KAA8B;IAE9B,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAA;IAEjC,OAAO;QACN,IAAI,EAAE,SAAS;QACf,EAAE,EAAE,SAAS,EAAE,iCAAiC;QAChD,QAAQ,EAAE;YACT,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,CAAC,MAAM,CAAC,UAAW,CAAC,SAAS,EAAE,MAAM,CAAC,UAAW,CAAC,QAAQ,CAAC;SACxE;QACD,UAAU,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC,EAAE;YACnB,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;YAClC,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1C,oGAAoG;YACpG,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MA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  * @author Teffen Ellis, et al.
5
5
  *
6
- * Ingest — turn messy tabular data (CSV, SQLite, hand-keyed spreadsheets) into normalized
7
- * {@link SourceRecord}s, the front of the cascade.
8
- *
9
- * Two concerns, kept separate:
10
- *
11
- * 1. **Column mapping + normalization** (this is pure): a {@link ColumnMapping} says which column(s)
12
- * hold the name, organization, address, phone, email; each row is normalized with
13
- * `@mailwoman/record` (parse the person name, canonicalize the org). This is deterministic
14
- * and testable with no heavy runtime.
15
- * 2. **Geocoding** (the heavy part) is an injected dependency — a {@link GeocodeAddress} the caller provides.
16
- * Ingest never imports the neural parser, the resolver, or the extracts; it just calls the
17
- * call per address. {@link geocodeAddressVia} builds that geocoder from mailwoman's real parse +
18
- * geocode primitives (which the CLI constructs with the model + data in hand), so the wiring
19
- * is concrete and testable without pinning the heavy runtime into this package.
20
- *
21
- * LLM-assisted column mapping (infer the mapping from a header + samples) is a documented
22
- * fast-follow; the mapping is an explicit input here.
6
+ * Column mapping and normalization are pure. The caller injects geocoding, so this package never imports the neural parser, resolver, or extracts.
23
7
  */
24
8
  import type { AddressGeocode, PostalAddress } from "@mailwoman/record";
25
9
  import { toPostalAddress } from "@mailwoman/record";
10
+ import type { PathBuilderLike } from "path-ts";
26
11
  import { type AsyncSequence } from "spliterator";
27
12
  import type { SourceRecord } from "#types";
28
13
  /**
29
- * Resolve a raw address string into a {@link PostalAddress}. The entry point to mailwoman's geocoder.
14
+ * Resolve a raw address string into a {@link PostalAddress}, the entry point to mailwoman's geocoder.
30
15
  */
31
16
  export type GeocodeAddress = (raw: string) => Promise<PostalAddress | null> | PostalAddress | null;
32
17
  /**
33
18
  * The column delimiters a tabular source may declare, by name, each the spliterator's own byte.
34
19
  *
35
- * The `satisfies` clause keys every name to a member of spliterator's `Delimiters` const, so a delimiter this map names
36
- * that spliterator no longer ships is a compile error rather than a silently parallel vocabulary.
20
+ * The `satisfies` clause makes a delimiter name spliterator no longer ships a compile error
21
+ * rather than a silently parallel vocabulary.
37
22
  */
38
23
  declare const COLUMN_DELIMITERS: {
39
24
  readonly comma: 44;
@@ -50,20 +35,19 @@ export declare function delimiterFor(path: string): Delimiter;
50
35
  /**
51
36
  * Stream a delimited file's rows lazily as header-keyed objects.
52
37
  *
53
- * Returns the spliterator's own {@linkcode AsyncSequence}: nothing is opened until something iterates, a `take` that is
54
- * satisfied (or a `break` out of `for await`) closes the file handle, and any `map`/`filter` a caller composes fuses
55
- * into the same pull loop. Wrapping this in an `async function*` would cost an async frame per row and take those
56
- * operators away.
38
+ * @returns The spliterator's own {@linkcode AsyncSequence}, whose `map`/`filter`
39
+ * fuse into the same pull loop.
40
+ * An `async function*` wrapper would add an async frame per row and remove those operators.
57
41
  */
58
- export declare function streamRows(source: string, opts?: {
42
+ export declare function streamRows(source: PathBuilderLike, opts?: {
59
43
  delimiter?: Delimiter;
60
44
  }): AsyncSequence<Record<string, string>>;
61
45
  /**
62
- * Maps dataset columns to record fields. A field may draw from several columns (joined with spaces).
46
+ * Maps dataset columns to record fields, where a field may draw from several columns joined with spaces.
63
47
  */
64
48
  export interface ColumnMapping {
65
49
  /**
66
- * Column holding a stable row id. Falls back to the row index.
50
+ * Column holding a stable row id, falling back to the row index.
67
51
  */
68
52
  id?: string;
69
53
  /**
@@ -76,19 +60,13 @@ export interface ColumnMapping {
76
60
  phone?: string;
77
61
  email?: string;
78
62
  /**
79
- * Extra secondary-identifier fields → the column(s) to draw each from (joined with spaces). Land on
80
- * `SourceRecord.attributes` under the same key, for the matcher's `discriminators` (authorized-official name,
81
- * taxonomy, license…).
63
+ * Extra secondary-identifier fields mapped to the column(s) to draw each from, landing
64
+ * on `SourceRecord.attributes` under the same key for the matcher's `discriminators`.
82
65
  */
83
66
  attributes?: Record<string, string | string[]>;
84
67
  }
85
68
  /**
86
- * Best-effort {@link ColumnMapping} inferred from a header row — the "point it at any CSV" convenience. Each column name
87
- * is matched (case- and punctuation-insensitive, on whole tokens) to a field by keyword, in a precedence that resolves
88
- * the common ambiguities: a dedicated id / phone / email column is claimed before the generic sweep, an org / facility
89
- * column beats a person "name", and address columns (street / city / state / zip…) collect into one multi-column field.
90
- * Imperfect on bespoke headers (an explicit mapping or the LLM-assisted inference #603 is the answer there), but it
91
- * nails tidy and semi-tidy files with no hand-mapping. Unmatched columns are left out.
69
+ * Best-effort {@link ColumnMapping} inferred from a header row, the "point it at any CSV" convenience.
92
70
  */
93
71
  export declare function inferMapping(header: readonly string[]): ColumnMapping;
94
72
  /**
@@ -96,53 +74,46 @@ export declare function inferMapping(header: readonly string[]): ColumnMapping;
96
74
  */
97
75
  export interface IngestOptions {
98
76
  /**
99
- * The geocoding interface. Without it, records carry name/org but no resolved address.
77
+ * The geocoding interface.
78
+ *
79
+ * Without it records include name/org but have no resolved address.
100
80
  */
101
81
  geocodeAddress?: GeocodeAddress;
102
82
  /**
103
- * Separator for joining a multi-column ADDRESS mapping (name/org always join with a space). Default `" "`. Pass `",
104
- * "` to give the parser delimited input (`"214 Main St, Austin, TX 78701"`) instead of a concatenated run (`"214 Main
105
- * St Austin TX 78701"`) — the latter strips the parser's segmentation boundaries and is partly OOD (it also breaks
106
- * all-caps case-normalization; #694). **Default `", "` (#694 flip, validated).** Comma-join is the correct shape for
107
- * an address built from separate columns, and #700 measured it at +15% cross-dataset rooftop (579→667) with no
108
- * comma-less crater. The dedup GBT was trained on the old space-joined coords, so this flip is paired with a GBT
109
- * re-validation (#694). Pass `" "` to restore the legacy space-join for a byte-stable A/B.
83
+ * Separator for joining a multi-column address mapping, comma-join giving the parser
84
+ * delimited input rather than a concatenated run (name/org always join with a space).
85
+ *
86
+ * @defaultValue `", "`
110
87
  */
111
88
  addressSeparator?: string;
112
89
  }
113
90
  /**
114
- * Join the named column(s) of a row into a single trimmed string, or undefined if empty.
91
+ * Join the selected columns of a row into a single trimmed string, or null if empty.
115
92
  */
116
- export declare function pick(row: Record<string, string>, columns?: string | string[], separator?: string): string | undefined;
93
+ export declare function pick(row: Record<string, string>, columns?: string | string[], separator?: string): string | null;
117
94
  /**
118
- * Normalize one tabular row into a {@link SourceRecord} under a {@link ColumnMapping}: parse the person name,
119
- * canonicalize the org, and (if `opts.geocodeAddress` is provided) geocode the joined address. `id` falls back to the
120
- * caller-supplied row index. Pure aside from the optional geocode interface, so the deterministic normalization can run
121
- * single-threaded (see {@link normalizeCSV}) while geocoding is offloaded (see `geocodeStream`).
95
+ * Normalize one tabular row into a {@link SourceRecord} under a {@link ColumnMapping},
96
+ * pure aside from the optional geocode interface so the deterministic normalization
97
+ * can run single-threaded while geocoding is offloaded.
122
98
  */
123
99
  export declare function ingestRow(row: Record<string, string>, mapping: ColumnMapping, index: number, opts?: IngestOptions): Promise<SourceRecord>;
124
100
  /**
125
101
  * Normalize tabular rows into {@link SourceRecord}s under a {@link ColumnMapping}.
126
102
  *
127
- * @see {@link streamRows} for the streaming path, which is the preferred way to handle multi-GB files.
103
+ * @see {@link streamRows} for the streaming path. It is preferred for multi-GB files.
128
104
  */
129
105
  export declare function ingestRows(rows: Iterable<Record<string, string>> | AsyncIterable<Record<string, string>>, mapping: ColumnMapping, opts?: IngestOptions): Promise<SourceRecord[]>;
130
106
  /**
131
- * Stream a delimited file as normalized {@link SourceRecord}s — `streamRows` + {@link ingestRow} with **no geocoding**.
132
- * This is the single-threaded, "fast enough" ergonomic core: column mapping, name parsing, and org canonicalization for
133
- * a multi-GB file, line by line. Geocode separately by piping the output through `geocodeStream` (the only heavy step
134
- * worth threading); for a light file (e.g. one that already carries geo cells) just consume this and stop.
135
- *
136
- * Records come out in file order: the sequence's `map` settles each row before pulling the next, and its counter is the
137
- * row's index — the id a row without a mapped `id` column falls back to.
107
+ * Stream a delimited file as normalized {@link SourceRecord}s in file order with no geocoding.
108
+ * Geocode separately through `geocodeStream`.
138
109
  */
139
- export declare function normalizeCSV(source: string, opts: {
110
+ export declare function normalizeCSV(source: PathBuilderLike, opts: {
140
111
  mapping: ColumnMapping;
141
112
  delimiter?: Delimiter;
142
113
  }): AsyncSequence<SourceRecord>;
143
114
  /**
144
- * The subset of mailwoman's `GeocodeResult` the adapter consumes — kept structural so this package never imports the
145
- * heavy geocoder, yet a real `GeocodeResult` maps straight in.
115
+ * The subset of mailwoman's `GeocodeResult` the adapter consumes, kept structural
116
+ * so this package never imports the heavy geocoder.
146
117
  */
147
118
  export interface RawGeocode {
148
119
  lat: number | null;
@@ -152,31 +123,34 @@ export interface RawGeocode {
152
123
  hierarchy?: AddressGeocode["hierarchy"];
153
124
  }
154
125
  /**
155
- * The component map {@link toPostalAddress} consumes (kept structural so this package never imports the geocoder).
126
+ * The component map {@link toPostalAddress} consumes
127
+ * (kept structural so this package never imports the geocoder).
156
128
  */
157
129
  type GeocodeComponents = Parameters<typeof toPostalAddress>[0];
158
130
  /**
159
- * What every shape of {@link geocodeAddressVia}'s dependencies carries.
131
+ * What every shape of {@link geocodeAddressVia}'s dependencies includes.
160
132
  */
161
133
  export interface GeocodeDepsBase {
162
134
  /**
163
- * Country (ISO-2 or name) the address is formatted under. When omitted, {@link toPostalAddress} reads the parsed
164
- * `country` component instead.
135
+ * Country (ISO-2 or name) the address is formatted under.
136
+ *
137
+ * When omitted, {@link toPostalAddress} reads the parsed `country` component instead.
165
138
  */
166
139
  country?: string;
167
140
  }
168
141
  /**
169
- * Two independent calls: parse the address, then geocode it. mailwoman's `geocodeAddress` re-parses internally, so this
170
- * shape parses the address twice — fine when the two callbacks don't share a parser.
142
+ * Two independent calls: parse the address, then geocode it.
143
+ *
144
+ * Mailwoman's `geocodeAddress` re-parses internally, so the address is read twice
145
+ * unless the two callbacks share a parser.
171
146
  */
172
147
  export interface TwoStepGeocodeDeps extends GeocodeDepsBase {
173
148
  parse: (raw: string) => Promise<GeocodeComponents> | GeocodeComponents;
174
149
  geocode: (raw: string) => Promise<RawGeocode | null> | RawGeocode | null;
175
150
  }
176
151
  /**
177
- * Parse the address ONCE and answer both the components and the geocode. Use this when the parse is the expensive step
178
- * you'd rather not pay for twice (e.g. share `parseForGeocode`'s tree between the PostalAddress and `geocodeAddress`'s
179
- * `parsedTree`). ~1.3× over the two-call shape on a real geocode pipeline.
152
+ * Parse the address once and answer both the components and the geocode, for
153
+ * when the parse is the expensive step you'd rather not pay for twice.
180
154
  */
181
155
  export interface OneStepGeocodeDeps extends GeocodeDepsBase {
182
156
  parseAndGeocode: (raw: string) => Promise<{
@@ -185,15 +159,14 @@ export interface OneStepGeocodeDeps extends GeocodeDepsBase {
185
159
  }>;
186
160
  }
187
161
  /**
188
- * The dependencies {@link geocodeAddressVia} builds a {@link GeocodeAddress} from; `"parseAndGeocode" in deps` tells the
189
- * two shapes apart.
162
+ * The dependencies {@link geocodeAddressVia} builds a {@link GeocodeAddress} from;
163
+ * `"parseAndGeocode" in deps` tells the two shapes apart.
190
164
  */
191
165
  export type GeocodeAddressViaDeps = TwoStepGeocodeDeps | OneStepGeocodeDeps;
192
166
  /**
193
- * Build a {@link GeocodeAddress} from mailwoman's real parse + geocode primitives (injected — the CLI constructs the
194
- * neural parser, resolver, and extracts and passes them in). Parse → components → {@link toPostalAddress} (which fills
195
- * the canonical key + formatted form) → attach the resolved coordinate. When geocoding can't place the address, the
196
- * parsed-but-unlocated address is still returned.
167
+ * Build a {@link GeocodeAddress} from injected parse and geocode primitives.
168
+ *
169
+ * When geocoding can't place the address, the parsed-but-unlocated address is still returned.
197
170
  */
198
171
  export declare function geocodeAddressVia(deps: GeocodeAddressViaDeps): GeocodeAddress;
199
172
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../lib/ingest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EAAiD,eAAe,EAAe,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,aAAa,CAAA;AAE5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;G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