@finbheara/names 0.9.2 → 0.10.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 (40) hide show
  1. package/README.md +38 -1
  2. package/dist/chunks/{index-knrkej0f.js → index-7sppf1vh.js} +72 -8
  3. package/dist/chunks/{index-knrkej0f.js.map → index-7sppf1vh.js.map} +5 -3
  4. package/dist/chunks/{index-0qptxnwh.js → index-7vvt5hhy.js} +13 -2
  5. package/dist/chunks/{index-0qptxnwh.js.map → index-7vvt5hhy.js.map} +2 -2
  6. package/dist/chunks/index-ebebeamh.js +446 -0
  7. package/dist/chunks/index-ebebeamh.js.map +10 -0
  8. package/dist/chunks/{index-fzzq5txh.js → index-khxa4qjy.js} +2 -2
  9. package/dist/chunks/{index-2fsdvhaf.js → index-kw6gbrnq.js} +2 -2
  10. package/dist/chunks/{index-d4wr471g.js → index-pncn9y2r.js} +2 -2
  11. package/dist/chunks/index-qsznkk4s.js +3 -0
  12. package/dist/chunks/index-qsznkk4s.js.map +9 -0
  13. package/dist/chunks/{index-852w8w1s.js → index-r5fp3znj.js} +3 -3
  14. package/dist/chunks/{index-0vg56t5v.js → index-yq8hsd1f.js} +3 -3
  15. package/dist/chunks/phrase-672g18kw.js +11 -0
  16. package/dist/classifier/index.js +3 -3
  17. package/dist/cli/census.js +4 -4
  18. package/dist/index.js +25 -8
  19. package/dist/index.js.map +1 -1
  20. package/dist/lexicon/index.js +1 -1
  21. package/dist/measure/index.js +4 -4
  22. package/dist/normalize/index.js +17 -5
  23. package/dist/normalize/index.js.map +1 -1
  24. package/dist/phonetic/index.js +10 -0
  25. package/dist/phonetic/index.js.map +9 -0
  26. package/dist/types/index.d.ts +2 -0
  27. package/dist/types/normalize/block-keys.d.ts +53 -0
  28. package/dist/types/normalize/index.d.ts +2 -0
  29. package/dist/types/normalize/name-columns.d.ts +51 -0
  30. package/dist/types/phonetic/double-metaphone.d.ts +25 -0
  31. package/dist/types/phonetic/index.d.ts +11 -0
  32. package/names.txt +11 -0
  33. package/package.json +8 -2
  34. package/dist/chunks/phrase-dczgr4vs.js +0 -11
  35. /package/dist/chunks/{index-fzzq5txh.js.map → index-khxa4qjy.js.map} +0 -0
  36. /package/dist/chunks/{index-2fsdvhaf.js.map → index-kw6gbrnq.js.map} +0 -0
  37. /package/dist/chunks/{index-d4wr471g.js.map → index-pncn9y2r.js.map} +0 -0
  38. /package/dist/chunks/{index-852w8w1s.js.map → index-r5fp3znj.js.map} +0 -0
  39. /package/dist/chunks/{index-0vg56t5v.js.map → index-yq8hsd1f.js.map} +0 -0
  40. /package/dist/chunks/{phrase-dczgr4vs.js.map → phrase-672g18kw.js.map} +0 -0
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import"../chunks/index-0qptxnwh.js";
2
+ import"../chunks/index-7vvt5hhy.js";
3
3
  import {
4
4
  createNameCensus2
5
- } from "../chunks/index-0vg56t5v.js";
6
- import"../chunks/index-fzzq5txh.js";
5
+ } from "../chunks/index-yq8hsd1f.js";
6
+ import"../chunks/index-khxa4qjy.js";
7
7
  import { createRequire } from "node:module";
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
 
@@ -20,7 +20,7 @@ async function main(argv) {
20
20
  const limit = Number(value("limit") ?? 25);
21
21
  const field = value("field") ?? "name";
22
22
  const orderField = value("order-field") ?? "order";
23
- const classifier = flag("classify") ? (await import("../chunks/phrase-dczgr4vs.js")).phraseClassifier() : undefined;
23
+ const classifier = flag("classify") ? (await import("../chunks/phrase-672g18kw.js")).phraseClassifier() : undefined;
24
24
  const census = createNameCensus2(classifier === undefined ? {} : { classifier });
25
25
  for await (const line of createInterface({
26
26
  input: process.stdin,
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ import {
29
29
  NAMES_TXT2,
30
30
  parseEntries2,
31
31
  Lexicon2
32
- } from "./chunks/index-0qptxnwh.js";
32
+ } from "./chunks/index-7vvt5hhy.js";
33
33
  import {
34
34
  CONNECTORS2,
35
35
  SCHOOL_KEYWORDS2,
@@ -37,7 +37,7 @@ import {
37
37
  createSegmenter2,
38
38
  createClassifier2,
39
39
  phraseClassifier2
40
- } from "./chunks/index-852w8w1s.js";
40
+ } from "./chunks/index-r5fp3znj.js";
41
41
  import"./chunks/index-jwx1mm4k.js";
42
42
  import {
43
43
  repairMojibake2,
@@ -73,20 +73,31 @@ import {
73
73
  infeasibleClass2,
74
74
  isListJoiner2,
75
75
  personList2,
76
+ surnameBlock2,
77
+ initialsBlock2,
78
+ metaphoneBlocks2,
79
+ NAME_LEVEL_COLUMNS2,
80
+ NAME_COLUMNS2,
81
+ nameColumns2,
76
82
  NAME_FORMATS2,
77
83
  nameFormatOrder2,
78
84
  ORDER_READINGS2,
79
85
  readNameCell2,
80
86
  DEFAULT_NAME_FORMAT_THRESHOLD2,
81
87
  deriveNameFormat2
82
- } from "./chunks/index-knrkej0f.js";
88
+ } from "./chunks/index-7sppf1vh.js";
89
+ import"./chunks/index-qsznkk4s.js";
83
90
  import {
84
91
  composeEvalSet2,
85
92
  evaluateClassifier2
86
- } from "./chunks/index-d4wr471g.js";
93
+ } from "./chunks/index-pncn9y2r.js";
94
+ import"./chunks/index-kw6gbrnq.js";
95
+ import {
96
+ doubleMetaphone2
97
+ } from "./chunks/index-ebebeamh.js";
87
98
  import {
88
99
  createNameCensus2
89
- } from "./chunks/index-0vg56t5v.js";
100
+ } from "./chunks/index-yq8hsd1f.js";
90
101
  import {
91
102
  NAME_REFUSED2,
92
103
  stripEveryAside2,
@@ -130,8 +141,7 @@ import {
130
141
  defaultPersonNameFactory2,
131
142
  personName2,
132
143
  personNameFromIcao2
133
- } from "./chunks/index-fzzq5txh.js";
134
- import"./chunks/index-2fsdvhaf.js";
144
+ } from "./chunks/index-khxa4qjy.js";
135
145
  import {
136
146
  TEAM_WORD2,
137
147
  TEAM_DESIGNATION_WORDS2,
@@ -166,7 +176,9 @@ export {
166
176
  MARK_FLAGS2 as MARK_FLAGS,
167
177
  MAX_READINGS2 as MAX_READINGS,
168
178
  NAMES_TXT2 as NAMES_TXT,
179
+ NAME_COLUMNS2 as NAME_COLUMNS,
169
180
  NAME_FORMATS2 as NAME_FORMATS,
181
+ NAME_LEVEL_COLUMNS2 as NAME_LEVEL_COLUMNS,
170
182
  NAME_PLACEHOLDERS2 as NAME_PLACEHOLDERS,
171
183
  NAME_REFUSED2 as NAME_REFUSED,
172
184
  NAME_TRADITIONS2 as NAME_TRADITIONS,
@@ -205,6 +217,7 @@ export {
205
217
  defaultPersonNameFactory2 as defaultPersonNameFactory,
206
218
  deriveNameFormat2 as deriveNameFormat,
207
219
  displaySpellings2 as displaySpellings,
220
+ doubleMetaphone2 as doubleMetaphone,
208
221
  editDistance2 as editDistance,
209
222
  evaluateClassifier2 as evaluateClassifier,
210
223
  foldNameKey2 as foldNameKey,
@@ -213,6 +226,7 @@ export {
213
226
  givenKeyAbbreviates2 as givenKeyAbbreviates,
214
227
  infeasibleClass2 as infeasibleClass,
215
228
  inferNameOrder2 as inferNameOrder,
229
+ initialsBlock2 as initialsBlock,
216
230
  isAmbiguous2 as isAmbiguous,
217
231
  isAscii2 as isAscii,
218
232
  isCanonicalTeamName2 as isCanonicalTeamName,
@@ -242,9 +256,11 @@ export {
242
256
  lookupKey2 as lookupKey,
243
257
  meetReading2 as meetReading,
244
258
  meetReadings2 as meetReadings,
259
+ metaphoneBlocks2 as metaphoneBlocks,
245
260
  middleForm2 as middleForm,
246
261
  nameBlockKeys2 as nameBlockKeys,
247
262
  nameCase2 as nameCase,
263
+ nameColumns2 as nameColumns,
248
264
  nameCompare2 as nameCompare,
249
265
  nameFold2 as nameFold,
250
266
  nameFormatOrder2 as nameFormatOrder,
@@ -281,6 +297,7 @@ export {
281
297
  splitPersonName2 as splitPersonName,
282
298
  stripEveryAside2 as stripEveryAside,
283
299
  stripTrailingCredentials2 as stripTrailingCredentials,
300
+ surnameBlock2 as surnameBlock,
284
301
  surnameParts2 as surnameParts,
285
302
  teamLetter2 as teamLetter,
286
303
  teamRowDesignation2 as teamRowDesignation,
@@ -291,5 +308,5 @@ export {
291
308
  traditionOf2 as traditionOf
292
309
  };
293
310
 
294
- //# debugId=72383B5CF66A450E64756E2164756E21
311
+ //# debugId=168C2BEC179E7C6664756E2164756E21
295
312
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "72383B5CF66A450E64756E2164756E21",
7
+ "debugId": "168C2BEC179E7C6664756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -29,7 +29,7 @@ import {
29
29
  NAMES_TXT2,
30
30
  parseEntries2,
31
31
  Lexicon2
32
- } from "../chunks/index-0qptxnwh.js";
32
+ } from "../chunks/index-7vvt5hhy.js";
33
33
  export {
34
34
  APOSTROPHE_CHARS2 as APOSTROPHE_CHARS,
35
35
  CLASSIFICATION_FLAGS2 as CLASSIFICATION_FLAGS,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  composeEvalSet2,
3
3
  evaluateClassifier2
4
- } from "../chunks/index-d4wr471g.js";
4
+ } from "../chunks/index-pncn9y2r.js";
5
5
  import {
6
6
  createNameCensus2
7
- } from "../chunks/index-0vg56t5v.js";
8
- import"../chunks/index-fzzq5txh.js";
9
- import"../chunks/index-0qptxnwh.js";
7
+ } from "../chunks/index-yq8hsd1f.js";
8
+ import"../chunks/index-khxa4qjy.js";
9
+ import"../chunks/index-7vvt5hhy.js";
10
10
  export {
11
11
  composeEvalSet2 as composeEvalSet,
12
12
  createNameCensus2 as createNameCensus,
@@ -32,13 +32,20 @@ import {
32
32
  infeasibleClass2,
33
33
  isListJoiner2,
34
34
  personList2,
35
+ surnameBlock2,
36
+ initialsBlock2,
37
+ metaphoneBlocks2,
38
+ NAME_LEVEL_COLUMNS2,
39
+ NAME_COLUMNS2,
40
+ nameColumns2,
35
41
  NAME_FORMATS2,
36
42
  nameFormatOrder2,
37
43
  ORDER_READINGS2,
38
44
  readNameCell2,
39
45
  DEFAULT_NAME_FORMAT_THRESHOLD2,
40
46
  deriveNameFormat2
41
- } from "../chunks/index-knrkej0f.js";
47
+ } from "../chunks/index-7sppf1vh.js";
48
+ import"../chunks/index-kw6gbrnq.js";
42
49
  import {
43
50
  NAME_REFUSED2,
44
51
  stripEveryAside2,
@@ -82,8 +89,7 @@ import {
82
89
  defaultPersonNameFactory2,
83
90
  personName2,
84
91
  personNameFromIcao2
85
- } from "../chunks/index-fzzq5txh.js";
86
- import"../chunks/index-2fsdvhaf.js";
92
+ } from "../chunks/index-khxa4qjy.js";
87
93
  import {
88
94
  TEAM_WORD2,
89
95
  TEAM_DESIGNATION_WORDS2,
@@ -96,7 +102,7 @@ import {
96
102
  } from "../chunks/index-0phgwy52.js";
97
103
  import {
98
104
  lexiconKey2
99
- } from "../chunks/index-0qptxnwh.js";
105
+ } from "../chunks/index-7vvt5hhy.js";
100
106
  export {
101
107
  COMPOUND_SURNAMES2 as COMPOUND_SURNAMES,
102
108
  DEFAULT_NAME_FORMAT_THRESHOLD2 as DEFAULT_NAME_FORMAT_THRESHOLD,
@@ -104,7 +110,9 @@ export {
104
110
  GIVEN_SEPARATOR2 as GIVEN_SEPARATOR,
105
111
  INFEASIBLE_CLASSES2 as INFEASIBLE_CLASSES,
106
112
  MAX_READINGS2 as MAX_READINGS,
113
+ NAME_COLUMNS2 as NAME_COLUMNS,
107
114
  NAME_FORMATS2 as NAME_FORMATS,
115
+ NAME_LEVEL_COLUMNS2 as NAME_LEVEL_COLUMNS,
108
116
  NAME_PLACEHOLDERS2 as NAME_PLACEHOLDERS,
109
117
  NAME_REFUSED2 as NAME_REFUSED,
110
118
  NAME_TRADITIONS2 as NAME_TRADITIONS,
@@ -138,6 +146,7 @@ export {
138
146
  givenKeyAbbreviates2 as givenKeyAbbreviates,
139
147
  infeasibleClass2 as infeasibleClass,
140
148
  inferNameOrder2 as inferNameOrder,
149
+ initialsBlock2 as initialsBlock,
141
150
  isCanonicalTeamName2 as isCanonicalTeamName,
142
151
  isCompoundSurname2 as isCompoundSurname,
143
152
  isIcaoName2 as isIcaoName,
@@ -149,9 +158,11 @@ export {
149
158
  lexiconKey2 as lexiconKey,
150
159
  meetReading2 as meetReading,
151
160
  meetReadings2 as meetReadings,
161
+ metaphoneBlocks2 as metaphoneBlocks,
152
162
  middleForm2 as middleForm,
153
163
  nameBlockKeys2 as nameBlockKeys,
154
164
  nameCase2 as nameCase,
165
+ nameColumns2 as nameColumns,
155
166
  nameCompare2 as nameCompare,
156
167
  nameFold2 as nameFold,
157
168
  nameFormatOrder2 as nameFormatOrder,
@@ -182,6 +193,7 @@ export {
182
193
  splitPersonName2 as splitPersonName,
183
194
  stripEveryAside2 as stripEveryAside,
184
195
  stripTrailingCredentials2 as stripTrailingCredentials,
196
+ surnameBlock2 as surnameBlock,
185
197
  surnameParts2 as surnameParts,
186
198
  teamLetter2 as teamLetter,
187
199
  teamRowDesignation2 as teamRowDesignation,
@@ -190,5 +202,5 @@ export {
190
202
  traditionLookupOf2 as traditionLookupOf
191
203
  };
192
204
 
193
- //# debugId=E840BFF5527EE85364756E2164756E21
205
+ //# debugId=F6630C203D8EAD8B64756E2164756E21
194
206
  //# sourceMappingURL=index.js.map
@@ -4,6 +4,6 @@
4
4
  "sourcesContent": [
5
5
  ],
6
6
  "mappings": "",
7
- "debugId": "E840BFF5527EE85364756E2164756E21",
7
+ "debugId": "F6630C203D8EAD8B64756E2164756E21",
8
8
  "names": []
9
9
  }
@@ -0,0 +1,10 @@
1
+ import"../chunks/index-qsznkk4s.js";
2
+ import {
3
+ doubleMetaphone2
4
+ } from "../chunks/index-ebebeamh.js";
5
+ export {
6
+ doubleMetaphone2 as doubleMetaphone
7
+ };
8
+
9
+ //# debugId=A3D8AA14030D5FE264756E2164756E21
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "A3D8AA14030D5FE264756E2164756E21",
8
+ "names": []
9
+ }
@@ -7,10 +7,12 @@
7
7
  * @finbheara/names/particles the particle vocabulary
8
8
  * @finbheara/names/classifier person / school / location phrase classification
9
9
  * @finbheara/names/normalize PersonName, its factories, compare, compose, lists
10
+ * @finbheara/names/phonetic how a word sounds, as a key (Double Metaphone)
10
11
  * @finbheara/names/measure census a stream of names against all of the above
11
12
  */
12
13
  export * from "./lexicon/index.ts";
13
14
  export * from "./particles/index.ts";
14
15
  export * from "./classifier/index.ts";
15
16
  export * from "./normalize/index.ts";
17
+ export * from "./phonetic/index.ts";
16
18
  export * from "./measure/index.ts";
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The three surname BLOCKING keys, in one place.
3
+ *
4
+ * A blocking key buckets names that are *worth comparing*; it decides nothing
5
+ * about identity. Each is derived from the halves of a parsed name, normally a
6
+ * `PersonName`'s `surnameKey()` and its first given name.
7
+ *
8
+ * | key | buckets on | asks |
9
+ * |---|---|---|
10
+ * | `surnameBlock` | the surname's A-Z letters | is the surname spelt alike? |
11
+ * | `metaphoneBlocks` | the surname's Double Metaphone codes | does the surname sound alike? |
12
+ * | `initialsBlock` | first given initial + surname initial | could these be one name at all? |
13
+ *
14
+ * They are not `surnameKey()`. That is the NN3 field, which keeps every letter and
15
+ * digit in every script; a block key keeps A-Z only, so a stray digit or an
16
+ * unfolded letter never splits a bucket and a key with no A-Z letter is no bucket.
17
+ *
18
+ * They are not `nameBlockKeys` (`./name-compose.ts`) either. That family keys each
19
+ * surname PART with the first initial, so a compound surname meets either of its
20
+ * halves, and it is the candidate generator for `composeNames`. These key the WHOLE
21
+ * surname key, by spelling, by sound or by initials, and know nothing of parts.
22
+ *
23
+ * ## One implementation, every caller
24
+ *
25
+ * A stored key that re-implemented one of these would be a second copy that can
26
+ * silently disagree with the first, and the disagreement is invisible: a self-join
27
+ * on the two simply returns different pairs. A store that bakes these keys and a
28
+ * reader that blocks live rows ask the same functions.
29
+ *
30
+ * ## An EMPTY key means "not blockable", never "matches other empty keys"
31
+ *
32
+ * Every function here returns `null` (or `[]`) for a blank surname, a name with no
33
+ * A-Z letter, or a surname Double Metaphone declines to encode. A caller skips
34
+ * those rather than pooling them into one enormous `""` bucket, and `null` carries
35
+ * that through SQL for free: no equality join matches NULL.
36
+ *
37
+ * Pure and I/O-free; `../phonetic` is the only import.
38
+ */
39
+ /** The surname's A-Z letters, or null when there are none. */
40
+ export declare function surnameBlock(surname: string): string | null;
41
+ /**
42
+ * First given initial + surname initial, the coarsest of the three. Null unless
43
+ * BOTH letters exist: a name missing either is skipped, not filed under a
44
+ * one-letter key.
45
+ */
46
+ export declare function initialsBlock(given: string, surname: string): string | null;
47
+ /**
48
+ * The surname's Double Metaphone codes: primary first, then the secondary WHEN
49
+ * IT DIFFERS. A name is filed under every code returned here, which is the
50
+ * standard double-filing recall trick (it lets an `X…`-secondary spelling meet an
51
+ * `S…`-primary one). Empty when the surname yields no primary code.
52
+ */
53
+ export declare function metaphoneBlocks(surname: string): string[];
@@ -24,4 +24,6 @@ export { type NameReading, type NameRelation, type NameRelationReason, comparePo
24
24
  export * from "./name-compose.ts";
25
25
  export { INFEASIBLE_CLASSES, type InfeasibleClass, compoundGiven, editDistance, infeasibleClass, middleForm, nearSpelling, } from "./name-infeasible.ts";
26
26
  export { type ListedPerson, isListJoiner, personList } from "./person-list.ts";
27
+ export { initialsBlock, metaphoneBlocks, surnameBlock } from "./block-keys.ts";
28
+ export { NAME_COLUMNS, NAME_LEVEL_COLUMNS, type NameColumn, type NameColumns, nameColumns, } from "./name-columns.ts";
27
29
  export { type CellSegmentation, type CellSegmenter, type CommaClass, DEFAULT_NAME_FORMAT_THRESHOLD, NAME_FORMATS, type NameCellOptions, type NameCellReading, type NameFormat, type NameFormatEvidence, type NameFormatOptions, type NameFormatResult, type NameFormatVerdict, ORDER_READINGS, type OrderReading, type PrintedNameCell, type SkipReason, deriveNameFormat, nameFormatOrder, readNameCell, } from "./name-format.ts";
@@ -0,0 +1,51 @@
1
+ /**
2
+ * A `PersonName` as database columns: the keys a store indexes, encoded once.
3
+ *
4
+ * A store that holds many prints and answers "which rows hold this name?" wants
5
+ * the parse's keys as plain columns, so the question is an equality lookup on an
6
+ * index rather than a parse per row. `nameColumns` is the one encoder of those
7
+ * keys, so a store that bakes them and a reader that parses a probe live cannot
8
+ * disagree about a key. It depends on no database: a row is a plain object of
9
+ * strings and nulls, and `NAME_COLUMNS` is its declared column order.
10
+ *
11
+ * | column | holds | answers |
12
+ * |---|---|---|
13
+ * | `nn0`-`nn4` | the transitive levels (`PersonName.nn0`…`nn4`) | a `NameMap`/`NameSet` lookup at that level |
14
+ * | `surname_key` | `surnameKey()` | do two prints agree on the surname? |
15
+ * | `given_key` | `givenName()` | do two prints agree on the given names? |
16
+ * | `blk_surname` | `surnameBlock(surnameKey())` | is the surname spelt alike? |
17
+ * | `blk_initials` | `initialsBlock(givenFields()[0], surnameKey())` | could these be one name at all? |
18
+ * | `blk_metaphone` | the first of `metaphoneBlocks(surnameKey())` | does the surname sound alike? |
19
+ * | `blk_metaphone_alt` | the second, when it differs | the same, under the alternate code |
20
+ *
21
+ * ## A level lookup is one equality
22
+ *
23
+ * `createNameMap(dop)` files a person under `name[dop]` and never finds a print
24
+ * that names no person. The level columns are exactly that slot: the level for a
25
+ * person, `null` otherwise. So `map.get(probe)` at level `dop` is
26
+ *
27
+ * SELECT … WHERE <dop> = nameColumns(probe)[dop]
28
+ *
29
+ * and a non-person probe carries `null`, which no equality matches, as the map
30
+ * answers `undefined` for it. NN5 is a distance and has no column, as it has no map.
31
+ *
32
+ * ## Null means "no key", never "an empty key"
33
+ *
34
+ * Every column is `null` where its key is empty or does not apply: a refused or
35
+ * empty print, a name with no given name, a surname with no A-Z letter. Two rows
36
+ * that both lack a key are not thereby alike, and `null` carries that through SQL
37
+ * for free. The metaphone pair is two columns because a name is filed under both
38
+ * codes; a row's code set is `{blk_metaphone} ∪ {blk_metaphone_alt}`.
39
+ */
40
+ import type { PersonName } from "./person-name.ts";
41
+ /** The level columns, one per transitive level, named as the level is. */
42
+ export declare const NAME_LEVEL_COLUMNS: readonly ["nn0", "nn1", "nn2", "nn3", "nn4"];
43
+ /** Every column `nameColumns` fills, in declared order. */
44
+ export declare const NAME_COLUMNS: readonly ["nn0", "nn1", "nn2", "nn3", "nn4", "surname_key", "given_key", "blk_surname", "blk_initials", "blk_metaphone", "blk_metaphone_alt"];
45
+ export type NameColumn = (typeof NAME_COLUMNS)[number];
46
+ /** One name's row: every column a string or `null`. */
47
+ export type NameColumns = {
48
+ readonly [C in NameColumn]: string | null;
49
+ };
50
+ /** The keys of one parsed name, as columns. See the module header for each. */
51
+ export declare function nameColumns(name: PersonName): NameColumns;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Double Metaphone: a phonetic key for a word, as it sounds rather than as it is spelt.
3
+ *
4
+ * Unlike Soundex it emits TWO codes per word, a primary and a secondary
5
+ * (alternate), so a word can be looked up under either pronunciation. That
6
+ * double-code behaviour is what a sound-alike lookup wants: `Smith` and `Smyth`
7
+ * (SM0 / XMT) collide, and `Kavanagh` / `Cavanagh` both encode to KFNK. It is a
8
+ * general key, not a surname key: a transcribed spoken word and a printed name are
9
+ * asked the same question, how does this sound.
10
+ *
11
+ * It follows the reference Double Metaphone control flow (2000): the same silent
12
+ * onsets (GN/KN/PN/WR/PS), GH / CH / C-variant / PH->F / vowel-only-at-start
13
+ * rules, Slavo-Germanic detection, and the 4-character code cap. It is NOT
14
+ * guaranteed byte-perfect against every entry of the reference test table, but it
15
+ * reproduces the standard rule set and groups the classic sound-alikes.
16
+ *
17
+ * Plain TypeScript, no dependencies and no state.
18
+ */
19
+ /**
20
+ * Encode `word` into its [primary, secondary] Double Metaphone codes. When the
21
+ * word has no phonetic alternate, secondary === primary. Non-letters are left
22
+ * to the caller to strip (`metaphoneBlocks` in `/normalize` keeps A-Z only); this
23
+ * operates on the raw uppercased string.
24
+ */
25
+ export declare function doubleMetaphone(word: string): [string, string];
@@ -0,0 +1,11 @@
1
+ /**
2
+ * `@finbheara/names/phonetic` — how a word sounds, as a key.
3
+ *
4
+ * A phonetic key groups spellings that are pronounced alike: `Smith` and `Smyth`,
5
+ * `Kavanagh` and `Cavanagh`, or a transcribed spoken word and the name it was
6
+ * heard as. It decides nothing about identity; two words that share a code are
7
+ * worth comparing, not the same.
8
+ *
9
+ * Self-contained: no lexicon, no particles, no state.
10
+ */
11
+ export { doubleMetaphone } from "./double-metaphone.ts";
package/names.txt CHANGED
@@ -5442,6 +5442,7 @@ Dial:L
5442
5442
  Diamond:FL
5443
5443
  Diana:F
5444
5444
  Diane:F
5445
+ Dianne:F
5445
5446
  Diarmuid:M
5446
5447
  Diaz:L
5447
5448
  DiBiase:L
@@ -6189,6 +6190,7 @@ Eichler:L
6189
6190
  Eid:L
6190
6191
  Eide:L
6191
6192
  Eidem:L
6193
+ Eiden:L
6192
6194
  Eiermann:L
6193
6195
  Eifert:L
6194
6196
  Eigel:L
@@ -10142,6 +10144,7 @@ Jaime:NL
10142
10144
  Jaimelynn:F
10143
10145
  Jaimie:F
10144
10146
  Jaina:F
10147
+ Jair:M
10145
10148
  Jaisy:F
10146
10149
  Jajko:L
10147
10150
  Jajuga:L
@@ -10394,6 +10397,7 @@ Jirasek:L
10394
10397
  Jirschele:L
10395
10398
  Jit:L
10396
10399
  Jiu:L
10400
+ Jo:N
10397
10401
  Joan:F
10398
10402
  Joanette:L
10399
10403
  Joanie:F
@@ -13032,6 +13036,7 @@ Luce:L
13032
13036
  Lucero:L
13033
13037
  Lucey:A
13034
13038
  Lucht:L
13039
+ Luci:F
13035
13040
  Lucia:F
13036
13041
  Luciana:F
13037
13042
  Luciani:L
@@ -13467,6 +13472,7 @@ Makhlouf:L
13467
13472
  Maki:L
13468
13473
  Makina:F
13469
13474
  Makowski:L6
13475
+ Maks:M
13470
13476
  Maksim:M
13471
13477
  Makyla:F
13472
13478
  Malachowsky:L
@@ -13833,6 +13839,7 @@ Maryfrances:F
13833
13839
  MaryGrace:F
13834
13840
  Maryia:F
13835
13841
  Maryjane:F
13842
+ MaryJo:F
13836
13843
  MaryKate:F
13837
13844
  MaryKathleen:F
13838
13845
  Maryland:G
@@ -13891,6 +13898,7 @@ Mather:L
13891
13898
  Mathers:L
13892
13899
  Mathes:L
13893
13900
  Matheson:L5
13901
+ Mathew:M
13894
13902
  Mathews:L
13895
13903
  Mathewson:L5
13896
13904
  Mathias:L
@@ -19991,6 +19999,7 @@ Slazak:L
19991
19999
  Slead:L
19992
20000
  Sleeth:L
19993
20001
  Slemon:L
20002
+ Slentz:L
19994
20003
  Slevin:L
19995
20004
  Sleziak:L
19996
20005
  Slicer:LC
@@ -20569,6 +20578,7 @@ Stilley:L
20569
20578
  Stilling:LC
20570
20579
  Stillman:L
20571
20580
  Stillson:L5
20581
+ Stilson:L
20572
20582
  Stimson:L5
20573
20583
  Stina:F
20574
20584
  Stine:L
@@ -21506,6 +21516,7 @@ Topper:L
21506
21516
  Tor:M
21507
21517
  Torah:F
21508
21518
  Toren:L
21519
+ Torey:N
21509
21520
  Tori:F
21510
21521
  Toriana:F
21511
21522
  Torie:N
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finbheara/names",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "description": "A curated lexicon of personal, school and place names, the surname-particle vocabulary, a phrase classifier and a person-name normalizer",
5
5
  "keywords": [
6
6
  "names",
@@ -11,7 +11,9 @@
11
11
  "surnames",
12
12
  "given-names",
13
13
  "irish",
14
- "particles"
14
+ "particles",
15
+ "phonetic",
16
+ "double-metaphone"
15
17
  ],
16
18
  "license": "MIT",
17
19
  "author": "Finbheara Systems",
@@ -42,6 +44,10 @@
42
44
  "types": "./dist/types/normalize/index.d.ts",
43
45
  "default": "./dist/normalize/index.js"
44
46
  },
47
+ "./phonetic": {
48
+ "types": "./dist/types/phonetic/index.d.ts",
49
+ "default": "./dist/phonetic/index.js"
50
+ },
45
51
  "./measure": {
46
52
  "types": "./dist/types/measure/index.d.ts",
47
53
  "default": "./dist/measure/index.js"
@@ -1,11 +0,0 @@
1
- import {
2
- phraseClassifier2
3
- } from "./index-852w8w1s.js";
4
- import"./index-2fsdvhaf.js";
5
- import"./index-0qptxnwh.js";
6
- export {
7
- phraseClassifier2 as phraseClassifier
8
- };
9
-
10
- //# debugId=BD8F5B3E6DE1DCF664756E2164756E21
11
- //# sourceMappingURL=phrase-dczgr4vs.js.map