@mailwoman/core 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/out/classification/Classification.d.ts +2 -2
  2. package/out/decoder/build-tree.d.ts +13 -4
  3. package/out/decoder/build-tree.d.ts.map +1 -1
  4. package/out/decoder/build-tree.js +36 -8
  5. package/out/decoder/build-tree.js.map +1 -1
  6. package/out/decoder/containment.d.ts +31 -2
  7. package/out/decoder/containment.d.ts.map +1 -1
  8. package/out/decoder/containment.js +36 -3
  9. package/out/decoder/containment.js.map +1 -1
  10. package/out/decoder/index.d.ts +1 -0
  11. package/out/decoder/index.d.ts.map +1 -1
  12. package/out/decoder/index.js +1 -0
  13. package/out/decoder/index.js.map +1 -1
  14. package/out/decoder/types.d.ts +21 -0
  15. package/out/decoder/types.d.ts.map +1 -1
  16. package/out/decoder/validate-tree.d.ts +39 -0
  17. package/out/decoder/validate-tree.d.ts.map +1 -0
  18. package/out/decoder/validate-tree.js +79 -0
  19. package/out/decoder/validate-tree.js.map +1 -0
  20. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  21. package/out/pipeline/runtime-pipeline.js +13 -4
  22. package/out/pipeline/runtime-pipeline.js.map +1 -1
  23. package/out/pipeline/span-logit-aggregation.d.ts +3 -2
  24. package/out/pipeline/span-logit-aggregation.d.ts.map +1 -1
  25. package/out/pipeline/span-logit-aggregation.js +3 -2
  26. package/out/pipeline/span-logit-aggregation.js.map +1 -1
  27. package/out/pipeline/types.d.ts +2 -0
  28. package/out/pipeline/types.d.ts.map +1 -1
  29. package/out/resolver/resolve.js +50 -8
  30. package/out/resolver/resolve.js.map +1 -1
  31. package/out/resolver/types.d.ts +30 -0
  32. package/out/resolver/types.d.ts.map +1 -1
  33. package/out/resolver/types.js.map +1 -1
  34. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  35. package/out/resources/whosonfirst/PlacetypeDataSource.js +3 -1
  36. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  37. package/out/resources/whosonfirst/placetypes/graph.d.ts +47 -0
  38. package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -0
  39. package/out/resources/whosonfirst/placetypes/graph.js +0 -0
  40. package/out/resources/whosonfirst/placetypes/graph.js.map +1 -0
  41. package/out/resources/whosonfirst/placetypes/index.d.ts +2 -0
  42. package/out/resources/whosonfirst/placetypes/index.d.ts.map +1 -1
  43. package/out/resources/whosonfirst/placetypes/index.js +2 -0
  44. package/out/resources/whosonfirst/placetypes/index.js.map +1 -1
  45. package/out/resources/whosonfirst/placetypes/mermaid.d.ts +35 -3
  46. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  47. package/out/resources/whosonfirst/placetypes/mermaid.js +87 -15
  48. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  49. package/out/resources/whosonfirst/placetypes/tree.d.ts +30 -0
  50. package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -0
  51. package/out/resources/whosonfirst/placetypes/tree.js +28 -0
  52. package/out/resources/whosonfirst/placetypes/tree.js.map +1 -0
  53. package/out/solver/SolutionMatch.d.ts +1 -1
  54. package/out/solver/mask.d.ts +1 -1
  55. package/package.json +7 -1
@@ -9,12 +9,12 @@ import type { LibPostalLanguageCode } from "../resources/libpostal.js";
9
9
  /**
10
10
  * Classification recognized by Mailwoman.
11
11
  */
12
- export declare const Classifications: Set<"adjacent" | "alpha" | "alphanumeric" | "area" | "chain" | "country" | "dependency" | "directional" | "end_token_single_character" | "end_token" | "given_name" | "house_number" | "intersection" | "level_designator" | "level" | "locality" | "middle_initial" | "multistreet" | "numeric" | "ordinal" | "person" | "personal_suffix" | "personal_title" | "place" | "postcode" | "punctuation" | "region" | "road_type" | "start_token" | "stop_word" | "street_name" | "street_prefix" | "street_proper_name" | "street_suffix" | "street" | "surname" | "toponym" | "unit_designator" | "unit" | "unknown" | "venue">;
12
+ export declare const Classifications: Set<"country" | "region" | "locality" | "postcode" | "house_number" | "street" | "street_prefix" | "street_suffix" | "unit" | "venue" | "adjacent" | "alpha" | "alphanumeric" | "area" | "chain" | "dependency" | "directional" | "end_token_single_character" | "end_token" | "given_name" | "intersection" | "level_designator" | "level" | "middle_initial" | "multistreet" | "numeric" | "ordinal" | "person" | "personal_suffix" | "personal_title" | "place" | "punctuation" | "road_type" | "start_token" | "stop_word" | "street_name" | "street_proper_name" | "surname" | "toponym" | "unit_designator" | "unknown">;
13
13
  export type Classification = typeof Classifications extends Set<infer T> ? T : never;
14
14
  /**
15
15
  * Public classification labels.
16
16
  */
17
- declare const VisibleClassification: Set<"country" | "dependency" | "house_number" | "level_designator" | "level" | "locality" | "postcode" | "region" | "street" | "unit_designator" | "unit" | "venue">;
17
+ declare const VisibleClassification: Set<"country" | "region" | "locality" | "postcode" | "house_number" | "street" | "unit" | "venue" | "dependency" | "level_designator" | "level" | "unit_designator">;
18
18
  /**
19
19
  * Classification labels that are exposed to API consumers.
20
20
  */
@@ -8,9 +8,11 @@
8
8
  * Two passes:
9
9
  *
10
10
  * 1. Span emission — walk the token stream, group `B-X` followed by `I-X*` into one span. Lenient on
11
- * hanging `I-X` (treat as new span). Span `value` is sliced from `raw` by [start, end), NOT
12
- * concatenated from `piece` this avoids SentencePiece's synthetic leading-space markers in
13
- * the output.
11
+ * hanging `I-X` (treat as new span). A `B-X` that is whitespace-adjacent to an already-open
12
+ * `X` span is also folded in (spurious-boundary repair for multi-word values the model
13
+ * fragments, e.g. "Saint Paul" → B-locality B-locality); a comma/separator between them keeps
14
+ * them distinct. Span `value` is sliced from `raw` by [start, end), NOT concatenated from
15
+ * `piece` — this avoids SentencePiece's synthetic leading-space markers in the output.
14
16
  * 2. Parent attachment — for each span, find the nearest labeled span whose tag is the
15
17
  * highest-priority entry in this span's `PARENT_OF` list. Distance is the tiebreaker only.
16
18
  * Spans with no found parent become roots.
@@ -20,7 +22,7 @@
20
22
  * Source order is still preserved in the `start`/`end` fields, which the XML serializer exposes
21
23
  * as attributes.
22
24
  */
23
- import type { AddressTree, DecoderToken } from "./types.js";
25
+ import type { AddressSystem, AddressTree, DecoderToken } from "./types.js";
24
26
  /**
25
27
  * Optional caller-supplied attribution stamped on every emitted node. The BIO stream comes from a
26
28
  * single model, so there's no per-span variation — one source for the whole tree.
@@ -30,6 +32,13 @@ import type { AddressTree, DecoderToken } from "./types.js";
30
32
  export interface BuildTreeOpts {
31
33
  source?: string;
32
34
  sourceId?: string;
35
+ /**
36
+ * Addressing system to decode under — selects the containment hierarchy via `containmentFor`.
37
+ * Stamped onto the returned `AddressTree.system`. Omit for the default Western hierarchy. Today
38
+ * all systems share one map, so this only records intent + threads the discriminator; it becomes
39
+ * behavioral when a system-specific map lands (Phase 6 JP). See `containment.ts`.
40
+ */
41
+ system?: AddressSystem;
33
42
  }
34
43
  /**
35
44
  * Build an `AddressTree` from a raw input string and the token stream produced by the model.
@@ -1 +1 @@
1
- {"version":3,"file":"build-tree.d.ts","sourceRoot":"","sources":["../../decoder/build-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,KAAK,EAAe,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAExE;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AA4FD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,IAAI,GAAE,aAAkB,GAAG,WAAW,CAY3G"}
1
+ {"version":3,"file":"build-tree.d.ts","sourceRoot":"","sources":["../../decoder/build-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,KAAK,EAAe,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEvF;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;CACtB;AAqHD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,IAAI,GAAE,aAAkB,GAAG,WAAW,CAe3G"}
@@ -8,9 +8,11 @@
8
8
  * Two passes:
9
9
  *
10
10
  * 1. Span emission — walk the token stream, group `B-X` followed by `I-X*` into one span. Lenient on
11
- * hanging `I-X` (treat as new span). Span `value` is sliced from `raw` by [start, end), NOT
12
- * concatenated from `piece` this avoids SentencePiece's synthetic leading-space markers in
13
- * the output.
11
+ * hanging `I-X` (treat as new span). A `B-X` that is whitespace-adjacent to an already-open
12
+ * `X` span is also folded in (spurious-boundary repair for multi-word values the model
13
+ * fragments, e.g. "Saint Paul" → B-locality B-locality); a comma/separator between them keeps
14
+ * them distinct. Span `value` is sliced from `raw` by [start, end), NOT concatenated from
15
+ * `piece` — this avoids SentencePiece's synthetic leading-space markers in the output.
14
16
  * 2. Parent attachment — for each span, find the nearest labeled span whose tag is the
15
17
  * highest-priority entry in this span's `PARENT_OF` list. Distance is the tiebreaker only.
16
18
  * Spans with no found parent become roots.
@@ -20,7 +22,7 @@
20
22
  * Source order is still preserved in the `start`/`end` fields, which the XML serializer exposes
21
23
  * as attributes.
22
24
  */
23
- import { PARENT_OF } from "./containment.js";
25
+ import { containmentFor } from "./containment.js";
24
26
  function bioParts(label) {
25
27
  if (label === "O")
26
28
  return { prefix: "O", tag: null };
@@ -66,10 +68,32 @@ function emitSpans(raw, tokens, attribution) {
66
68
  for (const tok of tokens) {
67
69
  const { prefix, tag } = bioParts(tok.label);
68
70
  if (prefix === "O") {
71
+ // A zero-width or whitespace-only `O` piece is a tokenizer artifact — SentencePiece emits a
72
+ // standalone `▁` word-boundary marker between words and the model labels it `O` (e.g.
73
+ // "Saint Paul" → "▁Saint"[B-loc], "▁"[O, zero-width], "Paul"[B-loc]). It is NOT a real
74
+ // component boundary, so it must not flush the open span; keeping the span alive lets the
75
+ // following same-tag `B-` token merge in (see the spurious-boundary repair below). A
76
+ // non-whitespace `O` (comma, slash, …) is a genuine separator and still flushes.
77
+ if (open !== null && /^\s*$/.test(raw.slice(tok.start, tok.end)))
78
+ continue;
69
79
  open = flush(open, raw, out, attribution);
70
80
  continue;
71
81
  }
72
82
  if (prefix === "B" || open === null || open.tag !== tag) {
83
+ // Spurious-boundary repair: a `B-X` token that is whitespace-adjacent to an already-open
84
+ // `X` span is the model fragmenting a multi-word value — e.g. "Saint Paul" emitted as
85
+ // B-locality B-locality instead of B-locality I-locality (a real, decode-agnostic
86
+ // emission bug; see scripts/diag-saintalbans.ts). Fold it into the open span.
87
+ //
88
+ // Guard: only merge when the text in `raw` between the two spans is whitespace-only. A
89
+ // comma or any other separator keeps them distinct, and an intervening O/different-tag
90
+ // token already nulls/replaces `open` above — so two genuinely separate same-tag spans
91
+ // (e.g. "Springfield, Chicago") are never merged.
92
+ if (prefix === "B" && open !== null && open.tag === tag && /^\s*$/.test(raw.slice(open.end, tok.start))) {
93
+ open.end = tok.end;
94
+ open.confidences.push(tok.confidence);
95
+ continue;
96
+ }
73
97
  open = flush(open, raw, out, attribution);
74
98
  open = { tag: tag, start: tok.start, end: tok.end, confidences: [tok.confidence] };
75
99
  continue;
@@ -88,8 +112,8 @@ function distance(a, b) {
88
112
  return a.start - b.end;
89
113
  return 0;
90
114
  }
91
- function findParent(span, all) {
92
- const candidates = PARENT_OF[span.tag] ?? [];
115
+ function findParent(span, all, parentOf) {
116
+ const candidates = parentOf[span.tag] ?? [];
93
117
  for (const parentTag of candidates) {
94
118
  const matches = all.filter((s) => s !== span && s.tag === parentTag);
95
119
  if (matches.length === 0)
@@ -115,14 +139,18 @@ function sortByStart(nodes) {
115
139
  export function buildAddressTree(raw, tokens, opts = {}) {
116
140
  const spans = emitSpans(raw, tokens, opts);
117
141
  const roots = [];
142
+ const parentOf = containmentFor(opts.system);
118
143
  for (const span of spans) {
119
- const parent = findParent(span, spans);
144
+ const parent = findParent(span, spans, parentOf);
120
145
  if (parent)
121
146
  parent.children.push(span);
122
147
  else
123
148
  roots.push(span);
124
149
  }
125
150
  sortByStart(roots);
126
- return { raw, roots };
151
+ const tree = { raw, roots };
152
+ if (opts.system !== undefined)
153
+ tree.system = opts.system;
154
+ return tree;
127
155
  }
128
156
  //# sourceMappingURL=build-tree.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-tree.js","sourceRoot":"","sources":["../../decoder/build-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAqB5C,SAAS,QAAQ,CAAC,KAAe;IAChC,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;IACpD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;IAC/B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAc,EAAE,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,CAAiB,EAAE,CAAA;AACjG,CAAC;AAED,mGAAmG;AACnG,iGAAiG;AACjG,+FAA+F;AAC/F,8FAA8F;AAC9F,+FAA+F;AAC/F,oDAAoD;AACpD,SAAS,YAAY,CAAC,GAAW,EAAE,KAAa,EAAE,GAAW;IAC5D,IAAI,CAAC,GAAG,KAAK,CAAA;IACb,IAAI,CAAC,GAAG,GAAG,CAAA;IACX,MAAM,UAAU,GAAG,CAAC,CAAS,EAAW,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,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tB,CAAC;IAED,WAAW,CAAC,KAAK,CAAC,CAAA;IAClB,MAAM,IAAI,GAAgB,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;IACxC,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IACxD,OAAO,IAAI,CAAA;AACZ,CAAC"}
@@ -11,9 +11,38 @@
11
11
  * distance wins. Spans whose tag is absent from this map (or has no labeled parent) become
12
12
  * roots.
13
13
  *
14
- * Tags absent from this map are treated as root-only (no parent ever accepted).
14
+ * Tags absent from a map are treated as root-only (no parent ever accepted).
15
+ *
16
+ * ## Per-system containment (anti-lock-in)
17
+ *
18
+ * Addressing _systems_ disagree on hierarchy: a US street address nests `house_number → street →
19
+ * locality`, while a Japanese block address nests `building_number → sub_block → block →
20
+ * district` — there is no `street` parent at all. Today a single global map suffices only because
21
+ * the tag sets don't collide, but the moment the resolver or tree builder hardcodes the Western
22
+ * shape, retrofitting a second system gets expensive (DeepSeek resolver consult, 2026-05-30).
23
+ *
24
+ * The cheap insurance is this indirection: callers ask `containmentFor(system)` rather than
25
+ * importing one global constant. Today every system resolves to `WESTERN_PARENT_OF` (the
26
+ * historical map, behavior-identical), and `PARENT_OF` is kept as an alias so existing imports
27
+ * don't break. When a genuinely distinct system map lands (Phase 6 JP), it slots in here with
28
+ * zero call-site churn. See `AddressSystem` in `./types.ts`.
15
29
  */
16
30
  import type { ComponentTag } from "../types/component.js";
31
+ import type { AddressSystem } from "./types.js";
17
32
  /** Preferred-parent ordering for each tag. Empty / missing = always root. */
18
- export declare const PARENT_OF: Partial<Record<ComponentTag, ComponentTag[]>>;
33
+ export declare const WESTERN_PARENT_OF: Partial<Record<ComponentTag, ComponentTag[]>>;
34
+ /**
35
+ * The containment map for a given addressing system.
36
+ *
37
+ * Currently every system maps to {@link WESTERN_PARENT_OF} — the indirection exists so a future
38
+ * system-specific map (e.g. Japanese block addressing) can be introduced without touching the tree
39
+ * builder or validator. `undefined` (the common case — system not yet detected) uses the default.
40
+ */
41
+ export declare function containmentFor(_system?: AddressSystem): Partial<Record<ComponentTag, ComponentTag[]>>;
42
+ /**
43
+ * Backwards-compatible alias for the default (Western) containment map. Prefer `containmentFor()`
44
+ * in new code so the system parameter threads through; this export remains for existing call
45
+ * sites.
46
+ */
47
+ export declare const PARENT_OF: Partial<Record<"country" | "region" | "locality" | "dependent_locality" | "postcode" | "subregion" | "house_number" | "street" | "street_prefix" | "street_prefix_particle" | "street_suffix" | "intersection_a" | "intersection_b" | "unit" | "venue" | "attention" | "po_box" | "cedex" | "prefecture" | "municipality" | "district" | "block" | "sub_block" | "building_number" | "building_name", ("country" | "region" | "locality" | "dependent_locality" | "postcode" | "subregion" | "house_number" | "street" | "street_prefix" | "street_prefix_particle" | "street_suffix" | "intersection_a" | "intersection_b" | "unit" | "venue" | "attention" | "po_box" | "cedex" | "prefecture" | "municipality" | "district" | "block" | "sub_block" | "building_number" | "building_name")[]>>;
19
48
  //# sourceMappingURL=containment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"containment.d.ts","sourceRoot":"","sources":["../../decoder/containment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,6EAA6E;AAC7E,eAAO,MAAM,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC,CAgCnE,CAAA"}
1
+ {"version":3,"file":"containment.d.ts","sourceRoot":"","sources":["../../decoder/containment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC,CAiC3E,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,CAAC,CAAC,CAIrG;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,mwBAAoB,CAAA"}
@@ -11,10 +11,24 @@
11
11
  * distance wins. Spans whose tag is absent from this map (or has no labeled parent) become
12
12
  * roots.
13
13
  *
14
- * Tags absent from this map are treated as root-only (no parent ever accepted).
14
+ * Tags absent from a map are treated as root-only (no parent ever accepted).
15
+ *
16
+ * ## Per-system containment (anti-lock-in)
17
+ *
18
+ * Addressing _systems_ disagree on hierarchy: a US street address nests `house_number → street →
19
+ * locality`, while a Japanese block address nests `building_number → sub_block → block →
20
+ * district` — there is no `street` parent at all. Today a single global map suffices only because
21
+ * the tag sets don't collide, but the moment the resolver or tree builder hardcodes the Western
22
+ * shape, retrofitting a second system gets expensive (DeepSeek resolver consult, 2026-05-30).
23
+ *
24
+ * The cheap insurance is this indirection: callers ask `containmentFor(system)` rather than
25
+ * importing one global constant. Today every system resolves to `WESTERN_PARENT_OF` (the
26
+ * historical map, behavior-identical), and `PARENT_OF` is kept as an alias so existing imports
27
+ * don't break. When a genuinely distinct system map lands (Phase 6 JP), it slots in here with
28
+ * zero call-site churn. See `AddressSystem` in `./types.ts`.
15
29
  */
16
30
  /** Preferred-parent ordering for each tag. Empty / missing = always root. */
17
- export const PARENT_OF = {
31
+ export const WESTERN_PARENT_OF = {
18
32
  // Universal coarse — containment follows geographic granularity.
19
33
  region: ["country"],
20
34
  subregion: ["region", "country"],
@@ -35,7 +49,8 @@ export const PARENT_OF = {
35
49
  venue: ["street", "locality"],
36
50
  attention: ["venue"],
37
51
  po_box: ["locality", "subregion", "region"],
38
- // JP — declared for forward-compat; mapping is provisional and will be revisited in Phase 6.
52
+ // JP — declared for forward-compat; mapping is provisional and will be revisited in Phase 6, when
53
+ // a dedicated `japanese` system map likely supersedes these entries with a no-street hierarchy.
39
54
  prefecture: ["country"],
40
55
  municipality: ["prefecture"],
41
56
  district: ["municipality"],
@@ -44,4 +59,22 @@ export const PARENT_OF = {
44
59
  building_number: ["sub_block", "block"],
45
60
  building_name: ["building_number", "sub_block", "block"],
46
61
  };
62
+ /**
63
+ * The containment map for a given addressing system.
64
+ *
65
+ * Currently every system maps to {@link WESTERN_PARENT_OF} — the indirection exists so a future
66
+ * system-specific map (e.g. Japanese block addressing) can be introduced without touching the tree
67
+ * builder or validator. `undefined` (the common case — system not yet detected) uses the default.
68
+ */
69
+ export function containmentFor(_system) {
70
+ // Single system today. The parameter is intentionally consumed lazily — adding `case "japanese":`
71
+ // here is the entire surface area for a new system's hierarchy.
72
+ return WESTERN_PARENT_OF;
73
+ }
74
+ /**
75
+ * Backwards-compatible alias for the default (Western) containment map. Prefer `containmentFor()`
76
+ * in new code so the system parameter threads through; this export remains for existing call
77
+ * sites.
78
+ */
79
+ export const PARENT_OF = WESTERN_PARENT_OF;
47
80
  //# sourceMappingURL=containment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"containment.js","sourceRoot":"","sources":["../../decoder/containment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,SAAS,GAAkD;IACvE,iEAAiE;IACjE,MAAM,EAAE,CAAC,SAAS,CAAC;IACnB,SAAS,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IAChC,QAAQ,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC;IAC5C,kBAAkB,EAAE,CAAC,UAAU,CAAC;IAChC,QAAQ,EAAE,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC;IACxD,KAAK,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;IAE/B,mGAAmG;IACnG,MAAM,EAAE,CAAC,oBAAoB,EAAE,UAAU,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from "./serialize-tuples.js";
11
11
  export * from "./serialize-xml.js";
12
12
  export * from "./types.js";
13
+ export * from "./validate-tree.js";
13
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../decoder/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../decoder/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
@@ -10,4 +10,5 @@ export * from "./serialize-json.js";
10
10
  export * from "./serialize-tuples.js";
11
11
  export * from "./serialize-xml.js";
12
12
  export * from "./types.js";
13
+ export * from "./validate-tree.js";
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../decoder/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../decoder/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,qBAAqB,CAAA;AACnC,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
@@ -112,5 +112,26 @@ export interface AddressTree {
112
112
  /** The original raw input text — preserved for round-trip and XML root @raw attribute. */
113
113
  raw: string;
114
114
  roots: AddressNode[];
115
+ /**
116
+ * The addressing SYSTEM this tree was decoded under, which selects the containment hierarchy
117
+ * (`containmentFor(system)` in `./containment.ts`). Absent means the default Western hierarchy
118
+ * (`house_number → street → locality → …`).
119
+ *
120
+ * This is forward-compat insurance, not yet a behavioral switch: every system currently resolves
121
+ * to the same map, so an absent or present `system` produces identical trees today. It exists so
122
+ * that when a genuinely distinct system lands (e.g. Japanese block addressing, where
123
+ * `building_number` nests under `sub_block`/`block` with no `street` parent), consumers and the
124
+ * tree builder already carry the discriminator — no `AddressTree` shape change later. A locale
125
+ * pre-classifier (Phase 6+) is the intended source of this value.
126
+ */
127
+ system?: AddressSystem;
115
128
  }
129
+ /**
130
+ * The addressing system a tree was decoded under — selects the containment hierarchy. Western
131
+ * covers US/EU/most-Latin-script street addressing (`house_number → street → locality`). `japanese`
132
+ * is declared for forward-compat (block addressing: `building_number → sub_block → block →
133
+ * district`, no street); it currently shares the Western map until Phase 6 gives it a distinct one.
134
+ * Open string union so a new system can be added without a breaking enum change.
135
+ */
136
+ export type AddressSystem = "western" | "japanese" | (string & {});
116
137
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../decoder/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEnE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;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,EAAE,CAAC,CAAA"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Structural-validity checker for the decoded `AddressTree` — v0.7 task #37.
7
+ *
8
+ * The postcode-only harness scores an address as "pass" on exact component match, but a parse can
9
+ * match a component and still be STRUCTURALLY incoherent — e.g. a `house_number` or
10
+ * `street_suffix` floating with no `street` anywhere, an `attention` with no `venue`. These
11
+ * orphan fragments are the signature of the overconfident hallucinations the v0.6.x cycle fought.
12
+ * This checker lifts the harness from "address-level pass" to "address-level pass AND
13
+ * structurally valid."
14
+ *
15
+ * Two checks:
16
+ *
17
+ * 1. **illegal-edge** — invariant: a non-root node's parent tag must appear in its `PARENT_OF` list.
18
+ * (The tree builder enforces this by construction; the check guards against regressions in
19
+ * build-tree.ts.)
20
+ * 2. **stranded-dependent** — a STRICT dependent tag (one that is meaningless without a structural
21
+ * anchor) whose anchor type is entirely ABSENT from the tree. Geographic containers
22
+ * (postcode / locality / region / street / venue / po_box) are deliberately NOT checked: a
23
+ * postcode-only or city-only input is a degenerate-but-valid parse, not a violation.
24
+ */
25
+ import type { ComponentTag } from "../types/component.js";
26
+ import type { AddressTree } from "./types.js";
27
+ export interface TreeViolation {
28
+ type: "illegal-edge" | "stranded-dependent";
29
+ tag: ComponentTag;
30
+ value: string;
31
+ detail: string;
32
+ }
33
+ export interface TreeValidity {
34
+ valid: boolean;
35
+ violations: TreeViolation[];
36
+ }
37
+ /** Validate an `AddressTree`'s structural coherence. See module docstring. */
38
+ export declare function validateTree(tree: AddressTree): TreeValidity;
39
+ //# sourceMappingURL=validate-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-tree.d.ts","sourceRoot":"","sources":["../../decoder/validate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,YAAY,CAAA;AAoB1D,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAAA;IAC3C,GAAG,EAAE,YAAY,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IAC5B,KAAK,EAAE,OAAO,CAAA;IACd,UAAU,EAAE,aAAa,EAAE,CAAA;CAC3B;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,YAAY,CAwC5D"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Structural-validity checker for the decoded `AddressTree` — v0.7 task #37.
7
+ *
8
+ * The postcode-only harness scores an address as "pass" on exact component match, but a parse can
9
+ * match a component and still be STRUCTURALLY incoherent — e.g. a `house_number` or
10
+ * `street_suffix` floating with no `street` anywhere, an `attention` with no `venue`. These
11
+ * orphan fragments are the signature of the overconfident hallucinations the v0.6.x cycle fought.
12
+ * This checker lifts the harness from "address-level pass" to "address-level pass AND
13
+ * structurally valid."
14
+ *
15
+ * Two checks:
16
+ *
17
+ * 1. **illegal-edge** — invariant: a non-root node's parent tag must appear in its `PARENT_OF` list.
18
+ * (The tree builder enforces this by construction; the check guards against regressions in
19
+ * build-tree.ts.)
20
+ * 2. **stranded-dependent** — a STRICT dependent tag (one that is meaningless without a structural
21
+ * anchor) whose anchor type is entirely ABSENT from the tree. Geographic containers
22
+ * (postcode / locality / region / street / venue / po_box) are deliberately NOT checked: a
23
+ * postcode-only or city-only input is a degenerate-but-valid parse, not a violation.
24
+ */
25
+ import { containmentFor } from "./containment.js";
26
+ /**
27
+ * Tags that cannot stand alone: each is a sub-component of a specific structural anchor (street /
28
+ * locality / venue / postcode). If none of a tag's allowed parents appear anywhere in the tree, the
29
+ * node is an orphan fragment.
30
+ */
31
+ const STRICT_DEPENDENTS = new Set([
32
+ "street_prefix",
33
+ "street_prefix_particle",
34
+ "street_suffix",
35
+ "house_number",
36
+ "unit",
37
+ "dependent_locality",
38
+ "attention",
39
+ "cedex",
40
+ "intersection_a",
41
+ "intersection_b",
42
+ ]);
43
+ /** Validate an `AddressTree`'s structural coherence. See module docstring. */
44
+ export function validateTree(tree) {
45
+ const violations = [];
46
+ // Validate against the tree's own addressing system's hierarchy (defaults to Western).
47
+ const parentOf = containmentFor(tree.system);
48
+ const present = new Set();
49
+ const collect = (n) => {
50
+ present.add(n.tag);
51
+ n.children.forEach(collect);
52
+ };
53
+ tree.roots.forEach(collect);
54
+ const walk = (node, parent) => {
55
+ const allowed = parentOf[node.tag];
56
+ // 1. Edge invariant.
57
+ if (parent && (!allowed || !allowed.includes(parent.tag))) {
58
+ violations.push({
59
+ type: "illegal-edge",
60
+ tag: node.tag,
61
+ value: node.value,
62
+ detail: `${node.tag} nested under ${parent.tag}; allowed parents: [${(allowed ?? []).join(", ")}]`,
63
+ });
64
+ }
65
+ // 2. Stranded strict-dependent.
66
+ if (STRICT_DEPENDENTS.has(node.tag) && allowed && !allowed.some((t) => present.has(t))) {
67
+ violations.push({
68
+ type: "stranded-dependent",
69
+ tag: node.tag,
70
+ value: node.value,
71
+ detail: `${node.tag} has no anchor (none of [${allowed.join(", ")}] present in the parse)`,
72
+ });
73
+ }
74
+ node.children.forEach((c) => walk(c, node));
75
+ };
76
+ tree.roots.forEach((r) => walk(r, null));
77
+ return { valid: violations.length === 0, violations };
78
+ }
79
+ //# sourceMappingURL=validate-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-tree.js","sourceRoot":"","sources":["../../decoder/validate-tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD;;;;GAIG;AACH,MAAM,iBA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C,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxF,UAAU,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,oBAAoB;gBAC1B,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,4BAA4B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB;aAC1F,CAAC,CAAA;QACH,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IAC5C,CAAC,CAAA;IACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;IAExC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,UAAU,EAAE,CAAA;AACtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-pipeline.d.ts","sourceRoot":"","sources":["../../pipeline/runtime-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAQX,YAAY,EACZ,cAAc,EAGd,qBAAqB,EACrB,MAAM,YAAY,CAAA;AA6HnB;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAChC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,qBAAqB,EAC7B,IAAI,CAAC,EAAE,YAAY,GACjB,OAAO,CAAC,cAAc,CAAC,CAqJzB"}
1
+ {"version":3,"file":"runtime-pipeline.d.ts","sourceRoot":"","sources":["../../pipeline/runtime-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAQX,YAAY,EACZ,cAAc,EAGd,qBAAqB,EACrB,MAAM,YAAY,CAAA;AA4HnB;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAChC,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,qBAAqB,EAC7B,IAAI,CAAC,EAAE,YAAY,GACjB,OAAO,CAAC,cAAc,CAAC,CAqJzB"}
@@ -15,8 +15,7 @@ import { reconcileSpans } from "./reconcile.js";
15
15
  import { aggregateSpanLogits } from "./span-logit-aggregation.js";
16
16
  /**
17
17
  * Known QueryShape format strings that indicate "this token is a postcode". Mirrors the set in
18
- *
19
- * @mailwoman/kind-classifier — kept duplicated so core/pipeline has no dep on kind-classifier.
18
+ * `@mailwoman/kind-classifier` — kept duplicated so core/pipeline has no dep on kind-classifier.
20
19
  */
21
20
  const POSTCODE_FORMATS = new Set([
22
21
  "us_zip",
@@ -267,7 +266,8 @@ function throwIfAborted(opts) {
267
266
  /** Defensive wrapper: if the classifier throws, return an empty tree rather than abort the pipeline. */
268
267
  async function safeClassify(classifier, text, queryShape, fst) {
269
268
  try {
270
- return await classifier.parse(text, { queryShape, fst });
269
+ // Postcode regex repair on by default (v0.7 #35, operator-signed).
270
+ return await classifier.parse(text, { queryShape, fst, postcodeRepair: true });
271
271
  }
272
272
  catch {
273
273
  return { raw: text, roots: [] };
@@ -303,13 +303,22 @@ function grouperAudit(tree, proposals, text) {
303
303
  if (proposals.length === 0)
304
304
  return tree;
305
305
  const roots = [...tree.roots];
306
+ const allNodes = [];
307
+ const collectNodes = (nodes) => {
308
+ for (const n of nodes) {
309
+ allNodes.push({ start: n.start, end: n.end });
310
+ if (n.children)
311
+ collectNodes(n.children);
312
+ }
313
+ };
314
+ collectNodes(roots);
306
315
  for (const proposal of proposals) {
307
316
  const tag = PHRASE_KIND_TO_TAG.get(proposal.kindHypothesis);
308
317
  if (!tag)
309
318
  continue;
310
319
  const pStart = proposal.span.start;
311
320
  const pEnd = pStart + proposal.span.body.length;
312
- const covered = roots.some((node) => node.start < pEnd && pStart < node.end);
321
+ const covered = allNodes.some((node) => node.start < pEnd && pStart < node.end);
313
322
  if (covered)
314
323
  continue;
315
324
  const provisionalNode = {
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-pipeline.js","sourceRoot":"","sources":["../../pipeline/runtime-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAgBjE;;;;GAIG;AACH,MAAM,gBAAgB,GAAwB,IAAI,GAAG,CAAC;IACrD,QAAQ;IACR,SAAS;IACT,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;IACb,aAAa;CACb,CAAC,CAAA;AAEF,SAAS,gBAAgB,CAAC,MAAc;IACvC,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC;AAED,SAAS,mBAAmB,CAAC,GAAuB;IACnD,OAAO,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC;AAED,sEAAsE;AACtE,SAAS,iBAAiB,CAAC,GAAW,EAAE,IAA0B;IACjE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AAC7D,CAAC;AAED,yEAAyE;AACzE,SAAS,eAAe;IACvB,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,CAAA;AAC5B,CAAC;AAED,iFAAiF;AACjF,KAAK,UAAU,mBAAmB,CACjC,MAA2B,EAC3B,MAAsB,EACtB,IAA2B;IAE3B,MAAM,MAAM,GAAG,IAAI,EAAE,IAAI,IAAI,KAAK,CAAA;IAClC,OAAO;QACN,MAAM;QACN,UAAU,EAAE,IAAI,EAAE,I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AClC,MAAM,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;QAE/C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;QAC/E,IAAI,OAAO;YAAE,SAAQ;QAErB,MAAM,eAAe,GAAgB;YACpC,GAAG;YACH,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC;YAC/B,KAAK,EAAE,MAAM;YACb,GAAG,EAAE,IAAI;YACT,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,sBAAsB;YACxD,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,eAAe;YACvB,QAAQ,EAAE,WAAW,QAAQ,CAAC,cAAc,EAAE;SAC9C,CAAA;QAED,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAC5B,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAA;IAEvC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,CAAA;AAChC,CAAC;AAED,+EAA+E;AAC/E,KAAK,UAAU,WAAW,CACzB,QAAwD,EACxD,IAAiB,EACjB,IAAmB;IAEnB,IAAI,CAAC;QACJ,OAAO,MAAM,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;IAC3D,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAA;IACZ,CAAC;AACF,CAAC"}
@@ -47,8 +47,9 @@ export interface SpanBounds {
47
47
  * @param logits Per-token logits from ONNX inference, shape `[seqLen][numLabels]`.
48
48
  * @param pieces Token pieces with character-level offsets (from the tokenizer's `encode`).
49
49
  * @param spans Phrase-grouper span proposals in character offsets.
50
- * @param opts Options — `topK` (default 3), `labels` (required — the BIO label vocabulary the model
51
- * emits, e.g. `["O", "B-locality", "I-locality", ...]`).
50
+ * @param opts Options bag.
51
+ * @param opts.topK Number of top-scoring tags to return per span (default 3).
52
+ * @param opts.labels The BIO label vocabulary the model emits, e.g. `["O", "B-locality", ...]`.
52
53
  */
53
54
  export declare function aggregateSpanLogits(logits: number[][], pieces: readonly TokenPiece[], spans: readonly SpanBounds[], opts: {
54
55
  topK?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"span-logit-aggregation.d.ts","sourceRoot":"","sources":["../../pipeline/span-logit-aggregation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACX;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,MAAM,EAAE,EAAE,EAClB,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,KAAK,EAAE,SAAS,UAAU,EAAE,EAC5B,IAAI,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAChD,mBAAmB,EAAE,CAiDvB"}
1
+ {"version":3,"file":"span-logit-aggregation.d.ts","sourceRoot":"","sources":["../../pipeline/span-logit-aggregation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEz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