@mailwoman/kind-classifier 7.2.1 → 7.3.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.
- package/out/poi.d.ts +14 -1
- package/out/poi.d.ts.map +1 -1
- package/out/poi.js +1 -1
- package/out/poi.js.map +1 -1
- package/package.json +2 -2
- package/poi.ts +14 -1
package/out/poi.d.ts
CHANGED
|
@@ -6,14 +6,27 @@
|
|
|
6
6
|
* POI subject detection for the `poi_query` kind. The lexicon is INJECTED (`POIPhraseLookup`) —
|
|
7
7
|
* this package keeps its bitter-lesson invariant (no dictionaries in-tree); the phrase table
|
|
8
8
|
* lives in `@mailwoman/poi-taxonomy` and is wired in by `createRuntimePipeline` behind the
|
|
9
|
-
*
|
|
9
|
+
* `poiQueryKind` flag (default-ON since 2026-07-20). Spec §3.1.
|
|
10
10
|
*/
|
|
11
11
|
import type { NormalizedInputLite, QueryShapeLike } from "./types.ts";
|
|
12
12
|
/** One lexicon hit for a candidate subject phrase. */
|
|
13
13
|
export interface POIPhraseMatch {
|
|
14
|
+
/**
|
|
15
|
+
* The matched subject's identifier string. For `kind: "category"`, a `@mailwoman/poi-taxonomy` category id. For
|
|
16
|
+
* `kind: "brand"`, the brand's canonical display name (NOT a taxonomy id) — `matchPOISubject` never reads this field
|
|
17
|
+
* itself, so the caller (`mailwoman`'s `poi-intent.ts`) is the one that interprets it per `kind`.
|
|
18
|
+
*/
|
|
14
19
|
categoryID: string;
|
|
15
20
|
matchedPhrase: string;
|
|
16
21
|
confidence: number;
|
|
22
|
+
/** Which lexicon this hit came from. Existing category lookups set `"category"` (backward-compatible default). */
|
|
23
|
+
/**
|
|
24
|
+
* Absent = "category" (the pre-brand shape) — optional so pre-7.3 POIPhraseLookup implementors stay
|
|
25
|
+
* source-compatible.
|
|
26
|
+
*/
|
|
27
|
+
kind?: "category" | "brand";
|
|
28
|
+
/** Wikidata QID, when known. `kind: "brand"` only — absent when a brand resolved by name alone (no QID match). */
|
|
29
|
+
wikidata?: string;
|
|
17
30
|
}
|
|
18
31
|
/** Injected phrase→category lookup. Exact-phrase, locale-aware; returns [] on miss. */
|
|
19
32
|
export type POIPhraseLookup = (phrase: string, locale?: string) => ReadonlyArray<POIPhraseMatch>;
|
package/out/poi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poi.d.ts","sourceRoot":"","sources":["../poi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAErE,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"poi.d.ts","sourceRoot":"","sources":["../poi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAErE,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC9B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,kHAAkH;IAClH;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;IAC3B,kHAAkH;IAClH,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,uFAAuF;AACvF,MAAM,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC,cAAc,CAAC,CAAA;AAEhG,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,cAAc,CAAA;IACrB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAA;IACf,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAA;CACjB;AAWD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC9B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,EAAE,eAAe,GACrB,eAAe,GAAG,IAAI,CA6BxB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,eAAe,EACvB,MAAM,CAAC,EAAE,MAAM,GACb,CAAC,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,cAAc,KAAK,MAAM,CAiB/D"}
|
package/out/poi.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* POI subject detection for the `poi_query` kind. The lexicon is INJECTED (`POIPhraseLookup`) —
|
|
7
7
|
* this package keeps its bitter-lesson invariant (no dictionaries in-tree); the phrase table
|
|
8
8
|
* lives in `@mailwoman/poi-taxonomy` and is wired in by `createRuntimePipeline` behind the
|
|
9
|
-
*
|
|
9
|
+
* `poiQueryKind` flag (default-ON since 2026-07-20). Spec §3.1.
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
12
|
* Anchor separator between subject and place: comma, or near/in/at/around — scanned left-to-right until a prefix hits
|
package/out/poi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poi.js","sourceRoot":"","sources":["../poi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"poi.js","sourceRoot":"","sources":["../poi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAmCH;;;GAGG;AACH,MAAM,gBAAgB,GAAG,uCAAuC,CAAA;AAEhE,2FAA2F;AAC3F,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAE5B;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC9B,IAAY,EACZ,MAA0B,EAC1B,MAAuB;IAEvB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;IAE3B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAEzB,M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CAAC,OAAO;YAAE,OAAO,CAAC,CAAA;QAEtB,IAAI,OAAO,CAAC,SAAS,KAAK,EAAE;YAAE,OAAO,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAA;QAEpE,gFAAgF;QAChF,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC;YAAE,OAAO,CAAC,CAAA;QAE9C,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC,CAAA;QAE5C,IAAI,QAAQ,GAAG,CAAC;YAAE,OAAO,CAAC,CAAA;QAE1B,OAAO,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAA;IACtC,CAAC,CAAA;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/kind-classifier",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Stage 2.5 of the runtime pipeline — categorize inputs by query shape (postcode_only / locality_only / structured_address / intersection / po_box / landmark / vague). Rule-based for v1.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -41,6 +41,6 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@mailwoman/core": "7.
|
|
44
|
+
"@mailwoman/core": "7.3.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/poi.ts
CHANGED
|
@@ -6,16 +6,29 @@
|
|
|
6
6
|
* POI subject detection for the `poi_query` kind. The lexicon is INJECTED (`POIPhraseLookup`) —
|
|
7
7
|
* this package keeps its bitter-lesson invariant (no dictionaries in-tree); the phrase table
|
|
8
8
|
* lives in `@mailwoman/poi-taxonomy` and is wired in by `createRuntimePipeline` behind the
|
|
9
|
-
*
|
|
9
|
+
* `poiQueryKind` flag (default-ON since 2026-07-20). Spec §3.1.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import type { NormalizedInputLite, QueryShapeLike } from "./types.ts"
|
|
13
13
|
|
|
14
14
|
/** One lexicon hit for a candidate subject phrase. */
|
|
15
15
|
export interface POIPhraseMatch {
|
|
16
|
+
/**
|
|
17
|
+
* The matched subject's identifier string. For `kind: "category"`, a `@mailwoman/poi-taxonomy` category id. For
|
|
18
|
+
* `kind: "brand"`, the brand's canonical display name (NOT a taxonomy id) — `matchPOISubject` never reads this field
|
|
19
|
+
* itself, so the caller (`mailwoman`'s `poi-intent.ts`) is the one that interprets it per `kind`.
|
|
20
|
+
*/
|
|
16
21
|
categoryID: string
|
|
17
22
|
matchedPhrase: string
|
|
18
23
|
confidence: number
|
|
24
|
+
/** Which lexicon this hit came from. Existing category lookups set `"category"` (backward-compatible default). */
|
|
25
|
+
/**
|
|
26
|
+
* Absent = "category" (the pre-brand shape) — optional so pre-7.3 POIPhraseLookup implementors stay
|
|
27
|
+
* source-compatible.
|
|
28
|
+
*/
|
|
29
|
+
kind?: "category" | "brand"
|
|
30
|
+
/** Wikidata QID, when known. `kind: "brand"` only — absent when a brand resolved by name alone (no QID match). */
|
|
31
|
+
wikidata?: string
|
|
19
32
|
}
|
|
20
33
|
|
|
21
34
|
/** Injected phrase→category lookup. Exact-phrase, locale-aware; returns [] on miss. */
|