@mailwoman/record 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.
- package/README.md +14 -16
- package/lib/address.ts +60 -74
- package/lib/name.ts +66 -39
- package/lib/organization.ts +47 -81
- package/out/address.d.ts +41 -56
- package/out/address.d.ts.map +1 -1
- package/out/address.js +11 -28
- package/out/address.js.map +1 -1
- package/out/name.d.ts +29 -21
- package/out/name.d.ts.map +1 -1
- package/out/name.js +43 -46
- package/out/name.js.map +1 -1
- package/out/organization.d.ts +26 -50
- package/out/organization.d.ts.map +1 -1
- package/out/organization.js +28 -67
- package/out/organization.js.map +1 -1
- package/package.json +17 -39
package/out/name.js
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
+
import { TextSpliterator } from "spliterator";
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
3
|
+
* Titles / salutations that lead a name.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* compare.
|
|
8
|
-
*
|
|
9
|
-
* A rule-based positional parser, the portable recipe from `python-nameparser`: split on a comma to
|
|
10
|
-
* detect `Last, First` inversion, then classify tokens by position against configurable title /
|
|
11
|
-
* suffix / particle lists. We deliberately store the surname **particle** (`van`, `de la`, `von`)
|
|
12
|
-
* separately from the bare surname (the `theiconic/name-parser` pattern) so the matcher can
|
|
13
|
-
* compare `Vega` independent of `de la` — sources that drop or vary the particle still match.
|
|
14
|
-
*
|
|
15
|
-
* Scope + honesty (per the name-canonicalization research pass):
|
|
16
|
-
*
|
|
17
|
-
* - Western / romanized names only. Cultural given-family ORDER variation (East-Asian family-first)
|
|
18
|
-
* and transliteration are not handled here — a documented follow-up.
|
|
19
|
-
* - Nickname → canonical-root mapping is intentionally NOT done at parse time: it is lossy and
|
|
20
|
-
* gendered (Bobbie → Robert _or_ Roberta), so equivalence belongs in the matcher as a fuzzy
|
|
21
|
-
* agreement level, not a destructive rewrite. We only _extract_ a parenthetical/quoted
|
|
22
|
-
* nickname.
|
|
23
|
-
* - A CRF parser (probablepeople) is the gold-standard reference but too heavy to port; this
|
|
24
|
-
* positional parser covers the documented hard cases (inversion, particles, generational +
|
|
25
|
-
* professional suffixes) without a model.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Titles / salutations that lead a name. Matched case-insensitively, trailing `.` ignored.
|
|
5
|
+
* Matched case-insensitively, trailing `.` ignored.
|
|
29
6
|
*/
|
|
30
7
|
const TITLES = new Set([
|
|
31
8
|
"airman",
|
|
@@ -124,8 +101,10 @@ const SUFFIXES = new Set([
|
|
|
124
101
|
"pharmd",
|
|
125
102
|
]);
|
|
126
103
|
/**
|
|
127
|
-
* Surname particles.
|
|
128
|
-
*
|
|
104
|
+
* Surname particles.
|
|
105
|
+
*
|
|
106
|
+
* Consecutive particles fold together (`de` + `la` → `de la`), and the next
|
|
107
|
+
* non-particle token begins the bare surname.
|
|
129
108
|
*/
|
|
130
109
|
const PARTICLES = new Set([
|
|
131
110
|
"al",
|
|
@@ -165,13 +144,23 @@ const isPresent = (s) => typeof s === "string" && s.trim().length > 0;
|
|
|
165
144
|
const norm = (token) => token.replace(/\.$/, "").toLowerCase();
|
|
166
145
|
const countChar = (s, c) => s.split(c).length - 1;
|
|
167
146
|
/**
|
|
168
|
-
* Parse a full name into components.
|
|
169
|
-
*
|
|
147
|
+
* Parse a full name into components.
|
|
148
|
+
*
|
|
149
|
+
* @returns `null` for empty input.
|
|
150
|
+
* Best-effort and non-throwing — ambiguous input degrades gracefully rather than erroring.
|
|
170
151
|
*/
|
|
171
152
|
export function parsePersonName(input) {
|
|
172
153
|
if (!isPresent(input))
|
|
173
154
|
return null;
|
|
174
|
-
const result = {
|
|
155
|
+
const result = {
|
|
156
|
+
prefix: null,
|
|
157
|
+
given: null,
|
|
158
|
+
middle: null,
|
|
159
|
+
family: null,
|
|
160
|
+
familyParticle: null,
|
|
161
|
+
suffix: null,
|
|
162
|
+
nickname: null,
|
|
163
|
+
};
|
|
175
164
|
// 1. Extract a parenthetical "(Jim)" or quoted "Jim" nickname, then strip it out.
|
|
176
165
|
let working = input
|
|
177
166
|
.replaceAll(/\s*\(([^)]+)\)\s*/g, (_m, n) => {
|
|
@@ -191,7 +180,7 @@ export function parsePersonName(input) {
|
|
|
191
180
|
// 2. Resolve a single comma: "Last, First" inversion, unless the tail is a known suffix
|
|
192
181
|
// ("John Smith, Jr."), in which case keep order and treat the tail as a suffix.
|
|
193
182
|
if (countChar(working, ",") === 1) {
|
|
194
|
-
const [head, tail] =
|
|
183
|
+
const [head, tail] = TextSpliterator.from(working, { delimiter: "," }).toArray();
|
|
195
184
|
if (tail && tail.split(/\s+/).every((t) => SUFFIXES.has(norm(t)))) {
|
|
196
185
|
result.suffix = tail;
|
|
197
186
|
working = head;
|
|
@@ -200,10 +189,10 @@ export function parsePersonName(input) {
|
|
|
200
189
|
working = `${tail} ${head}`;
|
|
201
190
|
}
|
|
202
191
|
}
|
|
203
|
-
const tokens = working.split(/\s+/).filter((value) => value.length
|
|
192
|
+
const tokens = working.split(/\s+/).filter((value) => value.length);
|
|
204
193
|
if (!tokens.length)
|
|
205
|
-
return Object.
|
|
206
|
-
// 3.
|
|
194
|
+
return Object.values(result).some((value) => value !== null) ? result : null;
|
|
195
|
+
// 3. Titles at the start become the prefix.
|
|
207
196
|
const prefixParts = [];
|
|
208
197
|
while (tokens.length > 1 && TITLES.has(norm(tokens[0]))) {
|
|
209
198
|
prefixParts.push(tokens.shift());
|
|
@@ -211,7 +200,7 @@ export function parsePersonName(input) {
|
|
|
211
200
|
if (prefixParts.length) {
|
|
212
201
|
result.prefix = prefixParts.join(" ");
|
|
213
202
|
}
|
|
214
|
-
// 4.
|
|
203
|
+
// 4. Suffixes at the end become the suffix, while one name token must remain.
|
|
215
204
|
const suffixParts = [];
|
|
216
205
|
while (tokens.length > 1 && SUFFIXES.has(norm(tokens.at(-1)))) {
|
|
217
206
|
suffixParts.unshift(tokens.pop());
|
|
@@ -221,7 +210,8 @@ export function parsePersonName(input) {
|
|
|
221
210
|
}
|
|
222
211
|
if (!tokens.length)
|
|
223
212
|
return result;
|
|
224
|
-
// 5. Locate the surname particle run
|
|
213
|
+
// 5. Locate the surname particle run.
|
|
214
|
+
// Everything from it onward is the (particled) surname.
|
|
225
215
|
let particleStart = -1;
|
|
226
216
|
for (let i = 0; i < tokens.length; i++) {
|
|
227
217
|
// A particle only starts a surname if a bare-surname token follows it.
|
|
@@ -261,24 +251,31 @@ export function parsePersonName(input) {
|
|
|
261
251
|
return result;
|
|
262
252
|
}
|
|
263
253
|
/**
|
|
264
|
-
* The
|
|
265
|
-
*
|
|
254
|
+
* The order a person name prints in.
|
|
255
|
+
*
|
|
256
|
+
* Western / romanized only, the same scope {@linkcode parsePersonName} declares.
|
|
257
|
+
* A family-first system does not use this order in reverse.
|
|
258
|
+
* An invented order here would be worse than having none.
|
|
266
259
|
*/
|
|
267
260
|
const NAME_ORDER = ["prefix", "given", "middle", "familyParticle", "family", "suffix"];
|
|
268
261
|
/**
|
|
269
|
-
* The parts {@linkcode formatPersonName} prints for the short style
|
|
270
|
-
*
|
|
262
|
+
* The parts {@linkcode formatPersonName} prints for the short style.
|
|
263
|
+
*
|
|
264
|
+
* What a person is addressed by, without the title, the nickname or the letters after.
|
|
271
265
|
*/
|
|
272
266
|
const SHORT_NAME_ORDER = ["given", "familyParticle", "family"];
|
|
273
267
|
/**
|
|
274
268
|
* Render a {@linkcode PersonName} back to a string — the inverse of {@linkcode parsePersonName}.
|
|
275
269
|
*
|
|
276
|
-
* `"full"` prints every part the parser identified except the nickname
|
|
277
|
-
*
|
|
278
|
-
*
|
|
270
|
+
* `"full"` prints every part the parser identified except the nickname.
|
|
271
|
+
* A nickname is an alternative to the given name rather than an addition to it.
|
|
272
|
+
*
|
|
273
|
+
* `"short"` prints what a person is addressed by.
|
|
274
|
+
* Display labels and match keys use this form.
|
|
279
275
|
*
|
|
280
|
-
* The particle travels
|
|
281
|
-
* `Vega` independently of `de la`;
|
|
276
|
+
* The particle travels with the surname in both styles.
|
|
277
|
+
* The parser stores it separately so the matcher can compare `Vega` independently of `de la`;
|
|
278
|
+
* printing them apart would produce a form absent from the input name.
|
|
282
279
|
*/
|
|
283
280
|
export function formatPersonName(name, style = "full") {
|
|
284
281
|
if (!name)
|
package/out/name.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name.js","sourceRoot":"","sources":["../lib/name.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"name.js","sourceRoot":"","sources":["../lib/name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAkE7C;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC;IACtB,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,WAAW;IACX,MAAM;IACN,SAAS;IACT,MAAM;IACN,KAAK;IACL,SAAS;IACT,WAAW;IACX,cAAc;IACd,KAAK;IACL,KAAK;IACL,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,QAAQ;IACR,IAAI;IACJ,KAAK;IACL,SAAS;IACT,KAAK;IACL,WAAW;IACX,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,KAAK;IACL,OAAO;IACP,QAAQ;IACR,MAAM;IACN,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,QAAQ;IACR,KAAK;IACL,MAAM;IACN,WAAW;IACX,SAAS;IACT,MAAM;IACN,WAAW;IACX,KAAK;IACL,OAAO;IACP,KAAK;IACL,gBAAgB;IAChB,KAAK;IACL,UAAU;IACV,KAAK;IACL,SAAS;IACT,KAAK;IACL,KAAK;IACL,QAAQ;CACR,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;IACxB,eAAe;IACf,IAAI;IACJ,IAAI;I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AAE,gBAAgB,EAAE,QAAQ,CAAC,CAAA;AAO7F;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAgC,EAAE,KAAK,GAAoB,MAAM;IACjG,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAA;IAEpB,MAAM,KAAK,GAAG,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAA;IAC/D,MAAM,KAAK,GAAa,EAAE,CAAA;IAE1B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAA;QAEhC,IAAI,KAAK,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAClB,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACvB,CAAC"}
|
package/out/organization.d.ts
CHANGED
|
@@ -3,39 +3,9 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `Corporation`, `Limited`, `LLC`) are normalized away before matching, so `Acme Corp` and `Acme
|
|
10
|
-
* Corporation, LLC` collapse to the same key. We also split off a `doing business as` clause and
|
|
11
|
-
* normalize connectives (`&` → `and`), punctuation, accents, and a leading `The`.
|
|
12
|
-
*
|
|
13
|
-
* **The collision problem (#668).** A legal-form token in one jurisdiction is a meaningful word in
|
|
14
|
-
* another domain. `PT` is Indonesia's `Perseroan Terbatas` (its LLC) — and US-healthcare
|
|
15
|
-
* shorthand for _Physical Therapy_. `SCA` / `SCS` are French/Belgian/Luxembourg commandite forms
|
|
16
|
-
* — and, in a clinic's name, _Sudden Cardiac Arrest_ / _Spinal Cord Stimulator_. A single
|
|
17
|
-
* universal strip-list can't be right for both: strip `PT` and you corrupt `Lakeside PT`; keep it
|
|
18
|
-
* and you leave the legal form on an Indonesian company. So the strip-set is computed on **two
|
|
19
|
-
* axes**:
|
|
20
|
-
*
|
|
21
|
-
* - **jurisdiction** (ISO 3166-1 alpha-2, e.g. from the resolved address country) — _adds_ the legal
|
|
22
|
-
* forms valid in that country. Collision-prone forms (`pt`, `sca`, `scs`) live here, admitted only
|
|
23
|
-
* behind a known jurisdiction, NOT in the universal base.
|
|
24
|
-
* - **domain** (an ingest-config tag, e.g. `healthcare`) — _protects_ domain-meaningful tokens from
|
|
25
|
-
* ever being stripped, even when a jurisdiction pack would add them. Domain protection wins.
|
|
26
|
-
*
|
|
27
|
-
* `effective = (base ∪ jurisdiction-pack) − domain-protect-pack`. With no options the set is the
|
|
28
|
-
* universal base and behavior is byte-for-byte unchanged — the new axes are strictly opt-in.
|
|
29
|
-
*
|
|
30
|
-
* Evidence honesty (per the name-canonicalization research pass): the PERSON-name side is well
|
|
31
|
-
* sourced; the ORGANIZATION side is a known evidence gap. This is a solid _canonicalization_
|
|
32
|
-
* baseline (the strip-designations principle is Winkler-grounded; the designation list draws on
|
|
33
|
-
* the ISO 20275 Entity Legal Forms register and `cleanco`). The jurisdiction/domain packs below
|
|
34
|
-
* are grounded seeds, not exhaustive — extend them per ISO 20275 as locales are added. The harder
|
|
35
|
-
* org-_matching_ problems — acronym ↔ expansion (`IBM` ↔ `International Business Machines`),
|
|
36
|
-
* DBA/alias resolution beyond the simple clause, subsidiary/parent, and TF-IDF n-gram token
|
|
37
|
-
* matching — are deferred to a follow-up (a dedicated org-matching research pass + the matcher
|
|
38
|
-
* epic).
|
|
6
|
+
* Canonicalizes organization names by removing legal designations. It normalizes DBA clauses plus punctuation and accents.
|
|
7
|
+
* It also folds connectives and leading articles. Jurisdiction adds local legal forms. Domain rules preserve
|
|
8
|
+
* ambiguous terms that could otherwise be stripped.
|
|
39
9
|
*/
|
|
40
10
|
/**
|
|
41
11
|
* A canonicalized organization name.
|
|
@@ -56,37 +26,43 @@ export interface OrganizationName {
|
|
|
56
26
|
/**
|
|
57
27
|
* The `doing business as` / trade-name clause, canonicalized, when one was present.
|
|
58
28
|
*/
|
|
59
|
-
dba
|
|
29
|
+
dba: string | null;
|
|
60
30
|
}
|
|
61
31
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
32
|
+
* Names a domain pack.
|
|
33
|
+
*
|
|
34
|
+
* Each pack leaves domain-specific abbreviations in the organization name
|
|
35
|
+
* instead of stripping them as legal forms.
|
|
36
|
+
* The `general` pack adds no domain-specific abbreviations.
|
|
65
37
|
*/
|
|
66
38
|
export type DesignationDomain = "general" | "healthcare";
|
|
67
39
|
/**
|
|
68
|
-
* Context for {@link canonicalizeOrganizationName}
|
|
40
|
+
* Context for {@link canonicalizeOrganizationName}; omit both fields for the universal base behavior.
|
|
69
41
|
*/
|
|
70
42
|
export interface CanonicalizeOptions {
|
|
71
43
|
/**
|
|
72
|
-
* ISO 3166-1 alpha-2 country code
|
|
73
|
-
*
|
|
74
|
-
*
|
|
44
|
+
* ISO 3166-1 alpha-2 country code for the organization's jurisdiction.
|
|
45
|
+
*
|
|
46
|
+
* Its country pack adds that jurisdiction's legal forms to the strip set.
|
|
47
|
+
* The comparison ignores case.
|
|
48
|
+
* Unknown codes add no pack.
|
|
75
49
|
*/
|
|
76
|
-
jurisdiction?: string;
|
|
50
|
+
jurisdiction?: string | null;
|
|
77
51
|
/**
|
|
78
|
-
* Ingest domain
|
|
79
|
-
*
|
|
52
|
+
* Ingest domain that keeps domain-specific abbreviations in organization names.
|
|
53
|
+
*
|
|
54
|
+
* The `healthcare` domain leaves `pt` in the name.
|
|
55
|
+
* It also leaves `sca` and `scs`.
|
|
56
|
+
* These rules take precedence over jurisdiction packs.
|
|
80
57
|
*/
|
|
81
58
|
domain?: DesignationDomain;
|
|
82
59
|
}
|
|
83
60
|
/**
|
|
84
|
-
* Canonicalize an organization name: split off any `doing business as` clause,
|
|
85
|
-
*
|
|
61
|
+
* Canonicalize an organization name: split off any `doing business as` clause,
|
|
62
|
+
* then reduce the legal name to a designation-stripped key.
|
|
86
63
|
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* used and the result is byte-for-byte the legacy behavior.
|
|
64
|
+
* Returns `null` for empty input. {@link CanonicalizeOptions} resolves conflicts
|
|
65
|
+
* between jurisdiction and domain rules.
|
|
90
66
|
*/
|
|
91
|
-
export declare function canonicalizeOrganizationName(input: string | null
|
|
67
|
+
export declare function canonicalizeOrganizationName(input: string | null, options?: CanonicalizeOptions): OrganizationName | null;
|
|
92
68
|
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../lib/organization.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../lib/organization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAClB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,YAAY,CAAA;AAExD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC1B;AAqJD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC3C,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC3B,gBAAgB,GAAG,IAAI,CAYzB"}
|
package/out/organization.js
CHANGED
|
@@ -3,48 +3,17 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `Corporation`, `Limited`, `LLC`) are normalized away before matching, so `Acme Corp` and `Acme
|
|
10
|
-
* Corporation, LLC` collapse to the same key. We also split off a `doing business as` clause and
|
|
11
|
-
* normalize connectives (`&` → `and`), punctuation, accents, and a leading `The`.
|
|
12
|
-
*
|
|
13
|
-
* **The collision problem (#668).** A legal-form token in one jurisdiction is a meaningful word in
|
|
14
|
-
* another domain. `PT` is Indonesia's `Perseroan Terbatas` (its LLC) — and US-healthcare
|
|
15
|
-
* shorthand for _Physical Therapy_. `SCA` / `SCS` are French/Belgian/Luxembourg commandite forms
|
|
16
|
-
* — and, in a clinic's name, _Sudden Cardiac Arrest_ / _Spinal Cord Stimulator_. A single
|
|
17
|
-
* universal strip-list can't be right for both: strip `PT` and you corrupt `Lakeside PT`; keep it
|
|
18
|
-
* and you leave the legal form on an Indonesian company. So the strip-set is computed on **two
|
|
19
|
-
* axes**:
|
|
20
|
-
*
|
|
21
|
-
* - **jurisdiction** (ISO 3166-1 alpha-2, e.g. from the resolved address country) — _adds_ the legal
|
|
22
|
-
* forms valid in that country. Collision-prone forms (`pt`, `sca`, `scs`) live here, admitted only
|
|
23
|
-
* behind a known jurisdiction, NOT in the universal base.
|
|
24
|
-
* - **domain** (an ingest-config tag, e.g. `healthcare`) — _protects_ domain-meaningful tokens from
|
|
25
|
-
* ever being stripped, even when a jurisdiction pack would add them. Domain protection wins.
|
|
26
|
-
*
|
|
27
|
-
* `effective = (base ∪ jurisdiction-pack) − domain-protect-pack`. With no options the set is the
|
|
28
|
-
* universal base and behavior is byte-for-byte unchanged — the new axes are strictly opt-in.
|
|
29
|
-
*
|
|
30
|
-
* Evidence honesty (per the name-canonicalization research pass): the PERSON-name side is well
|
|
31
|
-
* sourced; the ORGANIZATION side is a known evidence gap. This is a solid _canonicalization_
|
|
32
|
-
* baseline (the strip-designations principle is Winkler-grounded; the designation list draws on
|
|
33
|
-
* the ISO 20275 Entity Legal Forms register and `cleanco`). The jurisdiction/domain packs below
|
|
34
|
-
* are grounded seeds, not exhaustive — extend them per ISO 20275 as locales are added. The harder
|
|
35
|
-
* org-_matching_ problems — acronym ↔ expansion (`IBM` ↔ `International Business Machines`),
|
|
36
|
-
* DBA/alias resolution beyond the simple clause, subsidiary/parent, and TF-IDF n-gram token
|
|
37
|
-
* matching — are deferred to a follow-up (a dedicated org-matching research pass + the matcher
|
|
38
|
-
* epic).
|
|
6
|
+
* Canonicalizes organization names by removing legal designations. It normalizes DBA clauses plus punctuation and accents.
|
|
7
|
+
* It also folds connectives and leading articles. Jurisdiction adds local legal forms. Domain rules preserve
|
|
8
|
+
* ambiguous terms that could otherwise be stripped.
|
|
39
9
|
*/
|
|
40
|
-
import { foldForKey } from "@mailwoman/codex/address
|
|
10
|
+
import { foldForKey } from "@mailwoman/codex/address/key";
|
|
41
11
|
/**
|
|
42
|
-
* Universal legal-entity designations
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* jurisdiction.
|
|
12
|
+
* Universal legal-entity designations, normalized to lowercase without punctuation
|
|
13
|
+
* and stripped as whole tokens.
|
|
14
|
+
*
|
|
15
|
+
* Name-meaningful words and the collision-prone forms that live in
|
|
16
|
+
* {@link JURISDICTION_DESIGNATIONS} are deliberately absent.
|
|
48
17
|
*/
|
|
49
18
|
const BASE_DESIGNATIONS = new Set([
|
|
50
19
|
"inc",
|
|
@@ -96,15 +65,13 @@ const BASE_DESIGNATIONS = new Set([
|
|
|
96
65
|
"doo",
|
|
97
66
|
"ood",
|
|
98
67
|
"ead",
|
|
99
|
-
// Belgian forms
|
|
68
|
+
// Belgian forms, safe in the base because they collide with no domain.
|
|
100
69
|
"bvba",
|
|
101
70
|
"sprl",
|
|
102
71
|
]);
|
|
103
72
|
/**
|
|
104
|
-
* Jurisdiction-conditional legal forms (ISO 3166-1 alpha-2 → forms)
|
|
105
|
-
*
|
|
106
|
-
* Stripping these is correct ONLY when we know the org's country — never in the universal base. Grounded seeds, not
|
|
107
|
-
* exhaustive; extend per ISO 20275.
|
|
73
|
+
* Jurisdiction-conditional legal forms (ISO 3166-1 alpha-2 → forms) added only when the jurisdiction
|
|
74
|
+
* is known, holding the collision-prone tokens (`pt`, `sca`, `scs`) that the base must not strip.
|
|
108
75
|
*/
|
|
109
76
|
const JURISDICTION_DESIGNATIONS = {
|
|
110
77
|
ID: ["pt", "tbk", "ud"], // Perseroan Terbatas / Terbuka (listed) / Usaha Dagang
|
|
@@ -115,19 +82,18 @@ const JURISDICTION_DESIGNATIONS = {
|
|
|
115
82
|
IT: ["sapa", "snc"], // S.a.p.a. (commandite par actions) / società in nome collettivo
|
|
116
83
|
};
|
|
117
84
|
/**
|
|
118
|
-
* Domain
|
|
119
|
-
*
|
|
120
|
-
* collide with jurisdiction-conditional legal forms — `pt` (Physical Therapy), `sca` (Sudden Cardiac Arrest), `scs`
|
|
121
|
-
* (Spinal Cord Stimulator) — plus a couple of always-clinical ones for future-proofing.
|
|
85
|
+
* Domain guard-sets (domain → tokens never stripped) that override any jurisdiction pack,
|
|
86
|
+
* e.g. `healthcare` keeps `pt`, `sca`, and `scs` from being stripped as legal forms.
|
|
122
87
|
*/
|
|
123
88
|
const DOMAIN_PROTECTED = {
|
|
124
89
|
general: [],
|
|
125
90
|
healthcare: ["pt", "sca", "scs", "ot", "dpt"],
|
|
126
91
|
};
|
|
127
92
|
/**
|
|
128
|
-
* Compute the effective
|
|
129
|
-
*
|
|
130
|
-
* the
|
|
93
|
+
* Compute the effective strip-set `(base ∪ jurisdiction-pack) − domain-guard-pack`.
|
|
94
|
+
*
|
|
95
|
+
* @returns the shared base set unchanged when no context is given (the byte-stable default),
|
|
96
|
+
* so the common path allocates no set.
|
|
131
97
|
*/
|
|
132
98
|
function resolveDesignations(options) {
|
|
133
99
|
const jurisdiction = options?.jurisdiction?.trim().toUpperCase();
|
|
@@ -153,8 +119,10 @@ function resolveDesignations(options) {
|
|
|
153
119
|
*/
|
|
154
120
|
const DBA_PATTERN = /\s+(?:d\/b\/a|dba|doing business as|t\/a|trading as|a\/k\/a|aka|fka|f\/k\/a)\s+/i;
|
|
155
121
|
/**
|
|
156
|
-
* Canonicalize one name fragment: lowercase, strip accents, connectives → `and`,
|
|
157
|
-
* `the`, strip legal designations, collapse whitespace.
|
|
122
|
+
* Canonicalize one name fragment: lowercase, strip accents, connectives → `and`,
|
|
123
|
+
* drop punctuation, remove a leading `the`, strip legal designations, collapse whitespace.
|
|
124
|
+
*
|
|
125
|
+
* @returns the key plus the designations it removed.
|
|
158
126
|
*/
|
|
159
127
|
function canonicalizeFragment(fragment, designationSet) {
|
|
160
128
|
const normalized = foldForKey(fragment, { ampersand: "and", dropPeriods: true }).replace(/^the\s+/, "");
|
|
@@ -173,12 +141,11 @@ function canonicalizeFragment(fragment, designationSet) {
|
|
|
173
141
|
return { canonical: kept.join(" "), designations };
|
|
174
142
|
}
|
|
175
143
|
/**
|
|
176
|
-
* Canonicalize an organization name: split off any `doing business as` clause,
|
|
177
|
-
*
|
|
144
|
+
* Canonicalize an organization name: split off any `doing business as` clause,
|
|
145
|
+
* then reduce the legal name to a designation-stripped key.
|
|
178
146
|
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
181
|
-
* used and the result is byte-for-byte the legacy behavior.
|
|
147
|
+
* Returns `null` for empty input. {@link CanonicalizeOptions} resolves conflicts
|
|
148
|
+
* between jurisdiction and domain rules.
|
|
182
149
|
*/
|
|
183
150
|
export function canonicalizeOrganizationName(input, options) {
|
|
184
151
|
if (typeof input !== "string" || !input.trim())
|
|
@@ -187,13 +154,7 @@ export function canonicalizeOrganizationName(input, options) {
|
|
|
187
154
|
const designationSet = resolveDesignations(options);
|
|
188
155
|
const [legalPart, ...dbaParts] = input.split(DBA_PATTERN);
|
|
189
156
|
const { canonical, designations } = canonicalizeFragment(legalPart ?? "", designationSet);
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
const dba = canonicalizeFragment(dbaParts.join(" "), designationSet).canonical;
|
|
193
|
-
if (dba) {
|
|
194
|
-
result.dba = dba;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return result;
|
|
157
|
+
const dba = dbaParts.length ? canonicalizeFragment(dbaParts.join(" "), designationSet).canonical : null;
|
|
158
|
+
return { raw, canonical, designations, dba: dba || null };
|
|
198
159
|
}
|
|
199
160
|
//# sourceMappingURL=organization.js.map
|
package/out/organization.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../lib/organization.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../lib/organization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AAuDzD;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IACjC,KAAK;IACL,cAAc;IACd,MAAM;IACN,aAAa;IACb,IAAI;IACJ,SAAS;IACT,KAAK;IACL,MAAM;IACN,KAAK;IACL,MAAM;IACN,IAAI;IACJ,KAAK;IACL,SAAS;IACT,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,MAAM;IACN,IAAI;IACJ,MAAM;IACN,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,IAAI;IACJ,MAAM;IACN,IAAI;IACJ,KAAK;IACL,aAAa;IACb,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK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3D,MAAM,GAAG,GAAG,KAAK,CAAA;IACjB,MAAM,cAAc,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IACnD,MAAM,CAAC,SAAS,EAAE,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;IAEzD,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,oBAAoB,CAAC,SAAS,IAAI,EAAE,EAAE,cAAc,CAAC,CAAA;IAEzF,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAA;IAEvG,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,IAAI,IAAI,EAAE,CAAA;AAC1D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/record",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Lean, plain-TypeScript record schema + per-field normalizers for the geocode-first matcher. Address-first: the canonical PostalAddress record composes parser components, the formatter's match key, and a resolved geocode; organization + contact records build on the same canonical record.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -13,15 +13,10 @@
|
|
|
13
13
|
"out/**/*.js.map",
|
|
14
14
|
"out/**/*.d.ts",
|
|
15
15
|
"out/**/*.d.ts.map",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"**/*.ts",
|
|
19
|
-
"**/*.tsx",
|
|
20
|
-
"!*.test.ts",
|
|
21
|
-
"!*.test.tsx",
|
|
16
|
+
"lib/**/*.ts",
|
|
17
|
+
"lib/**/*.tsx",
|
|
22
18
|
"!**/*.test.ts",
|
|
23
|
-
"!**/*.test.tsx"
|
|
24
|
-
"!test/**"
|
|
19
|
+
"!**/*.test.tsx"
|
|
25
20
|
],
|
|
26
21
|
"type": "module",
|
|
27
22
|
"sideEffects": false,
|
|
@@ -39,20 +34,10 @@
|
|
|
39
34
|
"node": "./out/index.js",
|
|
40
35
|
"default": "./out/index.js"
|
|
41
36
|
},
|
|
42
|
-
"
|
|
43
|
-
"types": "./out
|
|
44
|
-
"node": "./out
|
|
45
|
-
"default": "./out
|
|
46
|
-
},
|
|
47
|
-
"./name": {
|
|
48
|
-
"types": "./out/name.d.ts",
|
|
49
|
-
"node": "./out/name.js",
|
|
50
|
-
"default": "./out/name.js"
|
|
51
|
-
},
|
|
52
|
-
"./organization": {
|
|
53
|
-
"types": "./out/organization.d.ts",
|
|
54
|
-
"node": "./out/organization.js",
|
|
55
|
-
"default": "./out/organization.js"
|
|
37
|
+
"./*": {
|
|
38
|
+
"types": "./out/*.d.ts",
|
|
39
|
+
"node": "./out/*.js",
|
|
40
|
+
"default": "./out/*.js"
|
|
56
41
|
}
|
|
57
42
|
},
|
|
58
43
|
"publishConfig": {
|
|
@@ -64,20 +49,10 @@
|
|
|
64
49
|
"node": "./out/index.js",
|
|
65
50
|
"default": "./out/index.js"
|
|
66
51
|
},
|
|
67
|
-
"
|
|
68
|
-
"types": "./out
|
|
69
|
-
"node": "./out
|
|
70
|
-
"default": "./out
|
|
71
|
-
},
|
|
72
|
-
"./name": {
|
|
73
|
-
"types": "./out/name.d.ts",
|
|
74
|
-
"node": "./out/name.js",
|
|
75
|
-
"default": "./out/name.js"
|
|
76
|
-
},
|
|
77
|
-
"./organization": {
|
|
78
|
-
"types": "./out/organization.d.ts",
|
|
79
|
-
"node": "./out/organization.js",
|
|
80
|
-
"default": "./out/organization.js"
|
|
52
|
+
"./*": {
|
|
53
|
+
"types": "./out/*.d.ts",
|
|
54
|
+
"node": "./out/*.js",
|
|
55
|
+
"default": "./out/*.js"
|
|
81
56
|
}
|
|
82
57
|
},
|
|
83
58
|
"imports": {
|
|
@@ -89,9 +64,12 @@
|
|
|
89
64
|
}
|
|
90
65
|
},
|
|
91
66
|
"dependencies": {
|
|
92
|
-
"@mailwoman/
|
|
67
|
+
"@mailwoman/annotations": "10.2.0",
|
|
68
|
+
"@mailwoman/codex": "10.2.0",
|
|
69
|
+
"@mailwoman/spatial": "10.2.0",
|
|
70
|
+
"spliterator": "^9.2.0"
|
|
93
71
|
},
|
|
94
72
|
"devDependencies": {
|
|
95
|
-
"@types/node": "^26.4
|
|
73
|
+
"@types/node": "^26.6.4"
|
|
96
74
|
}
|
|
97
75
|
}
|