@finbheara/names 0.15.0 → 0.16.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 +12 -6
- package/dist/chunks/{index-7vvt5hhy.js → index-0wpvbdgh.js} +2631 -1395
- package/dist/chunks/{index-7vvt5hhy.js.map → index-0wpvbdgh.js.map} +4 -4
- package/dist/chunks/{index-kw69ry3j.js → index-74fyytnh.js} +1333 -20
- package/dist/chunks/{index-kw69ry3j.js.map → index-74fyytnh.js.map} +5 -4
- package/dist/chunks/{index-pncn9y2r.js → index-a6f2y4aa.js} +2 -2
- package/dist/chunks/{index-2565cn5x.js → index-ky754nsf.js} +3 -3
- package/dist/chunks/{index-ka8nzreg.js → index-tk01chxw.js} +2 -2
- package/dist/chunks/{index-kw6gbrnq.js → index-tqdbxd92.js} +2 -2
- package/dist/chunks/{index-a15g2gp6.js → index-ye6j60jn.js} +3 -3
- package/dist/chunks/phrase-2hj26asc.js +11 -0
- package/dist/classifier/index.js +3 -3
- package/dist/cli/census.js +4 -4
- package/dist/index.js +14 -8
- package/dist/index.js.map +1 -1
- package/dist/lexicon/index.js +4 -2
- package/dist/lexicon/index.js.map +1 -1
- package/dist/measure/index.js +4 -4
- package/dist/normalize/index.js +9 -5
- package/dist/normalize/index.js.map +1 -1
- package/dist/types/lexicon/flags.d.ts +13 -5
- package/dist/types/normalize/given-families.d.ts +48 -0
- package/dist/types/normalize/index.d.ts +1 -0
- package/dist/types/normalize/name-kinship.d.ts +12 -8
- package/docs/NAME-NORMALIZATION.md +36 -7
- package/names.txt +2624 -1389
- package/package.json +3 -2
- package/src/normalize/given-families.MANIFEST.json +46 -0
- package/dist/chunks/phrase-2nmvkrc5.js +0 -11
- /package/dist/chunks/{index-pncn9y2r.js.map → index-a6f2y4aa.js.map} +0 -0
- /package/dist/chunks/{index-2565cn5x.js.map → index-ky754nsf.js.map} +0 -0
- /package/dist/chunks/{index-ka8nzreg.js.map → index-tk01chxw.js.map} +0 -0
- /package/dist/chunks/{index-kw6gbrnq.js.map → index-tqdbxd92.js.map} +0 -0
- /package/dist/chunks/{index-a15g2gp6.js.map → index-ye6j60jn.js.map} +0 -0
- /package/dist/chunks/{phrase-2nmvkrc5.js.map → phrase-2hj26asc.js.map} +0 -0
package/README.md
CHANGED
|
@@ -145,8 +145,10 @@ name cells, one per line. The specification is `docs/NAME-NORMALIZATION.md`.
|
|
|
145
145
|
### How two names are related
|
|
146
146
|
|
|
147
147
|
```ts
|
|
148
|
-
import {
|
|
149
|
-
|
|
148
|
+
import {
|
|
149
|
+
createGivenFamilyList, createNameIndex, createNameKinship, givenFamilyTable, nameKinship,
|
|
150
|
+
personName,
|
|
151
|
+
} from "@finbheara/names/normalize";
|
|
150
152
|
|
|
151
153
|
nameKinship(personName("Kate Smith"), personName("Katherine Smith"));
|
|
152
154
|
// { relation: "candidate", via: ["given-family"], reason: "middles-equal", gateSafe: true }
|
|
@@ -157,13 +159,16 @@ nameKinship(personName("Kate M Smith"), personName("Katherine Conley-Smith")).vi
|
|
|
157
159
|
nameKinship(personName("Connor Smith"), personName("Conor Smith")).via; // ["given-variant"]
|
|
158
160
|
nameKinship(personName("Evie Smith"), personName("Genevieve Smith"));
|
|
159
161
|
// { relation: "candidate", via: ["given-family-not-gate"], reason: "middles-equal", gateSafe: false }
|
|
162
|
+
nameKinship(personName("Beth Smith"), personName("Bethany Smith")); // the extended family list
|
|
163
|
+
// { relation: "candidate", via: ["given-maybe"], reason: "middles-equal", gateSafe: false }
|
|
160
164
|
|
|
161
165
|
// the given-name tolerance is a list of providers, asked in order
|
|
162
|
-
const
|
|
163
|
-
|
|
166
|
+
const tableOnly = createNameKinship({ given: [givenFamilyTable] });
|
|
167
|
+
tableOnly(personName("Beth Smith"), personName("Bethany Smith")).reason; // "given-differs"
|
|
168
|
+
const common = createNameKinship({
|
|
169
|
+
given: [givenFamilyTable, createGivenFamilyList({ maxTier: 1 })], // common forms only
|
|
164
170
|
});
|
|
165
|
-
|
|
166
|
-
// { relation: "candidate", via: ["given-maybe"], reason: "middles-equal", gateSafe: false }
|
|
171
|
+
common(personName("Maggie Smith"), personName("Marjorie Smith")).reason; // "given-differs"
|
|
167
172
|
|
|
168
173
|
const index = createNameIndex<number>("nn3"); // a NameMap with a tolerant lookup
|
|
169
174
|
index.set(personName("Mary Conley-Larson"), 1).set(personName("Mary Carlson"), 2);
|
|
@@ -242,6 +247,7 @@ given name. Flags are case-sensitive and combine (`Kelly:AF`, `New York:BG`).
|
|
|
242
247
|
| `B` | multi-word entry (bigram or trigram) |
|
|
243
248
|
| `S` | a known typo, kept so it is recognised |
|
|
244
249
|
| `X` | excluded from the display renderer's round-trip check |
|
|
250
|
+
| `D` | a given name a diminutive table holds (`Kate:FD`); a mark, like `S` and `X` |
|
|
245
251
|
|
|
246
252
|
A digit after `L` or `A` is a **tradition footnote**: `1` Armenian, `2` Germanic,
|
|
247
253
|
`3` Iberian, `4` Irish/Gaelic, `5` Nordic, `6` Slavic (`Kowalski:L6`). An index is
|