@treeviz/gedcom-parser 2.1.9 → 2.1.12
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/dist/classes/common.d.ts.map +1 -1
- package/dist/classes/gedcom.d.ts +5 -0
- package/dist/classes/gedcom.d.ts.map +1 -1
- package/dist/classes/index.js +860 -464
- package/dist/classes/indi.d.ts.map +1 -1
- package/dist/classes/obje.d.ts.map +1 -1
- package/dist/cli/index.js +850 -454
- package/dist/constants/index.js +818 -448
- package/dist/factories/index.js +818 -448
- package/dist/index.js +865 -474
- package/dist/interfaces/indi.d.ts +1 -0
- package/dist/interfaces/indi.d.ts.map +1 -1
- package/dist/kinship-translator/index.js +818 -448
- package/dist/kinship-translator/kinship-translator.de.d.ts +2 -3
- package/dist/kinship-translator/kinship-translator.de.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.en.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.es.d.ts +2 -3
- package/dist/kinship-translator/kinship-translator.es.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.fr.d.ts +2 -3
- package/dist/kinship-translator/kinship-translator.fr.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.hu.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.ja.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.ru.d.ts +1 -1
- package/dist/kinship-translator/kinship-translator.ru.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.zh.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.de.d.ts +1 -0
- package/dist/kinship-translator/patterns.de.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.es.d.ts +1 -0
- package/dist/kinship-translator/patterns.es.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.fr.d.ts +1 -0
- package/dist/kinship-translator/patterns.fr.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.hu.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.ru.d.ts +1 -0
- package/dist/kinship-translator/patterns.ru.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.zh.d.ts.map +1 -1
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/gedzip.d.ts.map +1 -1
- package/dist/utils/index.js +865 -474
- package/dist/utils/local-media.d.ts +7 -3
- package/dist/utils/local-media.d.ts.map +1 -1
- package/dist/utils/media-utils.d.ts +20 -0
- package/dist/utils/media-utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/utils/index.js
CHANGED
|
@@ -93,11 +93,8 @@ var storeCache = {
|
|
|
93
93
|
getCacheDbs().relativesOnDegreeCache.setItem(value);
|
|
94
94
|
}
|
|
95
95
|
}, 50),
|
|
96
|
-
//
|
|
96
|
+
// Image bytes are stored as one IndexedDB record per photo.
|
|
97
97
|
profilePictureCache: debounce((value) => {
|
|
98
|
-
if (value) {
|
|
99
|
-
getCacheDbs().profilePictureCache.setItem(value);
|
|
100
|
-
}
|
|
101
98
|
}, 100)
|
|
102
99
|
};
|
|
103
100
|
var cacheInitialized = false;
|
|
@@ -106,13 +103,6 @@ var initializeCache = async () => {
|
|
|
106
103
|
return;
|
|
107
104
|
}
|
|
108
105
|
cacheInitialized = true;
|
|
109
|
-
try {
|
|
110
|
-
const profilePictureData = await getCacheDbs().profilePictureCache.getItem();
|
|
111
|
-
if (profilePictureData) {
|
|
112
|
-
caches.profilePictureCache = profilePictureData;
|
|
113
|
-
}
|
|
114
|
-
} catch (_error) {
|
|
115
|
-
}
|
|
116
106
|
};
|
|
117
107
|
var resetRelativesCache = () => {
|
|
118
108
|
caches.relativesOnDegreeCache = {};
|
|
@@ -318,6 +308,82 @@ var appendGedcomTrailer = (serialized) => {
|
|
|
318
308
|
}
|
|
319
309
|
return `${trimmed}${newline}0 TRLR`;
|
|
320
310
|
};
|
|
311
|
+
|
|
312
|
+
// src/utils/media-utils.ts
|
|
313
|
+
var getFileExtension = (filename) => {
|
|
314
|
+
if (!filename) {
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
if (filename.startsWith("data:")) {
|
|
318
|
+
const mime = filename.slice(5).split(";")[0] || "";
|
|
319
|
+
const subtype = (mime.split("/")[1] || "").toLowerCase();
|
|
320
|
+
if (subtype === "jpeg") {
|
|
321
|
+
return "jpg";
|
|
322
|
+
}
|
|
323
|
+
return subtype.split("+")[0] || "";
|
|
324
|
+
}
|
|
325
|
+
const withoutQuery = filename.split(/[?#]/)[0] || filename;
|
|
326
|
+
const match = withoutQuery.match(/\.([^.]+)$/);
|
|
327
|
+
return match ? match[1].toLowerCase() : "";
|
|
328
|
+
};
|
|
329
|
+
var isImageFormat = (format2) => {
|
|
330
|
+
if (!format2) {
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
let normalized = format2.toLowerCase().trim();
|
|
334
|
+
if (normalized.startsWith("data:")) {
|
|
335
|
+
normalized = getFileExtension(normalized);
|
|
336
|
+
} else if (normalized.includes("/")) {
|
|
337
|
+
normalized = normalized.split("/")[1]?.split("+")[0] || "";
|
|
338
|
+
if (normalized === "jpeg") {
|
|
339
|
+
normalized = "jpg";
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
const imageFormats = [
|
|
343
|
+
"jpg",
|
|
344
|
+
"jpeg",
|
|
345
|
+
"png",
|
|
346
|
+
"gif",
|
|
347
|
+
"bmp",
|
|
348
|
+
"webp",
|
|
349
|
+
"svg",
|
|
350
|
+
"tiff",
|
|
351
|
+
"tif"
|
|
352
|
+
];
|
|
353
|
+
return imageFormats.includes(normalized);
|
|
354
|
+
};
|
|
355
|
+
var resolveObjeForm = (obje) => {
|
|
356
|
+
const value = obje?.get?.("FILE.FORM")?.toValue?.() ?? obje?.get?.("FORM")?.toValue?.();
|
|
357
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
358
|
+
};
|
|
359
|
+
var mediaIdValue = (obje, path) => {
|
|
360
|
+
const value = obje?.get?.(path)?.toValue?.();
|
|
361
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
362
|
+
};
|
|
363
|
+
var resolveObjeMediaId = (obje) => mediaIdValue(obje, "RIN") || mediaIdValue(obje, "_CLON._OID") || mediaIdValue(obje, "_MSER._LKID") || mediaIdValue(obje, "_OID") || mediaIdValue(obje, "_LKID");
|
|
364
|
+
var ANCESTRY_MEDIA_RETRIEVAL_PREFIX = "https://www.ancestry.com/api/media/retrieval/v2/image";
|
|
365
|
+
var ANCESTRY_MEDIA_QUERY = "client=trees-mediaservice&imageQuality=hq";
|
|
366
|
+
var ancestryMediaPath = (namespace, imgId) => `/namespaces/${namespace}/media/${imgId}?${ANCESTRY_MEDIA_QUERY}`;
|
|
367
|
+
var ancestryMediaFileUrl = (namespace, imgId) => {
|
|
368
|
+
if (!namespace || !imgId) {
|
|
369
|
+
return void 0;
|
|
370
|
+
}
|
|
371
|
+
return `${ANCESTRY_MEDIA_RETRIEVAL_PREFIX}${ancestryMediaPath(namespace, imgId)}`;
|
|
372
|
+
};
|
|
373
|
+
var objeXrefKey = (obje, fallback = 0) => {
|
|
374
|
+
if (typeof obje?.id === "string" && obje.id) {
|
|
375
|
+
return obje.id;
|
|
376
|
+
}
|
|
377
|
+
const value = obje?.toValue?.();
|
|
378
|
+
if (typeof value === "string" && value.trim()) {
|
|
379
|
+
return value.trim();
|
|
380
|
+
}
|
|
381
|
+
if (typeof fallback === "string" && fallback.trim()) {
|
|
382
|
+
return fallback.trim();
|
|
383
|
+
}
|
|
384
|
+
return `@O${fallback}@`;
|
|
385
|
+
};
|
|
386
|
+
var objeNoteValue = (obje) => mediaIdValue(obje, "FILE.NOTE") || mediaIdValue(obje, "NOTE") || "";
|
|
321
387
|
var List = class _List {
|
|
322
388
|
// length = 0;
|
|
323
389
|
constructor(items) {
|
|
@@ -967,7 +1033,7 @@ var Common = class _Common {
|
|
|
967
1033
|
this,
|
|
968
1034
|
options.obje.namespace,
|
|
969
1035
|
options.obje.override,
|
|
970
|
-
void 0,
|
|
1036
|
+
this.isAncestry() ? ancestryMediaFileUrl : void 0,
|
|
971
1037
|
options.gedcomVersion
|
|
972
1038
|
);
|
|
973
1039
|
}
|
|
@@ -2709,15 +2775,21 @@ var isRemoteOrEmbeddedMediaUrl = (path) => {
|
|
|
2709
2775
|
}
|
|
2710
2776
|
return path.startsWith("data:") || path.startsWith("blob:") || /^https?:\/\//i.test(path);
|
|
2711
2777
|
};
|
|
2712
|
-
var resolveLocalMediaUrl = async (path) => {
|
|
2778
|
+
var resolveLocalMediaUrl = async (path, context) => {
|
|
2713
2779
|
if (!path) {
|
|
2714
2780
|
return void 0;
|
|
2715
2781
|
}
|
|
2716
|
-
if (
|
|
2782
|
+
if (path.startsWith("data:") || path.startsWith("blob:")) {
|
|
2783
|
+
return path;
|
|
2784
|
+
}
|
|
2785
|
+
const resolved = await localMediaResolver?.(path, context);
|
|
2786
|
+
if (resolved) {
|
|
2787
|
+
return resolved;
|
|
2788
|
+
}
|
|
2789
|
+
if (/^https?:\/\//i.test(path)) {
|
|
2717
2790
|
return path;
|
|
2718
2791
|
}
|
|
2719
|
-
|
|
2720
|
-
return resolved;
|
|
2792
|
+
return void 0;
|
|
2721
2793
|
};
|
|
2722
2794
|
var blobToDataUrl = async (blob) => {
|
|
2723
2795
|
const buffer = await blob.arrayBuffer();
|
|
@@ -2773,54 +2845,6 @@ var implemented = (type, ...args) => {
|
|
|
2773
2845
|
var notImplemented = (type, ...args) => {
|
|
2774
2846
|
console.error(`[Not Implemented] ${type}`, ...args);
|
|
2775
2847
|
};
|
|
2776
|
-
|
|
2777
|
-
// src/utils/media-utils.ts
|
|
2778
|
-
var getFileExtension = (filename) => {
|
|
2779
|
-
if (!filename) {
|
|
2780
|
-
return "";
|
|
2781
|
-
}
|
|
2782
|
-
if (filename.startsWith("data:")) {
|
|
2783
|
-
const mime = filename.slice(5).split(";")[0] || "";
|
|
2784
|
-
const subtype = (mime.split("/")[1] || "").toLowerCase();
|
|
2785
|
-
if (subtype === "jpeg") {
|
|
2786
|
-
return "jpg";
|
|
2787
|
-
}
|
|
2788
|
-
return subtype.split("+")[0] || "";
|
|
2789
|
-
}
|
|
2790
|
-
const withoutQuery = filename.split(/[?#]/)[0] || filename;
|
|
2791
|
-
const match = withoutQuery.match(/\.([^.]+)$/);
|
|
2792
|
-
return match ? match[1].toLowerCase() : "";
|
|
2793
|
-
};
|
|
2794
|
-
var isImageFormat = (format2) => {
|
|
2795
|
-
if (!format2) {
|
|
2796
|
-
return false;
|
|
2797
|
-
}
|
|
2798
|
-
let normalized = format2.toLowerCase().trim();
|
|
2799
|
-
if (normalized.startsWith("data:")) {
|
|
2800
|
-
normalized = getFileExtension(normalized);
|
|
2801
|
-
} else if (normalized.includes("/")) {
|
|
2802
|
-
normalized = normalized.split("/")[1]?.split("+")[0] || "";
|
|
2803
|
-
if (normalized === "jpeg") {
|
|
2804
|
-
normalized = "jpg";
|
|
2805
|
-
}
|
|
2806
|
-
}
|
|
2807
|
-
const imageFormats = [
|
|
2808
|
-
"jpg",
|
|
2809
|
-
"jpeg",
|
|
2810
|
-
"png",
|
|
2811
|
-
"gif",
|
|
2812
|
-
"bmp",
|
|
2813
|
-
"webp",
|
|
2814
|
-
"svg",
|
|
2815
|
-
"tiff",
|
|
2816
|
-
"tif"
|
|
2817
|
-
];
|
|
2818
|
-
return imageFormats.includes(normalized);
|
|
2819
|
-
};
|
|
2820
|
-
var resolveObjeForm = (obje) => {
|
|
2821
|
-
const value = obje?.get?.("FILE.FORM")?.toValue?.() ?? obje?.get?.("FORM")?.toValue?.();
|
|
2822
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
2823
|
-
};
|
|
2824
2848
|
var uniqueItemsCache = /* @__PURE__ */ new WeakMap();
|
|
2825
2849
|
var setNestedGroup = (obj, key, value, uniqueCounting = true) => {
|
|
2826
2850
|
const parts = Array.isArray(key) ? key : key.split(/,\s*/);
|
|
@@ -4102,22 +4126,19 @@ var Indi = class extends Common {
|
|
|
4102
4126
|
if (objeList) {
|
|
4103
4127
|
await Promise.all(
|
|
4104
4128
|
objeList.map(async (objeRef) => {
|
|
4105
|
-
const key = objeRef
|
|
4129
|
+
const key = objeXrefKey(objeRef, 0);
|
|
4106
4130
|
const obje = objeRef?.standardizeMedia(
|
|
4107
4131
|
namespace,
|
|
4108
4132
|
true,
|
|
4109
|
-
|
|
4110
|
-
return ns && iId ? `https://mediasvc.ancestry.com/v2/image/namespaces/${ns}/media/${iId}?client=trees-mediaservice&imageQuality=hq` : void 0;
|
|
4111
|
-
}
|
|
4133
|
+
ancestryMediaFileUrl
|
|
4112
4134
|
);
|
|
4113
4135
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
4114
|
-
const media =
|
|
4115
|
-
const clone = obje?.get("_CLON._OID")?.toValue();
|
|
4116
|
-
const mser = obje?.get("_MSER._LKID")?.toValue();
|
|
4136
|
+
const media = resolveObjeMediaId(obje);
|
|
4117
4137
|
let url = obje?.get("FILE")?.toValue();
|
|
4118
4138
|
const title = obje?.get("FILE.TITL")?.toValue() ?? obje?.get("TITL")?.toValue() ?? "";
|
|
4139
|
+
const note = objeNoteValue(obje);
|
|
4119
4140
|
const type = resolveObjeForm(obje) ?? (url ? getFileExtension(url) : void 0) ?? "raw";
|
|
4120
|
-
let imgId =
|
|
4141
|
+
let imgId = media;
|
|
4121
4142
|
const hasEmbeddedOrLocalFile = !!url && (url.startsWith("data:") || url.startsWith("blob:") || !/^https?:\/\//i.test(url));
|
|
4122
4143
|
if (!hasEmbeddedOrLocalFile && (!www || !tree || !this.id)) {
|
|
4123
4144
|
return;
|
|
@@ -4153,6 +4174,7 @@ var Indi = class extends Common {
|
|
|
4153
4174
|
imgId,
|
|
4154
4175
|
person: this.id,
|
|
4155
4176
|
title,
|
|
4177
|
+
note,
|
|
4156
4178
|
url,
|
|
4157
4179
|
contentType: type,
|
|
4158
4180
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -4191,7 +4213,7 @@ var Indi = class extends Common {
|
|
|
4191
4213
|
return;
|
|
4192
4214
|
}
|
|
4193
4215
|
const obje = o;
|
|
4194
|
-
const key =
|
|
4216
|
+
const key = objeXrefKey(obje, index);
|
|
4195
4217
|
obje.standardizeMedia();
|
|
4196
4218
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
4197
4219
|
const url = obje?.get("FILE")?.toValue();
|
|
@@ -4210,6 +4232,7 @@ var Indi = class extends Common {
|
|
|
4210
4232
|
imgId,
|
|
4211
4233
|
person: this.id,
|
|
4212
4234
|
title,
|
|
4235
|
+
note: objeNoteValue(obje),
|
|
4213
4236
|
url,
|
|
4214
4237
|
contentType: type,
|
|
4215
4238
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -4318,7 +4341,7 @@ var Indi = class extends Common {
|
|
|
4318
4341
|
if (!obje) {
|
|
4319
4342
|
return;
|
|
4320
4343
|
}
|
|
4321
|
-
const key =
|
|
4344
|
+
const key = objeXrefKey(obje, index);
|
|
4322
4345
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
4323
4346
|
const url = obje?.get("FILE")?.toValue();
|
|
4324
4347
|
const title = obje?.get("TITL")?.toValue() ?? "";
|
|
@@ -4335,6 +4358,7 @@ var Indi = class extends Common {
|
|
|
4335
4358
|
imgId,
|
|
4336
4359
|
person: this.id,
|
|
4337
4360
|
title,
|
|
4361
|
+
note: objeNoteValue(obje),
|
|
4338
4362
|
url,
|
|
4339
4363
|
contentType: type,
|
|
4340
4364
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -4358,7 +4382,7 @@ var Indi = class extends Common {
|
|
|
4358
4382
|
if (!obje) {
|
|
4359
4383
|
return;
|
|
4360
4384
|
}
|
|
4361
|
-
const key =
|
|
4385
|
+
const key = objeXrefKey(obje, index);
|
|
4362
4386
|
obje.standardizeMedia();
|
|
4363
4387
|
const isPrimary = obje?.get("_PRIM")?.toValue() === "Y";
|
|
4364
4388
|
const url = obje?.get("FILE")?.toValue();
|
|
@@ -4375,6 +4399,7 @@ var Indi = class extends Common {
|
|
|
4375
4399
|
imgId,
|
|
4376
4400
|
person: this.id,
|
|
4377
4401
|
title,
|
|
4402
|
+
note: objeNoteValue(obje),
|
|
4378
4403
|
url,
|
|
4379
4404
|
contentType: type,
|
|
4380
4405
|
downloadName: `${this.id.replaceAll("@", "")}_${this.toNaturalName()?.replaceAll(" ", "-") || ""}_${(title || key.replaceAll("@", "").toString()).replaceAll(" ", "-")}`
|
|
@@ -4406,7 +4431,12 @@ var Indi = class extends Common {
|
|
|
4406
4431
|
);
|
|
4407
4432
|
if (cached !== void 0) {
|
|
4408
4433
|
if (cached?.file && !isRemoteOrEmbeddedMediaUrl(cached.file)) {
|
|
4409
|
-
const resolvedCached = await resolveLocalMediaUrl(cached.file
|
|
4434
|
+
const resolvedCached = await resolveLocalMediaUrl(cached.file, {
|
|
4435
|
+
url: cached.file,
|
|
4436
|
+
person: this.id,
|
|
4437
|
+
tree: this.getTreeId?.(),
|
|
4438
|
+
treeName: this.getTreeName?.()
|
|
4439
|
+
});
|
|
4410
4440
|
if (resolvedCached && isRemoteOrEmbeddedMediaUrl(resolvedCached)) {
|
|
4411
4441
|
const refreshed = { ...cached, file: resolvedCached };
|
|
4412
4442
|
profilePictureCache(
|
|
@@ -4431,7 +4461,16 @@ var Indi = class extends Common {
|
|
|
4431
4461
|
}
|
|
4432
4462
|
const mediaArray = Object.values(mediaList);
|
|
4433
4463
|
const toDisplayableProfile = async (media, isPrimary) => {
|
|
4434
|
-
const resolvedFile = await resolveLocalMediaUrl(media.url
|
|
4464
|
+
const resolvedFile = await resolveLocalMediaUrl(media.url, {
|
|
4465
|
+
url: media.url,
|
|
4466
|
+
id: media.id,
|
|
4467
|
+
imgId: media.imgId,
|
|
4468
|
+
key: media.key,
|
|
4469
|
+
contentType: media.contentType,
|
|
4470
|
+
person: media.person || this.id,
|
|
4471
|
+
tree: media.tree || this.getTreeId?.(),
|
|
4472
|
+
treeName: this.getTreeName?.()
|
|
4473
|
+
});
|
|
4435
4474
|
if (!resolvedFile || !isRemoteOrEmbeddedMediaUrl(resolvedFile)) {
|
|
4436
4475
|
return void 0;
|
|
4437
4476
|
}
|
|
@@ -6400,7 +6439,7 @@ var KinshipTranslatorHU = class extends KinshipTranslatorBasic {
|
|
|
6400
6439
|
}
|
|
6401
6440
|
return `${hungarianOrdinalize(
|
|
6402
6441
|
degree
|
|
6403
|
-
)}unokatestv\xE9r ${level}x elt\xE1vol\xEDtva`;
|
|
6442
|
+
)}unokatestv\xE9r ${Math.abs(level)}x elt\xE1vol\xEDtva`;
|
|
6404
6443
|
}
|
|
6405
6444
|
auncle() {
|
|
6406
6445
|
const level = this.pathN?.level ?? 0;
|
|
@@ -6444,14 +6483,25 @@ var KinshipTranslatorHU = class extends KinshipTranslatorBasic {
|
|
|
6444
6483
|
return `${ordinalized ? `${ordinalized}unoka` : ""}testv\xE9r ${origPrefix.replace(/nagy$/, "")}unok\xE1ja`;
|
|
6445
6484
|
}
|
|
6446
6485
|
parent() {
|
|
6486
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
6487
|
+
if (level <= 1) {
|
|
6488
|
+
if (this.personN?.isMale()) {
|
|
6489
|
+
return "apa";
|
|
6490
|
+
}
|
|
6491
|
+
if (this.personN?.isFemale()) {
|
|
6492
|
+
return "anya";
|
|
6493
|
+
}
|
|
6494
|
+
return "sz\xFCl\u0151";
|
|
6495
|
+
}
|
|
6447
6496
|
const prefix = this.directPrefix();
|
|
6497
|
+
const gen = prefix === "nagy" ? "" : prefix;
|
|
6448
6498
|
if (this.personN?.isMale()) {
|
|
6449
|
-
return `${
|
|
6499
|
+
return `${gen}nagyapa`;
|
|
6450
6500
|
}
|
|
6451
6501
|
if (this.personN?.isFemale()) {
|
|
6452
|
-
return `${
|
|
6502
|
+
return `${gen}nagyanya`;
|
|
6453
6503
|
}
|
|
6454
|
-
return `${
|
|
6504
|
+
return `${gen}nagysz\xFCl\u0151`;
|
|
6455
6505
|
}
|
|
6456
6506
|
child() {
|
|
6457
6507
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
@@ -6645,27 +6695,30 @@ var KinshipTranslatorEn = class extends KinshipTranslatorBasic {
|
|
|
6645
6695
|
if (!degree) {
|
|
6646
6696
|
return level < 0 ? this.nibling() : this.auncle();
|
|
6647
6697
|
}
|
|
6648
|
-
return `${ordinalize(degree)} cousin ${level}x removed`;
|
|
6698
|
+
return `${ordinalize(degree)} cousin ${Math.abs(level)}x removed`;
|
|
6649
6699
|
}
|
|
6650
6700
|
auncle() {
|
|
6651
|
-
const
|
|
6701
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
6702
|
+
const greats = level <= 1 ? "" : "great-".repeat(level - 1);
|
|
6652
6703
|
if (this.personN?.isMale()) {
|
|
6653
|
-
return `${
|
|
6704
|
+
return `${greats}uncle`;
|
|
6654
6705
|
}
|
|
6655
6706
|
if (this.personN?.isFemale()) {
|
|
6656
|
-
return `${
|
|
6707
|
+
return `${greats}aunt`;
|
|
6657
6708
|
}
|
|
6658
|
-
return `${
|
|
6709
|
+
return greats ? `${greats}uncle/${greats}aunt` : "uncle/aunt";
|
|
6659
6710
|
}
|
|
6660
6711
|
nibling() {
|
|
6661
|
-
const
|
|
6712
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
6713
|
+
const greats = level <= 2 ? "" : "great-".repeat(level - 2);
|
|
6714
|
+
const grand = level <= 1 ? "" : "grand";
|
|
6662
6715
|
if (this.personN?.isMale()) {
|
|
6663
|
-
return `${
|
|
6716
|
+
return `${greats}${grand}nephew`;
|
|
6664
6717
|
}
|
|
6665
6718
|
if (this.personN?.isFemale()) {
|
|
6666
|
-
return `${
|
|
6719
|
+
return `${greats}${grand}niece`;
|
|
6667
6720
|
}
|
|
6668
|
-
return `${
|
|
6721
|
+
return greats || grand ? `${greats}${grand}nephew/${greats}${grand}niece` : "nephew/niece";
|
|
6669
6722
|
}
|
|
6670
6723
|
parent() {
|
|
6671
6724
|
const prefix = this.directPrefix();
|
|
@@ -6793,45 +6846,64 @@ var KinshipTranslatorEn = class extends KinshipTranslatorBasic {
|
|
|
6793
6846
|
};
|
|
6794
6847
|
|
|
6795
6848
|
// src/kinship-translator/patterns.de.ts
|
|
6849
|
+
var parentRelationsDe = {
|
|
6850
|
+
step: "Stief",
|
|
6851
|
+
foster: "Pflege",
|
|
6852
|
+
adopted: "Adoptiv"
|
|
6853
|
+
};
|
|
6796
6854
|
var InLawsDe = {
|
|
6797
|
-
"Ehepartner von (
|
|
6798
|
-
"Ehefrau von (
|
|
6799
|
-
"Ehemann von (
|
|
6800
|
-
"
|
|
6801
|
-
"
|
|
6802
|
-
"
|
|
6803
|
-
"Ehefrau von (Halb)
|
|
6804
|
-
"Ehemann von (Halb)
|
|
6805
|
-
"Ehepartner von (Halb)
|
|
6806
|
-
"(Halb)
|
|
6807
|
-
"(Halb)
|
|
6808
|
-
"(Halb)
|
|
6855
|
+
"Ehepartner von (Kind|Tochter|Sohn)": "Schwiegerkind",
|
|
6856
|
+
"Ehefrau von (Kind|Tochter|Sohn)": "Schwiegertochter",
|
|
6857
|
+
"Ehemann von (Kind|Tochter|Sohn)": "Schwiegersohn",
|
|
6858
|
+
"Mutter (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwiegermutter",
|
|
6859
|
+
"Vater (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwiegervater",
|
|
6860
|
+
"Elternteil (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwiegerelternteil",
|
|
6861
|
+
"Ehefrau von (Halb)?-?(Geschwister|Schwester|Bruder)": "Schw\xE4gerin",
|
|
6862
|
+
"Ehemann von (Halb)?-?(Geschwister|Schwester|Bruder)": "Schwager",
|
|
6863
|
+
"Ehepartner von (Halb)?-?(Geschwister|Schwester|Bruder)": "Schwager/Schw\xE4gerin",
|
|
6864
|
+
"(Halb)?-?(Schwester|schwester) (des Ehepartners|des Ehemanns|der Ehefrau)": "Schw\xE4gerin",
|
|
6865
|
+
"(Halb)?-?(Bruder|bruder) (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwager",
|
|
6866
|
+
"(Halb)?-?(Geschwister|geschwister) (des Ehepartners|des Ehemanns|der Ehefrau)": "Schwager/Schw\xE4gerin"
|
|
6809
6867
|
};
|
|
6810
6868
|
|
|
6811
6869
|
// src/kinship-translator/kinship-translator.de.ts
|
|
6812
|
-
var
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6870
|
+
var sexOf = (person) => {
|
|
6871
|
+
if (person?.isMale?.()) {
|
|
6872
|
+
return "m";
|
|
6873
|
+
}
|
|
6874
|
+
if (person?.isFemale?.()) {
|
|
6875
|
+
return "f";
|
|
6876
|
+
}
|
|
6877
|
+
return "n";
|
|
6878
|
+
};
|
|
6879
|
+
var pick = (sex, male, female, neutral) => {
|
|
6880
|
+
if (sex === "m") {
|
|
6881
|
+
return male;
|
|
6882
|
+
}
|
|
6883
|
+
if (sex === "f") {
|
|
6884
|
+
return female;
|
|
6885
|
+
}
|
|
6886
|
+
return neutral;
|
|
6887
|
+
};
|
|
6888
|
+
var ur = (count) => count > 0 ? "Ur".repeat(count) : "";
|
|
6889
|
+
var genitiveArticle = (spouseType) => {
|
|
6890
|
+
if (spouseType === "Ehefrau") {
|
|
6891
|
+
return `der ${spouseType}`;
|
|
6825
6892
|
}
|
|
6893
|
+
return `des ${spouseType}s`;
|
|
6894
|
+
};
|
|
6895
|
+
var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
|
|
6826
6896
|
indirect() {
|
|
6827
6897
|
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
6828
6898
|
if (degree > 0) {
|
|
6829
6899
|
degree = degree - 1;
|
|
6830
6900
|
}
|
|
6831
|
-
|
|
6832
|
-
|
|
6901
|
+
const sex = sexOf(this.personN);
|
|
6902
|
+
const cousin = pick(sex, "Cousin", "Cousine", "Cousin/Cousine");
|
|
6903
|
+
if (degree <= 1) {
|
|
6904
|
+
return cousin;
|
|
6833
6905
|
}
|
|
6834
|
-
return
|
|
6906
|
+
return `${cousin} ${degree}. Grades`;
|
|
6835
6907
|
}
|
|
6836
6908
|
removal() {
|
|
6837
6909
|
const level = this.pathN?.level ?? 0;
|
|
@@ -6842,101 +6914,101 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
|
|
|
6842
6914
|
if (!degree) {
|
|
6843
6915
|
return level < 0 ? this.nibling() : this.auncle();
|
|
6844
6916
|
}
|
|
6845
|
-
return
|
|
6917
|
+
return `${this.indirect()} ${Math.abs(level)}\xD7 entfernt`;
|
|
6846
6918
|
}
|
|
6847
6919
|
auncle() {
|
|
6848
|
-
const
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
if (this.personN?.isFemale()) {
|
|
6853
|
-
return `${prefix}tante`;
|
|
6920
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
6921
|
+
const sex = sexOf(this.personN);
|
|
6922
|
+
if (level <= 1) {
|
|
6923
|
+
return pick(sex, "Onkel", "Tante", "Onkel/Tante");
|
|
6854
6924
|
}
|
|
6855
|
-
|
|
6925
|
+
const prefix = `${ur(level - 2)}Gro\xDF`;
|
|
6926
|
+
return pick(
|
|
6927
|
+
sex,
|
|
6928
|
+
`${prefix}onkel`,
|
|
6929
|
+
`${prefix}tante`,
|
|
6930
|
+
`${prefix}onkel/tante`
|
|
6931
|
+
);
|
|
6856
6932
|
}
|
|
6857
6933
|
nibling() {
|
|
6858
|
-
const
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
if (this.personN?.isFemale()) {
|
|
6863
|
-
return `${prefix}nichte`;
|
|
6934
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
6935
|
+
const sex = sexOf(this.personN);
|
|
6936
|
+
if (level <= 1) {
|
|
6937
|
+
return pick(sex, "Neffe", "Nichte", "Neffe/Nichte");
|
|
6864
6938
|
}
|
|
6865
|
-
|
|
6939
|
+
const prefix = `${ur(level - 2)}Gro\xDF`;
|
|
6940
|
+
return pick(
|
|
6941
|
+
sex,
|
|
6942
|
+
`${prefix}neffe`,
|
|
6943
|
+
`${prefix}nichte`,
|
|
6944
|
+
`${prefix}neffe/nichte`
|
|
6945
|
+
);
|
|
6866
6946
|
}
|
|
6867
6947
|
parent() {
|
|
6868
|
-
const
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
if (this.personN?.isFemale()) {
|
|
6873
|
-
return `${prefix}mutter`;
|
|
6948
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
6949
|
+
const sex = sexOf(this.personN);
|
|
6950
|
+
if (level <= 1) {
|
|
6951
|
+
return pick(sex, "Vater", "Mutter", "Elternteil");
|
|
6874
6952
|
}
|
|
6875
|
-
|
|
6953
|
+
const prefix = `${ur(level - 2)}Gro\xDF`;
|
|
6954
|
+
return pick(
|
|
6955
|
+
sex,
|
|
6956
|
+
`${prefix}vater`,
|
|
6957
|
+
`${prefix}mutter`,
|
|
6958
|
+
`${prefix}elternteil`
|
|
6959
|
+
);
|
|
6876
6960
|
}
|
|
6877
6961
|
child() {
|
|
6878
|
-
const
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
if (this.personN?.isFemale()) {
|
|
6883
|
-
return `${prefix}tochter`;
|
|
6962
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
6963
|
+
const sex = sexOf(this.personN);
|
|
6964
|
+
if (level <= 1) {
|
|
6965
|
+
return pick(sex, "Sohn", "Tochter", "Kind");
|
|
6884
6966
|
}
|
|
6885
|
-
|
|
6967
|
+
const prefix = ur(level - 2);
|
|
6968
|
+
return pick(
|
|
6969
|
+
sex,
|
|
6970
|
+
`${prefix}Enkel`,
|
|
6971
|
+
`${prefix}Enkelin`,
|
|
6972
|
+
`${prefix}Enkelkind`
|
|
6973
|
+
);
|
|
6886
6974
|
}
|
|
6887
6975
|
sibling() {
|
|
6888
|
-
|
|
6889
|
-
return "bruder";
|
|
6890
|
-
}
|
|
6891
|
-
if (this.personN?.isFemale()) {
|
|
6892
|
-
return "schwester";
|
|
6893
|
-
}
|
|
6894
|
-
return "geschwister";
|
|
6976
|
+
return pick(sexOf(this.personN), "Bruder", "Schwester", "Geschwister");
|
|
6895
6977
|
}
|
|
6896
6978
|
halfBlood(relation) {
|
|
6897
6979
|
if (!relation || !this.isHalfBlood) {
|
|
6898
6980
|
return relation ?? "";
|
|
6899
6981
|
}
|
|
6900
|
-
if (
|
|
6982
|
+
if (/[\s-]/.test(relation) || /^(Groß|Ur)/.test(relation)) {
|
|
6901
6983
|
return `Halb-${relation}`;
|
|
6902
6984
|
}
|
|
6903
|
-
return `Halb${relation}`;
|
|
6985
|
+
return `Halb${relation.charAt(0).toLowerCase()}${relation.slice(1)}`;
|
|
6904
6986
|
}
|
|
6905
6987
|
spouse() {
|
|
6906
|
-
|
|
6907
|
-
return "Ehemann";
|
|
6908
|
-
}
|
|
6909
|
-
if (this.personN?.isFemale()) {
|
|
6910
|
-
return "Ehefrau";
|
|
6911
|
-
}
|
|
6912
|
-
return "Ehepartner";
|
|
6988
|
+
return pick(sexOf(this.personN), "Ehemann", "Ehefrau", "Ehepartner");
|
|
6913
6989
|
}
|
|
6914
6990
|
ofSpouse(relation) {
|
|
6915
6991
|
if (!relation) {
|
|
6916
6992
|
return "";
|
|
6917
6993
|
}
|
|
6918
|
-
const
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
}
|
|
6926
|
-
return `${relation} des ${spouseType}s`;
|
|
6994
|
+
const spouseType = pick(
|
|
6995
|
+
sexOf(this.path?.[1].indi),
|
|
6996
|
+
"Ehemann",
|
|
6997
|
+
"Ehefrau",
|
|
6998
|
+
"Ehepartner"
|
|
6999
|
+
);
|
|
7000
|
+
return `${relation} ${genitiveArticle(spouseType)}`;
|
|
6927
7001
|
}
|
|
6928
7002
|
spouseOf(relation) {
|
|
6929
7003
|
if (!relation) {
|
|
6930
7004
|
return "";
|
|
6931
7005
|
}
|
|
6932
|
-
const
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
spouseType = "Ehefrau";
|
|
6939
|
-
}
|
|
7006
|
+
const spouseType = pick(
|
|
7007
|
+
sexOf(this.path?.[this.path.length - 1].indi),
|
|
7008
|
+
"Ehemann",
|
|
7009
|
+
"Ehefrau",
|
|
7010
|
+
"Ehepartner"
|
|
7011
|
+
);
|
|
6940
7012
|
return `${spouseType} von ${relation}`;
|
|
6941
7013
|
}
|
|
6942
7014
|
of(relation) {
|
|
@@ -6954,8 +7026,8 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
|
|
|
6954
7026
|
if (!name || !relation) {
|
|
6955
7027
|
return relation ?? "";
|
|
6956
7028
|
}
|
|
6957
|
-
if (relation.includes(" des ") || relation.includes(" von ")) {
|
|
6958
|
-
return relation.replace(/ (des|von) /, ` $1 ${name}s `);
|
|
7029
|
+
if (relation.includes(" des ") || relation.includes(" der ") || relation.includes(" von ")) {
|
|
7030
|
+
return relation.replace(/ (des|der|von) /, ` $1 ${name}s `);
|
|
6959
7031
|
}
|
|
6960
7032
|
return `${name}s ${relation}`;
|
|
6961
7033
|
}
|
|
@@ -6985,110 +7057,143 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
|
|
|
6985
7057
|
if (!relation || !this.pathN?.relation) {
|
|
6986
7058
|
return relation ?? "";
|
|
6987
7059
|
}
|
|
6988
|
-
|
|
7060
|
+
const prefix = parentRelationsDe[this.pathN.relation];
|
|
7061
|
+
if (!prefix) {
|
|
7062
|
+
return relation;
|
|
7063
|
+
}
|
|
7064
|
+
if (prefix.endsWith("-") || prefix.endsWith(" ")) {
|
|
7065
|
+
return `${prefix}${relation}`;
|
|
7066
|
+
}
|
|
7067
|
+
return `${prefix}${relation.charAt(0).toLowerCase()}${relation.slice(1)}`;
|
|
6989
7068
|
}
|
|
6990
7069
|
};
|
|
6991
7070
|
|
|
6992
7071
|
// src/kinship-translator/patterns.fr.ts
|
|
7072
|
+
var parentRelationsFr = {
|
|
7073
|
+
step: "step",
|
|
7074
|
+
foster: "foster",
|
|
7075
|
+
adopted: "adopted"
|
|
7076
|
+
};
|
|
6993
7077
|
var InLawsFr = {
|
|
6994
7078
|
"conjoint de (enfant|fille|fils)": "beau-fils/belle-fille",
|
|
6995
7079
|
"\xE9pouse de (enfant|fille|fils)": "belle-fille",
|
|
6996
7080
|
"mari de (enfant|fille|fils)": "gendre",
|
|
6997
|
-
"m\xE8re du
|
|
6998
|
-
"p\xE8re du
|
|
6999
|
-
"parent du
|
|
7081
|
+
"m\xE8re (du mari|du conjoint|de l'\xE9pouse)": "belle-m\xE8re",
|
|
7082
|
+
"p\xE8re (du mari|du conjoint|de l'\xE9pouse)": "beau-p\xE8re",
|
|
7083
|
+
"parent (du mari|du conjoint|de l'\xE9pouse)": "beau-parent",
|
|
7000
7084
|
"\xE9pouse de (demi-)?(fr\xE8re/s\u0153ur|s\u0153ur|fr\xE8re)": "belle-s\u0153ur",
|
|
7001
7085
|
"mari de (demi-)?(fr\xE8re/s\u0153ur|s\u0153ur|fr\xE8re)": "beau-fr\xE8re",
|
|
7002
7086
|
"conjoint de (demi-)?(fr\xE8re/s\u0153ur|s\u0153ur|fr\xE8re)": "beau-fr\xE8re/belle-s\u0153ur",
|
|
7003
|
-
"(demi-)?s\u0153ur du
|
|
7004
|
-
"(demi-)?fr\xE8re du
|
|
7005
|
-
"(demi-)?fr\xE8re/s\u0153ur du
|
|
7087
|
+
"(demi-)?s\u0153ur (du mari|du conjoint|de l'\xE9pouse)": "belle-s\u0153ur",
|
|
7088
|
+
"(demi-)?fr\xE8re (du mari|du conjoint|de l'\xE9pouse)": "beau-fr\xE8re",
|
|
7089
|
+
"(demi-)?fr\xE8re/s\u0153ur (du mari|du conjoint|de l'\xE9pouse)": "beau-fr\xE8re/belle-s\u0153ur"
|
|
7006
7090
|
};
|
|
7007
7091
|
|
|
7008
7092
|
// src/kinship-translator/kinship-translator.fr.ts
|
|
7009
|
-
var
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
if (level <= 1) {
|
|
7013
|
-
return "";
|
|
7014
|
-
}
|
|
7015
|
-
if (level === 2) {
|
|
7016
|
-
return "grand-";
|
|
7017
|
-
}
|
|
7018
|
-
if (level === 3) {
|
|
7019
|
-
return "arri\xE8re-grand-";
|
|
7020
|
-
}
|
|
7021
|
-
return `arri\xE8re${level - 2}-grand-`;
|
|
7093
|
+
var sexOf2 = (person) => {
|
|
7094
|
+
if (person?.isMale?.()) {
|
|
7095
|
+
return "m";
|
|
7022
7096
|
}
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
if (degree > 0) {
|
|
7026
|
-
degree = degree - 1;
|
|
7027
|
-
}
|
|
7028
|
-
if (degree === 1) {
|
|
7029
|
-
return `cousin`;
|
|
7030
|
-
}
|
|
7031
|
-
return `cousin au ${ordinalize(degree)} degr\xE9`;
|
|
7097
|
+
if (person?.isFemale?.()) {
|
|
7098
|
+
return "f";
|
|
7032
7099
|
}
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7100
|
+
return "n";
|
|
7101
|
+
};
|
|
7102
|
+
var pick2 = (sex, male, female, neutral) => {
|
|
7103
|
+
if (sex === "m") {
|
|
7104
|
+
return male;
|
|
7105
|
+
}
|
|
7106
|
+
if (sex === "f") {
|
|
7107
|
+
return female;
|
|
7108
|
+
}
|
|
7109
|
+
return neutral;
|
|
7110
|
+
};
|
|
7111
|
+
var arriere = (count) => count > 0 ? "arri\xE8re-".repeat(count) : "";
|
|
7112
|
+
var frenchOrdinal = (n) => n === 1 ? "1er" : `${n}e`;
|
|
7113
|
+
var isFeminineRelation = (relation) => /mère|fille|sœur|tante|nièce|cousine|épouse/.test(relation);
|
|
7114
|
+
var ofSpousePrep = (spouseType) => {
|
|
7115
|
+
if (spouseType === "\xE9pouse") {
|
|
7116
|
+
return "de l'";
|
|
7117
|
+
}
|
|
7118
|
+
return "du ";
|
|
7119
|
+
};
|
|
7120
|
+
var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
|
|
7121
|
+
indirect() {
|
|
7122
|
+
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
7123
|
+
if (degree > 0) {
|
|
7124
|
+
degree = degree - 1;
|
|
7125
|
+
}
|
|
7126
|
+
const cousin = pick2(
|
|
7127
|
+
sexOf2(this.personN),
|
|
7128
|
+
"cousin",
|
|
7129
|
+
"cousine",
|
|
7130
|
+
"cousin/cousine"
|
|
7131
|
+
);
|
|
7132
|
+
if (degree <= 1) {
|
|
7133
|
+
return cousin;
|
|
7134
|
+
}
|
|
7135
|
+
return `${cousin} au ${frenchOrdinal(degree)} degr\xE9`;
|
|
7136
|
+
}
|
|
7137
|
+
removal() {
|
|
7138
|
+
const level = this.pathN?.level ?? 0;
|
|
7139
|
+
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
7140
|
+
if (degree > 0) {
|
|
7141
|
+
degree = degree - 1;
|
|
7038
7142
|
}
|
|
7039
7143
|
if (!degree) {
|
|
7040
7144
|
return level < 0 ? this.nibling() : this.auncle();
|
|
7041
7145
|
}
|
|
7042
|
-
return
|
|
7146
|
+
return `${this.indirect()} ${Math.abs(level)}\xD7 \xE9loign\xE9`;
|
|
7043
7147
|
}
|
|
7044
7148
|
auncle() {
|
|
7045
|
-
const
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
return `${prefix}tante`;
|
|
7149
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7150
|
+
const sex = sexOf2(this.personN);
|
|
7151
|
+
const base = pick2(sex, "oncle", "tante", "oncle/tante");
|
|
7152
|
+
if (level <= 1) {
|
|
7153
|
+
return base;
|
|
7051
7154
|
}
|
|
7052
|
-
|
|
7155
|
+
const grands = pick2(
|
|
7156
|
+
sex,
|
|
7157
|
+
"grand-oncle",
|
|
7158
|
+
"grand-tante",
|
|
7159
|
+
"grand-oncle/tante"
|
|
7160
|
+
);
|
|
7161
|
+
return `${arriere(level - 2)}${grands}`;
|
|
7053
7162
|
}
|
|
7054
7163
|
nibling() {
|
|
7055
|
-
const
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
if (this.personN?.isFemale()) {
|
|
7060
|
-
return `${prefix}ni\xE8ce`;
|
|
7164
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7165
|
+
const sex = sexOf2(this.personN);
|
|
7166
|
+
if (level <= 1) {
|
|
7167
|
+
return pick2(sex, "neveu", "ni\xE8ce", "neveu/ni\xE8ce");
|
|
7061
7168
|
}
|
|
7062
|
-
|
|
7169
|
+
const grands = pick2(
|
|
7170
|
+
sex,
|
|
7171
|
+
"grand-neveu",
|
|
7172
|
+
"grande-ni\xE8ce",
|
|
7173
|
+
"grand-neveu/grande-ni\xE8ce"
|
|
7174
|
+
);
|
|
7175
|
+
return `${arriere(level - 2)}${grands}`;
|
|
7063
7176
|
}
|
|
7064
7177
|
parent() {
|
|
7065
|
-
const
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
if (this.personN?.isFemale()) {
|
|
7070
|
-
return `${prefix}m\xE8re`;
|
|
7178
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7179
|
+
const sex = sexOf2(this.personN);
|
|
7180
|
+
if (level <= 1) {
|
|
7181
|
+
return pick2(sex, "p\xE8re", "m\xE8re", "parent");
|
|
7071
7182
|
}
|
|
7072
|
-
|
|
7183
|
+
const grands = pick2(sex, "grand-p\xE8re", "grand-m\xE8re", "grand-parent");
|
|
7184
|
+
return `${arriere(level - 2)}${grands}`;
|
|
7073
7185
|
}
|
|
7074
7186
|
child() {
|
|
7075
|
-
const
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
if (this.personN?.isFemale()) {
|
|
7080
|
-
return `${prefix}fille`;
|
|
7187
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7188
|
+
const sex = sexOf2(this.personN);
|
|
7189
|
+
if (level <= 1) {
|
|
7190
|
+
return pick2(sex, "fils", "fille", "enfant");
|
|
7081
7191
|
}
|
|
7082
|
-
|
|
7192
|
+
const petits = pick2(sex, "petit-fils", "petite-fille", "petit-enfant");
|
|
7193
|
+
return `${arriere(level - 2)}${petits}`;
|
|
7083
7194
|
}
|
|
7084
7195
|
sibling() {
|
|
7085
|
-
|
|
7086
|
-
return "fr\xE8re";
|
|
7087
|
-
}
|
|
7088
|
-
if (this.personN?.isFemale()) {
|
|
7089
|
-
return "s\u0153ur";
|
|
7090
|
-
}
|
|
7091
|
-
return "fr\xE8re/s\u0153ur";
|
|
7196
|
+
return pick2(sexOf2(this.personN), "fr\xE8re", "s\u0153ur", "fr\xE8re/s\u0153ur");
|
|
7092
7197
|
}
|
|
7093
7198
|
halfBlood(relation) {
|
|
7094
7199
|
if (!relation || !this.isHalfBlood) {
|
|
@@ -7097,40 +7202,30 @@ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
|
|
|
7097
7202
|
return `demi-${relation}`;
|
|
7098
7203
|
}
|
|
7099
7204
|
spouse() {
|
|
7100
|
-
|
|
7101
|
-
return "mari";
|
|
7102
|
-
}
|
|
7103
|
-
if (this.personN?.isFemale()) {
|
|
7104
|
-
return "\xE9pouse";
|
|
7105
|
-
}
|
|
7106
|
-
return "conjoint";
|
|
7205
|
+
return pick2(sexOf2(this.personN), "mari", "\xE9pouse", "conjoint");
|
|
7107
7206
|
}
|
|
7108
7207
|
ofSpouse(relation) {
|
|
7109
7208
|
if (!relation) {
|
|
7110
7209
|
return "";
|
|
7111
7210
|
}
|
|
7112
|
-
const
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
}
|
|
7120
|
-
return `${relation} du ${spouseType}`;
|
|
7211
|
+
const spouseType = pick2(
|
|
7212
|
+
sexOf2(this.path?.[1].indi),
|
|
7213
|
+
"mari",
|
|
7214
|
+
"\xE9pouse",
|
|
7215
|
+
"conjoint"
|
|
7216
|
+
);
|
|
7217
|
+
return `${relation} ${ofSpousePrep(spouseType)}${spouseType}`;
|
|
7121
7218
|
}
|
|
7122
7219
|
spouseOf(relation) {
|
|
7123
7220
|
if (!relation) {
|
|
7124
7221
|
return "";
|
|
7125
7222
|
}
|
|
7126
|
-
const
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
7132
|
-
spouseType = "\xE9pouse";
|
|
7133
|
-
}
|
|
7223
|
+
const spouseType = pick2(
|
|
7224
|
+
sexOf2(this.path?.[this.path.length - 1].indi),
|
|
7225
|
+
"mari",
|
|
7226
|
+
"\xE9pouse",
|
|
7227
|
+
"conjoint"
|
|
7228
|
+
);
|
|
7134
7229
|
return `${spouseType} de ${relation}`;
|
|
7135
7230
|
}
|
|
7136
7231
|
of(relation) {
|
|
@@ -7151,6 +7246,9 @@ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
|
|
|
7151
7246
|
if (relation.includes(" du ") || relation.includes(" de ")) {
|
|
7152
7247
|
return relation.replace(/ (du|de) /, ` $1 ${name} `);
|
|
7153
7248
|
}
|
|
7249
|
+
if (relation.includes(" de l'")) {
|
|
7250
|
+
return relation.replace(" de l'", ` de ${name} l'`);
|
|
7251
|
+
}
|
|
7154
7252
|
return `${relation} de ${name}`;
|
|
7155
7253
|
}
|
|
7156
7254
|
inLaw(relation) {
|
|
@@ -7179,50 +7277,118 @@ var KinshipTranslatorFr = class extends KinshipTranslatorBasic {
|
|
|
7179
7277
|
if (!relation || !this.pathN?.relation) {
|
|
7180
7278
|
return relation ?? "";
|
|
7181
7279
|
}
|
|
7182
|
-
|
|
7280
|
+
const kind = parentRelationsFr[this.pathN.relation];
|
|
7281
|
+
if (!kind) {
|
|
7282
|
+
return relation;
|
|
7283
|
+
}
|
|
7284
|
+
if (kind === "step") {
|
|
7285
|
+
return `${isFeminineRelation(relation) ? "belle-" : "beau-"}${relation}`;
|
|
7286
|
+
}
|
|
7287
|
+
if (kind === "adopted") {
|
|
7288
|
+
return `${relation} ${isFeminineRelation(relation) ? "adoptive" : "adoptif"}`;
|
|
7289
|
+
}
|
|
7290
|
+
if (kind === "foster") {
|
|
7291
|
+
return `${relation} d'accueil`;
|
|
7292
|
+
}
|
|
7293
|
+
return relation;
|
|
7183
7294
|
}
|
|
7184
7295
|
};
|
|
7185
7296
|
|
|
7186
7297
|
// src/kinship-translator/patterns.es.ts
|
|
7298
|
+
var parentRelationsEs = {
|
|
7299
|
+
step: {
|
|
7300
|
+
padre: "padrastro",
|
|
7301
|
+
madre: "madrastra",
|
|
7302
|
+
hijo: "hijastro",
|
|
7303
|
+
hija: "hijastra",
|
|
7304
|
+
hermano: "hermanastro",
|
|
7305
|
+
hermana: "hermanastra",
|
|
7306
|
+
abuelo: "abuelastro",
|
|
7307
|
+
abuela: "abuelastra"
|
|
7308
|
+
}
|
|
7309
|
+
};
|
|
7187
7310
|
var InLawsEs = {
|
|
7188
7311
|
"c\xF3nyuge de (hijo/hija|hija|hijo)": "yerno/nuera",
|
|
7189
7312
|
"esposa de (hijo/hija|hija|hijo)": "nuera",
|
|
7190
7313
|
"esposo de (hijo/hija|hija|hijo)": "yerno",
|
|
7191
|
-
"madre del
|
|
7192
|
-
"padre del
|
|
7193
|
-
"padre/madre del
|
|
7314
|
+
"madre (del c\xF3nyuge|del esposo|de la esposa)": "suegra",
|
|
7315
|
+
"padre (del c\xF3nyuge|del esposo|de la esposa)": "suegro",
|
|
7316
|
+
"padre/madre (del c\xF3nyuge|del esposo|de la esposa)": "suegro/suegra",
|
|
7194
7317
|
"esposa de (medio |media |medio/a )?(hermano/hermana|hermana|hermano)": "cu\xF1ada",
|
|
7195
7318
|
"esposo de (medio |media |medio/a )?(hermano/hermana|hermana|hermano)": "cu\xF1ado",
|
|
7196
7319
|
"c\xF3nyuge de (medio |media |medio/a )?(hermano/hermana|hermana|hermano)": "cu\xF1ado/cu\xF1ada",
|
|
7197
|
-
"(medio |media |medio/a )?hermana del
|
|
7198
|
-
"(medio |media |medio/a )?hermano del
|
|
7199
|
-
"(medio |media |medio/a )?hermano/hermana del
|
|
7320
|
+
"(medio |media |medio/a )?hermana (del c\xF3nyuge|del esposo|de la esposa)": "cu\xF1ada",
|
|
7321
|
+
"(medio |media |medio/a )?hermano (del c\xF3nyuge|del esposo|de la esposa)": "cu\xF1ado",
|
|
7322
|
+
"(medio |media |medio/a )?hermano/hermana (del c\xF3nyuge|del esposo|de la esposa)": "cu\xF1ado/cu\xF1ada"
|
|
7200
7323
|
};
|
|
7201
7324
|
|
|
7202
7325
|
// src/kinship-translator/kinship-translator.es.ts
|
|
7203
|
-
var
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7326
|
+
var sexOf3 = (person) => {
|
|
7327
|
+
if (person?.isMale?.()) {
|
|
7328
|
+
return "m";
|
|
7329
|
+
}
|
|
7330
|
+
if (person?.isFemale?.()) {
|
|
7331
|
+
return "f";
|
|
7332
|
+
}
|
|
7333
|
+
return "n";
|
|
7334
|
+
};
|
|
7335
|
+
var pick3 = (sex, male, female, neutral) => {
|
|
7336
|
+
if (sex === "m") {
|
|
7337
|
+
return male;
|
|
7338
|
+
}
|
|
7339
|
+
if (sex === "f") {
|
|
7340
|
+
return female;
|
|
7216
7341
|
}
|
|
7342
|
+
return neutral;
|
|
7343
|
+
};
|
|
7344
|
+
var SPANISH_ORDINALS_M = [
|
|
7345
|
+
"",
|
|
7346
|
+
"",
|
|
7347
|
+
"segundo",
|
|
7348
|
+
"tercero",
|
|
7349
|
+
"cuarto",
|
|
7350
|
+
"quinto",
|
|
7351
|
+
"sexto",
|
|
7352
|
+
"s\xE9ptimo",
|
|
7353
|
+
"octavo",
|
|
7354
|
+
"noveno",
|
|
7355
|
+
"d\xE9cimo"
|
|
7356
|
+
];
|
|
7357
|
+
var SPANISH_ORDINALS_F = [
|
|
7358
|
+
"",
|
|
7359
|
+
"",
|
|
7360
|
+
"segunda",
|
|
7361
|
+
"tercera",
|
|
7362
|
+
"cuarta",
|
|
7363
|
+
"quinta",
|
|
7364
|
+
"sexta",
|
|
7365
|
+
"s\xE9ptima",
|
|
7366
|
+
"octava",
|
|
7367
|
+
"novena",
|
|
7368
|
+
"d\xE9cima"
|
|
7369
|
+
];
|
|
7370
|
+
var spanishOrdinal = (n, sex) => {
|
|
7371
|
+
const list = sex === "f" ? SPANISH_ORDINALS_F : SPANISH_ORDINALS_M;
|
|
7372
|
+
return list[n] ?? `${n}.\xBA`;
|
|
7373
|
+
};
|
|
7374
|
+
var ofSpousePrep2 = (spouseType) => {
|
|
7375
|
+
if (spouseType === "esposa") {
|
|
7376
|
+
return "de la ";
|
|
7377
|
+
}
|
|
7378
|
+
return "del ";
|
|
7379
|
+
};
|
|
7380
|
+
var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
|
|
7217
7381
|
indirect() {
|
|
7218
7382
|
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
7219
7383
|
if (degree > 0) {
|
|
7220
7384
|
degree = degree - 1;
|
|
7221
7385
|
}
|
|
7222
|
-
|
|
7223
|
-
|
|
7386
|
+
const sex = sexOf3(this.personN);
|
|
7387
|
+
const cousin = pick3(sex, "primo", "prima", "primo/prima");
|
|
7388
|
+
if (degree <= 1) {
|
|
7389
|
+
return cousin;
|
|
7224
7390
|
}
|
|
7225
|
-
return
|
|
7391
|
+
return `${cousin} ${spanishOrdinal(degree, sex)}`;
|
|
7226
7392
|
}
|
|
7227
7393
|
removal() {
|
|
7228
7394
|
const level = this.pathN?.level ?? 0;
|
|
@@ -7233,56 +7399,133 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
|
|
|
7233
7399
|
if (!degree) {
|
|
7234
7400
|
return level < 0 ? this.nibling() : this.auncle();
|
|
7235
7401
|
}
|
|
7236
|
-
return
|
|
7402
|
+
return `${this.indirect()} ${Math.abs(level)}\xD7 separado`;
|
|
7237
7403
|
}
|
|
7238
7404
|
auncle() {
|
|
7239
|
-
const
|
|
7240
|
-
|
|
7241
|
-
|
|
7405
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7406
|
+
const sex = sexOf3(this.personN);
|
|
7407
|
+
if (level <= 1) {
|
|
7408
|
+
return pick3(sex, "t\xEDo", "t\xEDa", "t\xEDo/t\xEDa");
|
|
7242
7409
|
}
|
|
7243
|
-
if (
|
|
7244
|
-
return
|
|
7410
|
+
if (level === 2) {
|
|
7411
|
+
return pick3(sex, "t\xEDo abuelo", "t\xEDa abuela", "t\xEDo/t\xEDa abuelo");
|
|
7245
7412
|
}
|
|
7246
|
-
|
|
7413
|
+
if (level === 3) {
|
|
7414
|
+
return pick3(
|
|
7415
|
+
sex,
|
|
7416
|
+
"t\xEDo bisabuelo",
|
|
7417
|
+
"t\xEDa bisabuela",
|
|
7418
|
+
"t\xEDo/t\xEDa bisabuelo"
|
|
7419
|
+
);
|
|
7420
|
+
}
|
|
7421
|
+
return pick3(
|
|
7422
|
+
sex,
|
|
7423
|
+
`t\xEDo abuelo (${level - 1}.\xBA)`,
|
|
7424
|
+
`t\xEDa abuela (${level - 1}.\xAA)`,
|
|
7425
|
+
`t\xEDo/t\xEDa abuelo (${level - 1}.\xBA)`
|
|
7426
|
+
);
|
|
7247
7427
|
}
|
|
7248
7428
|
nibling() {
|
|
7249
|
-
const
|
|
7250
|
-
|
|
7251
|
-
|
|
7429
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7430
|
+
const sex = sexOf3(this.personN);
|
|
7431
|
+
if (level <= 1) {
|
|
7432
|
+
return pick3(sex, "sobrino", "sobrina", "sobrino/sobrina");
|
|
7252
7433
|
}
|
|
7253
|
-
if (
|
|
7254
|
-
return
|
|
7434
|
+
if (level === 2) {
|
|
7435
|
+
return pick3(
|
|
7436
|
+
sex,
|
|
7437
|
+
"sobrino nieto",
|
|
7438
|
+
"sobrina nieta",
|
|
7439
|
+
"sobrino/sobrina nieto"
|
|
7440
|
+
);
|
|
7255
7441
|
}
|
|
7256
|
-
|
|
7442
|
+
if (level === 3) {
|
|
7443
|
+
return pick3(
|
|
7444
|
+
sex,
|
|
7445
|
+
"sobrino bisnieto",
|
|
7446
|
+
"sobrina bisnieta",
|
|
7447
|
+
"sobrino/sobrina bisnieto"
|
|
7448
|
+
);
|
|
7449
|
+
}
|
|
7450
|
+
return pick3(
|
|
7451
|
+
sex,
|
|
7452
|
+
`sobrino nieto (${level - 1}.\xBA)`,
|
|
7453
|
+
`sobrina nieta (${level - 1}.\xAA)`,
|
|
7454
|
+
`sobrino/sobrina nieto (${level - 1}.\xBA)`
|
|
7455
|
+
);
|
|
7257
7456
|
}
|
|
7258
7457
|
parent() {
|
|
7259
|
-
const
|
|
7260
|
-
|
|
7261
|
-
|
|
7458
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7459
|
+
const sex = sexOf3(this.personN);
|
|
7460
|
+
if (level <= 1) {
|
|
7461
|
+
return pick3(sex, "padre", "madre", "padre/madre");
|
|
7262
7462
|
}
|
|
7263
|
-
if (
|
|
7264
|
-
return
|
|
7463
|
+
if (level === 2) {
|
|
7464
|
+
return pick3(sex, "abuelo", "abuela", "abuelo/abuela");
|
|
7265
7465
|
}
|
|
7266
|
-
|
|
7466
|
+
if (level === 3) {
|
|
7467
|
+
return pick3(sex, "bisabuelo", "bisabuela", "bisabuelo/bisabuela");
|
|
7468
|
+
}
|
|
7469
|
+
if (level === 4) {
|
|
7470
|
+
return pick3(
|
|
7471
|
+
sex,
|
|
7472
|
+
"tatarabuelo",
|
|
7473
|
+
"tatarabuela",
|
|
7474
|
+
"tatarabuelo/tatarabuela"
|
|
7475
|
+
);
|
|
7476
|
+
}
|
|
7477
|
+
if (level === 5) {
|
|
7478
|
+
return pick3(
|
|
7479
|
+
sex,
|
|
7480
|
+
"trastatarabuelo",
|
|
7481
|
+
"trastatarabuela",
|
|
7482
|
+
"trastatarabuelo/trastatarabuela"
|
|
7483
|
+
);
|
|
7484
|
+
}
|
|
7485
|
+
return pick3(
|
|
7486
|
+
sex,
|
|
7487
|
+
`abuelo (${level}.\xBA)`,
|
|
7488
|
+
`abuela (${level}.\xAA)`,
|
|
7489
|
+
`abuelo/abuela (${level}.\xBA)`
|
|
7490
|
+
);
|
|
7267
7491
|
}
|
|
7268
7492
|
child() {
|
|
7269
|
-
const
|
|
7270
|
-
|
|
7271
|
-
|
|
7493
|
+
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7494
|
+
const sex = sexOf3(this.personN);
|
|
7495
|
+
if (level <= 1) {
|
|
7496
|
+
return pick3(sex, "hijo", "hija", "hijo/hija");
|
|
7272
7497
|
}
|
|
7273
|
-
if (
|
|
7274
|
-
return
|
|
7498
|
+
if (level === 2) {
|
|
7499
|
+
return pick3(sex, "nieto", "nieta", "nieto/nieta");
|
|
7275
7500
|
}
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
sibling() {
|
|
7279
|
-
if (this.personN?.isMale()) {
|
|
7280
|
-
return "hermano";
|
|
7501
|
+
if (level === 3) {
|
|
7502
|
+
return pick3(sex, "bisnieto", "bisnieta", "bisnieto/bisnieta");
|
|
7281
7503
|
}
|
|
7282
|
-
if (
|
|
7283
|
-
return
|
|
7504
|
+
if (level === 4) {
|
|
7505
|
+
return pick3(
|
|
7506
|
+
sex,
|
|
7507
|
+
"tataranieto",
|
|
7508
|
+
"tataranieta",
|
|
7509
|
+
"tataranieto/tataranieta"
|
|
7510
|
+
);
|
|
7511
|
+
}
|
|
7512
|
+
if (level === 5) {
|
|
7513
|
+
return pick3(
|
|
7514
|
+
sex,
|
|
7515
|
+
"trastataranieto",
|
|
7516
|
+
"trastataranieta",
|
|
7517
|
+
"trastataranieto/trastataranieta"
|
|
7518
|
+
);
|
|
7284
7519
|
}
|
|
7285
|
-
return
|
|
7520
|
+
return pick3(
|
|
7521
|
+
sex,
|
|
7522
|
+
`nieto (${level}.\xBA)`,
|
|
7523
|
+
`nieta (${level}.\xAA)`,
|
|
7524
|
+
`nieto/nieta (${level}.\xBA)`
|
|
7525
|
+
);
|
|
7526
|
+
}
|
|
7527
|
+
sibling() {
|
|
7528
|
+
return pick3(sexOf3(this.personN), "hermano", "hermana", "hermano/hermana");
|
|
7286
7529
|
}
|
|
7287
7530
|
halfBlood(relation) {
|
|
7288
7531
|
if (!relation || !this.isHalfBlood) {
|
|
@@ -7297,40 +7540,30 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
|
|
|
7297
7540
|
return `medio/a ${relation}`;
|
|
7298
7541
|
}
|
|
7299
7542
|
spouse() {
|
|
7300
|
-
|
|
7301
|
-
return "esposo";
|
|
7302
|
-
}
|
|
7303
|
-
if (this.personN?.isFemale()) {
|
|
7304
|
-
return "esposa";
|
|
7305
|
-
}
|
|
7306
|
-
return "c\xF3nyuge";
|
|
7543
|
+
return pick3(sexOf3(this.personN), "esposo", "esposa", "c\xF3nyuge");
|
|
7307
7544
|
}
|
|
7308
7545
|
ofSpouse(relation) {
|
|
7309
7546
|
if (!relation) {
|
|
7310
7547
|
return "";
|
|
7311
7548
|
}
|
|
7312
|
-
const
|
|
7313
|
-
|
|
7314
|
-
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
}
|
|
7320
|
-
return `${relation} del ${spouseType}`;
|
|
7549
|
+
const spouseType = pick3(
|
|
7550
|
+
sexOf3(this.path?.[1].indi),
|
|
7551
|
+
"esposo",
|
|
7552
|
+
"esposa",
|
|
7553
|
+
"c\xF3nyuge"
|
|
7554
|
+
);
|
|
7555
|
+
return `${relation} ${ofSpousePrep2(spouseType)}${spouseType}`;
|
|
7321
7556
|
}
|
|
7322
7557
|
spouseOf(relation) {
|
|
7323
7558
|
if (!relation) {
|
|
7324
7559
|
return "";
|
|
7325
7560
|
}
|
|
7326
|
-
const
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
spouseType = "esposa";
|
|
7333
|
-
}
|
|
7561
|
+
const spouseType = pick3(
|
|
7562
|
+
sexOf3(this.path?.[this.path.length - 1].indi),
|
|
7563
|
+
"esposo",
|
|
7564
|
+
"esposa",
|
|
7565
|
+
"c\xF3nyuge"
|
|
7566
|
+
);
|
|
7334
7567
|
return `${spouseType} de ${relation}`;
|
|
7335
7568
|
}
|
|
7336
7569
|
of(relation) {
|
|
@@ -7348,8 +7581,8 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
|
|
|
7348
7581
|
if (!name || !relation) {
|
|
7349
7582
|
return relation ?? "";
|
|
7350
7583
|
}
|
|
7351
|
-
if (relation.includes(" del ") || relation.includes(" de ")) {
|
|
7352
|
-
return relation.replace(/ (del|de) /, ` $1 ${name} `);
|
|
7584
|
+
if (relation.includes(" del ") || relation.includes(" de la ") || relation.includes(" de ")) {
|
|
7585
|
+
return relation.replace(/ (del|de la|de) /, ` $1 ${name} `);
|
|
7353
7586
|
}
|
|
7354
7587
|
return `${relation} de ${name}`;
|
|
7355
7588
|
}
|
|
@@ -7379,7 +7612,20 @@ var KinshipTranslatorEs = class extends KinshipTranslatorBasic {
|
|
|
7379
7612
|
if (!relation || !this.pathN?.relation) {
|
|
7380
7613
|
return relation ?? "";
|
|
7381
7614
|
}
|
|
7382
|
-
|
|
7615
|
+
const mapped = parentRelationsEs[this.pathN.relation]?.[relation];
|
|
7616
|
+
if (mapped) {
|
|
7617
|
+
return mapped;
|
|
7618
|
+
}
|
|
7619
|
+
if (this.pathN.relation === "step") {
|
|
7620
|
+
return `${relation} pol\xEDtico`;
|
|
7621
|
+
}
|
|
7622
|
+
if (this.pathN.relation === "adopted") {
|
|
7623
|
+
return `${relation} adoptivo`;
|
|
7624
|
+
}
|
|
7625
|
+
if (this.pathN.relation === "foster") {
|
|
7626
|
+
return `${relation} de acogida`;
|
|
7627
|
+
}
|
|
7628
|
+
return relation;
|
|
7383
7629
|
}
|
|
7384
7630
|
};
|
|
7385
7631
|
|
|
@@ -7388,15 +7634,35 @@ var InLawsRu = {
|
|
|
7388
7634
|
"\u0441\u0443\u043F\u0440\u0443\u0433(?:\u0430)? (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u0437\u044F\u0442\u044C/\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
|
|
7389
7635
|
"\u0436\u0435\u043D\u0430 (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
|
|
7390
7636
|
"\u043C\u0443\u0436 (\u0440\u0435\u0431\u0451\u043D\u043A\u0430|\u0434\u043E\u0447\u0435\u0440\u0438|\u0441\u044B\u043D\u0430)": "\u0437\u044F\u0442\u044C",
|
|
7391
|
-
"\u043C\u0430\u0442\u044C
|
|
7392
|
-
"\
|
|
7393
|
-
"\
|
|
7637
|
+
"\u043C\u0430\u0442\u044C \u0436\u0435\u043D\u044B": "\u0442\u0451\u0449\u0430",
|
|
7638
|
+
"\u043C\u0430\u0442\u044C \u043C\u0443\u0436\u0430": "\u0441\u0432\u0435\u043A\u0440\u043E\u0432\u044C",
|
|
7639
|
+
"\u043C\u0430\u0442\u044C \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0442\u0451\u0449\u0430/\u0441\u0432\u0435\u043A\u0440\u043E\u0432\u044C",
|
|
7640
|
+
"\u043E\u0442\u0435\u0446 \u0436\u0435\u043D\u044B": "\u0442\u0435\u0441\u0442\u044C",
|
|
7641
|
+
"\u043E\u0442\u0435\u0446 \u043C\u0443\u0436\u0430": "\u0441\u0432\u0451\u043A\u043E\u0440",
|
|
7642
|
+
"\u043E\u0442\u0435\u0446 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0442\u0435\u0441\u0442\u044C/\u0441\u0432\u0451\u043A\u043E\u0440",
|
|
7643
|
+
"\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C \u0436\u0435\u043D\u044B": "\u0442\u0435\u0441\u0442\u044C/\u0442\u0451\u0449\u0430",
|
|
7644
|
+
"\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C \u043C\u0443\u0436\u0430": "\u0441\u0432\u0451\u043A\u043E\u0440/\u0441\u0432\u0435\u043A\u0440\u043E\u0432\u044C",
|
|
7645
|
+
"\u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0442\u0435\u0441\u0442\u044C/\u0442\u0451\u0449\u0430",
|
|
7394
7646
|
"\u0436\u0435\u043D\u0430 (\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?(\u0431\u0440\u0430\u0442\u0430|\u0441\u0435\u0441\u0442\u0440\u044B|\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430)": "\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
|
|
7395
7647
|
"\u043C\u0443\u0436 (\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?(\u0431\u0440\u0430\u0442\u0430|\u0441\u0435\u0441\u0442\u0440\u044B|\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430)": "\u0437\u044F\u0442\u044C",
|
|
7396
7648
|
"\u0441\u0443\u043F\u0440\u0443\u0433(?:\u0430)? (\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?(\u0431\u0440\u0430\u0442\u0430|\u0441\u0435\u0441\u0442\u0440\u044B|\u0441\u0438\u0431\u043B\u0438\u043D\u0433\u0430)": "\u0437\u044F\u0442\u044C/\u043D\u0435\u0432\u0435\u0441\u0442\u043A\u0430",
|
|
7397
|
-
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430
|
|
7398
|
-
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\
|
|
7399
|
-
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\
|
|
7649
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430 \u0436\u0435\u043D\u044B": "\u0441\u0432\u043E\u044F\u0447\u0435\u043D\u0438\u0446\u0430",
|
|
7650
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430 \u043C\u0443\u0436\u0430": "\u0437\u043E\u043B\u043E\u0432\u043A\u0430",
|
|
7651
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0435\u0441\u0442\u0440\u0430 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0441\u0432\u043E\u044F\u0447\u0435\u043D\u0438\u0446\u0430/\u0437\u043E\u043B\u043E\u0432\u043A\u0430",
|
|
7652
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0431\u0440\u0430\u0442 \u0436\u0435\u043D\u044B": "\u0448\u0443\u0440\u0438\u043D",
|
|
7653
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0431\u0440\u0430\u0442 \u043C\u0443\u0436\u0430": "\u0434\u0435\u0432\u0435\u0440\u044C",
|
|
7654
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0431\u0440\u0430\u0442 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0448\u0443\u0440\u0438\u043D/\u0434\u0435\u0432\u0435\u0440\u044C",
|
|
7655
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0438\u0431\u043B\u0438\u043D\u0433 \u0436\u0435\u043D\u044B": "\u0448\u0443\u0440\u0438\u043D/\u0441\u0432\u043E\u044F\u0447\u0435\u043D\u0438\u0446\u0430",
|
|
7656
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0438\u0431\u043B\u0438\u043D\u0433 \u043C\u0443\u0436\u0430": "\u0434\u0435\u0432\u0435\u0440\u044C/\u0437\u043E\u043B\u043E\u0432\u043A\u0430",
|
|
7657
|
+
"(\u0441\u0432\u043E\u0434\u043D(?:\u044B\u0439|\u0430\u044F) )?\u0441\u0438\u0431\u043B\u0438\u043D\u0433 \u0441\u0443\u043F\u0440\u0443\u0433\u0430": "\u0448\u0443\u0440\u0438\u043D/\u0437\u043E\u043B\u043E\u0432\u043A\u0430"
|
|
7658
|
+
};
|
|
7659
|
+
var parentRelationsRu = {
|
|
7660
|
+
step: {
|
|
7661
|
+
\u043E\u0442\u0435\u0446: "\u043E\u0442\u0447\u0438\u043C",
|
|
7662
|
+
\u043C\u0430\u0442\u044C: "\u043C\u0430\u0447\u0435\u0445\u0430",
|
|
7663
|
+
\u0441\u044B\u043D: "\u043F\u0430\u0441\u044B\u043D\u043E\u043A",
|
|
7664
|
+
\u0434\u043E\u0447\u044C: "\u043F\u0430\u0434\u0447\u0435\u0440\u0438\u0446\u0430"
|
|
7665
|
+
}
|
|
7400
7666
|
};
|
|
7401
7667
|
|
|
7402
7668
|
// src/kinship-translator/kinship-translator.ru.ts
|
|
@@ -7427,7 +7693,7 @@ var cousinWord = (degree, sex) => {
|
|
|
7427
7693
|
return `${stem}\u044B\u0439 \u0431\u0440\u0430\u0442/\u0441\u0435\u0441\u0442\u0440\u0430`;
|
|
7428
7694
|
};
|
|
7429
7695
|
var praRepeat = (count) => count > 0 ? "\u043F\u0440\u0430".repeat(count) : "";
|
|
7430
|
-
var
|
|
7696
|
+
var sexOf4 = (person) => {
|
|
7431
7697
|
if (person?.isMale?.()) {
|
|
7432
7698
|
return "m";
|
|
7433
7699
|
}
|
|
@@ -7442,7 +7708,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7442
7708
|
if (degree > 0) {
|
|
7443
7709
|
degree = degree - 1;
|
|
7444
7710
|
}
|
|
7445
|
-
return cousinWord(degree,
|
|
7711
|
+
return cousinWord(degree, sexOf4(this.personN));
|
|
7446
7712
|
}
|
|
7447
7713
|
removal() {
|
|
7448
7714
|
const level = this.pathN?.level ?? 0;
|
|
@@ -7454,35 +7720,53 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7454
7720
|
return level < 0 ? this.nibling() : this.auncle();
|
|
7455
7721
|
}
|
|
7456
7722
|
const removed = Math.abs(level);
|
|
7457
|
-
return `${cousinWord(degree,
|
|
7723
|
+
return `${cousinWord(degree, sexOf4(this.personN))} (${removed}\xD7 \u0447\u0435\u0440\u0435\u0437 \u043F\u043E\u043A\u043E\u043B\u0435\u043D\u0438\u0435)`;
|
|
7458
7724
|
}
|
|
7459
7725
|
auncle() {
|
|
7460
7726
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7461
|
-
const
|
|
7462
|
-
|
|
7727
|
+
const sex = sexOf4(this.personN);
|
|
7728
|
+
if (level <= 1) {
|
|
7729
|
+
if (sex === "m") {
|
|
7730
|
+
return "\u0434\u044F\u0434\u044F";
|
|
7731
|
+
}
|
|
7732
|
+
if (sex === "f") {
|
|
7733
|
+
return "\u0442\u0451\u0442\u044F";
|
|
7734
|
+
}
|
|
7735
|
+
return "\u0434\u044F\u0434\u044F/\u0442\u0451\u0442\u044F";
|
|
7736
|
+
}
|
|
7737
|
+
const pra = praRepeat(level - 2);
|
|
7463
7738
|
if (sex === "m") {
|
|
7464
|
-
return
|
|
7739
|
+
return `\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D\u044B\u0439 ${pra}\u0434\u0435\u0434`;
|
|
7465
7740
|
}
|
|
7466
7741
|
if (sex === "f") {
|
|
7467
|
-
return
|
|
7742
|
+
return `\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D\u0430\u044F ${pra}\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
|
|
7468
7743
|
}
|
|
7469
|
-
return
|
|
7744
|
+
return `\u0434\u0432\u043E\u044E\u0440\u043E\u0434\u043D\u044B\u0439 ${pra}\u0434\u0435\u0434/\u0431\u0430\u0431\u0443\u0448\u043A\u0430`;
|
|
7470
7745
|
}
|
|
7471
7746
|
nibling() {
|
|
7472
7747
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7473
|
-
const
|
|
7474
|
-
|
|
7748
|
+
const sex = sexOf4(this.personN);
|
|
7749
|
+
if (level <= 1) {
|
|
7750
|
+
if (sex === "m") {
|
|
7751
|
+
return "\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A";
|
|
7752
|
+
}
|
|
7753
|
+
if (sex === "f") {
|
|
7754
|
+
return "\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430";
|
|
7755
|
+
}
|
|
7756
|
+
return "\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430";
|
|
7757
|
+
}
|
|
7758
|
+
const pra = praRepeat(level - 2);
|
|
7475
7759
|
if (sex === "m") {
|
|
7476
|
-
return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A`;
|
|
7760
|
+
return `${pra}\u0432\u043D\u0443\u0447\u0430\u0442\u044B\u0439 \u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A`;
|
|
7477
7761
|
}
|
|
7478
7762
|
if (sex === "f") {
|
|
7479
|
-
return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
|
|
7763
|
+
return `${pra}\u0432\u043D\u0443\u0447\u0430\u0442\u0430\u044F \u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
|
|
7480
7764
|
}
|
|
7481
|
-
return `${pra}\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
|
|
7765
|
+
return `${pra}\u0432\u043D\u0443\u0447\u0430\u0442\u044B\u0439 \u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u043A/\u043F\u043B\u0435\u043C\u044F\u043D\u043D\u0438\u0446\u0430`;
|
|
7482
7766
|
}
|
|
7483
7767
|
parent() {
|
|
7484
7768
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7485
|
-
const sex =
|
|
7769
|
+
const sex = sexOf4(this.personN);
|
|
7486
7770
|
if (level <= 1) {
|
|
7487
7771
|
if (sex === "m") {
|
|
7488
7772
|
return "\u043E\u0442\u0435\u0446";
|
|
@@ -7512,7 +7796,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7512
7796
|
}
|
|
7513
7797
|
child() {
|
|
7514
7798
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7515
|
-
const sex =
|
|
7799
|
+
const sex = sexOf4(this.personN);
|
|
7516
7800
|
if (level <= 1) {
|
|
7517
7801
|
if (sex === "m") {
|
|
7518
7802
|
return "\u0441\u044B\u043D";
|
|
@@ -7541,14 +7825,14 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7541
7825
|
return `${pra}\u0432\u043D\u0443\u043A/\u0432\u043D\u0443\u0447\u043A\u0430`;
|
|
7542
7826
|
}
|
|
7543
7827
|
sibling() {
|
|
7544
|
-
const sex =
|
|
7828
|
+
const sex = sexOf4(this.personN);
|
|
7545
7829
|
if (sex === "m") {
|
|
7546
7830
|
return "\u0431\u0440\u0430\u0442";
|
|
7547
7831
|
}
|
|
7548
7832
|
if (sex === "f") {
|
|
7549
7833
|
return "\u0441\u0435\u0441\u0442\u0440\u0430";
|
|
7550
7834
|
}
|
|
7551
|
-
return "\u0441\
|
|
7835
|
+
return "\u0431\u0440\u0430\u0442/\u0441\u0435\u0441\u0442\u0440\u0430";
|
|
7552
7836
|
}
|
|
7553
7837
|
halfBlood(relation) {
|
|
7554
7838
|
if (!relation || !this.isHalfBlood) {
|
|
@@ -7562,7 +7846,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7562
7846
|
return `\u0441\u0432\u043E\u0434\u043D\u044B\u0439 ${relation}`;
|
|
7563
7847
|
}
|
|
7564
7848
|
spouse() {
|
|
7565
|
-
const sex =
|
|
7849
|
+
const sex = sexOf4(this.personN);
|
|
7566
7850
|
if (sex === "m") {
|
|
7567
7851
|
return "\u043C\u0443\u0436";
|
|
7568
7852
|
}
|
|
@@ -7576,7 +7860,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7576
7860
|
return "";
|
|
7577
7861
|
}
|
|
7578
7862
|
const spouse = this.path?.[1].indi;
|
|
7579
|
-
const sex =
|
|
7863
|
+
const sex = sexOf4(spouse);
|
|
7580
7864
|
const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
|
|
7581
7865
|
return `${relation} ${toGenitive(spouseType)}`;
|
|
7582
7866
|
}
|
|
@@ -7585,7 +7869,7 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7585
7869
|
return "";
|
|
7586
7870
|
}
|
|
7587
7871
|
const spouse = this.path?.[this.path.length - 1].indi;
|
|
7588
|
-
const sex =
|
|
7872
|
+
const sex = sexOf4(spouse);
|
|
7589
7873
|
const spouseType = sex === "m" ? "\u043C\u0443\u0436" : sex === "f" ? "\u0436\u0435\u043D\u0430" : "\u0441\u0443\u043F\u0440\u0443\u0433";
|
|
7590
7874
|
return `${spouseType} ${toGenitive(relation)}`;
|
|
7591
7875
|
}
|
|
@@ -7622,7 +7906,22 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
|
|
|
7622
7906
|
if (!relation || !this.pathN?.relation) {
|
|
7623
7907
|
return relation ?? "";
|
|
7624
7908
|
}
|
|
7625
|
-
|
|
7909
|
+
const mapped = parentRelationsRu[this.pathN.relation]?.[relation];
|
|
7910
|
+
if (mapped) {
|
|
7911
|
+
return mapped;
|
|
7912
|
+
}
|
|
7913
|
+
if (this.pathN.relation === "step") {
|
|
7914
|
+
return `\u043D\u0435\u0440\u043E\u0434\u043D\u043E\u0439 ${relation}`;
|
|
7915
|
+
}
|
|
7916
|
+
if (this.pathN.relation === "adopted") {
|
|
7917
|
+
return /сестра|дочь|мать|тётя|бабушка|жена|племянница|внучка/.test(
|
|
7918
|
+
relation
|
|
7919
|
+
) ? `\u043F\u0440\u0438\u0451\u043C\u043D\u0430\u044F ${relation}` : `\u043F\u0440\u0438\u0451\u043C\u043D\u044B\u0439 ${relation}`;
|
|
7920
|
+
}
|
|
7921
|
+
if (this.pathN.relation === "foster") {
|
|
7922
|
+
return `\u043F\u0440\u0438\u0451\u043C\u043D\u044B\u0439 ${relation}`;
|
|
7923
|
+
}
|
|
7924
|
+
return relation;
|
|
7626
7925
|
}
|
|
7627
7926
|
};
|
|
7628
7927
|
|
|
@@ -7646,7 +7945,7 @@ var InLawsJa = {
|
|
|
7646
7945
|
};
|
|
7647
7946
|
|
|
7648
7947
|
// src/kinship-translator/kinship-translator.ja.ts
|
|
7649
|
-
var
|
|
7948
|
+
var sexOf5 = (person) => {
|
|
7650
7949
|
if (person?.isMale?.()) {
|
|
7651
7950
|
return "m";
|
|
7652
7951
|
}
|
|
@@ -7655,7 +7954,7 @@ var sexOf2 = (person) => {
|
|
|
7655
7954
|
}
|
|
7656
7955
|
return "n";
|
|
7657
7956
|
};
|
|
7658
|
-
var
|
|
7957
|
+
var pick4 = (sex, male, female, neutral) => {
|
|
7659
7958
|
if (sex === "m") {
|
|
7660
7959
|
return male;
|
|
7661
7960
|
}
|
|
@@ -7668,18 +7967,18 @@ var lineal = (level, sex, kind) => {
|
|
|
7668
7967
|
const L = Math.max(1, level);
|
|
7669
7968
|
if (kind === "asc") {
|
|
7670
7969
|
if (L <= 1) {
|
|
7671
|
-
return
|
|
7970
|
+
return pick4(sex, "\u7236", "\u6BCD", "\u89AA");
|
|
7672
7971
|
}
|
|
7673
7972
|
if (L === 2) {
|
|
7674
|
-
return
|
|
7973
|
+
return pick4(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
|
|
7675
7974
|
}
|
|
7676
7975
|
if (L === 3) {
|
|
7677
|
-
return
|
|
7976
|
+
return pick4(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
|
|
7678
7977
|
}
|
|
7679
7978
|
if (L === 4) {
|
|
7680
|
-
return
|
|
7979
|
+
return pick4(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
|
|
7681
7980
|
}
|
|
7682
|
-
return
|
|
7981
|
+
return pick4(
|
|
7683
7982
|
sex,
|
|
7684
7983
|
`${L - 1}\u4E16\u306E\u7956\u7236`,
|
|
7685
7984
|
`${L - 1}\u4E16\u306E\u7956\u6BCD`,
|
|
@@ -7687,7 +7986,7 @@ var lineal = (level, sex, kind) => {
|
|
|
7687
7986
|
);
|
|
7688
7987
|
}
|
|
7689
7988
|
if (L <= 1) {
|
|
7690
|
-
return
|
|
7989
|
+
return pick4(sex, "\u606F\u5B50", "\u5A18", "\u5B50");
|
|
7691
7990
|
}
|
|
7692
7991
|
if (L === 2) {
|
|
7693
7992
|
return "\u5B6B";
|
|
@@ -7734,52 +8033,52 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
|
|
|
7734
8033
|
}
|
|
7735
8034
|
auncle() {
|
|
7736
8035
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7737
|
-
const sex =
|
|
7738
|
-
if (level <=
|
|
7739
|
-
return
|
|
8036
|
+
const sex = sexOf5(this.personN);
|
|
8037
|
+
if (level <= 1) {
|
|
8038
|
+
return pick4(sex, "\u304A\u3058", "\u304A\u3070", "\u304A\u3058/\u304A\u3070");
|
|
7740
8039
|
}
|
|
7741
|
-
if (level ===
|
|
7742
|
-
return
|
|
8040
|
+
if (level === 2) {
|
|
8041
|
+
return pick4(sex, "\u5927\u304A\u3058", "\u5927\u304A\u3070", "\u5927\u304A\u3058/\u5927\u304A\u3070");
|
|
7743
8042
|
}
|
|
7744
|
-
return
|
|
8043
|
+
return pick4(
|
|
7745
8044
|
sex,
|
|
7746
|
-
`${level -
|
|
7747
|
-
`${level -
|
|
7748
|
-
`${level -
|
|
8045
|
+
`${level - 1}\u4EE3\u524D\u306E\u304A\u3058`,
|
|
8046
|
+
`${level - 1}\u4EE3\u524D\u306E\u304A\u3070`,
|
|
8047
|
+
`${level - 1}\u4EE3\u524D\u306E\u304A\u3058/\u304A\u3070`
|
|
7749
8048
|
);
|
|
7750
8049
|
}
|
|
7751
8050
|
nibling() {
|
|
7752
8051
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7753
|
-
const sex =
|
|
7754
|
-
if (level <=
|
|
7755
|
-
return
|
|
8052
|
+
const sex = sexOf5(this.personN);
|
|
8053
|
+
if (level <= 1) {
|
|
8054
|
+
return pick4(sex, "\u7525", "\u59EA", "\u7525/\u59EA");
|
|
7756
8055
|
}
|
|
7757
|
-
if (level ===
|
|
7758
|
-
return
|
|
8056
|
+
if (level === 2) {
|
|
8057
|
+
return pick4(sex, "\u5927\u7525", "\u5927\u59EA", "\u5927\u7525/\u5927\u59EA");
|
|
7759
8058
|
}
|
|
7760
|
-
return
|
|
8059
|
+
return pick4(
|
|
7761
8060
|
sex,
|
|
7762
|
-
`${level -
|
|
7763
|
-
`${level -
|
|
7764
|
-
`${level -
|
|
8061
|
+
`${level - 1}\u4EE3\u4E0B\u306E\u7525`,
|
|
8062
|
+
`${level - 1}\u4EE3\u4E0B\u306E\u59EA`,
|
|
8063
|
+
`${level - 1}\u4EE3\u4E0B\u306E\u7525/\u59EA`
|
|
7765
8064
|
);
|
|
7766
8065
|
}
|
|
7767
8066
|
parent() {
|
|
7768
8067
|
return lineal(
|
|
7769
8068
|
Math.abs(this.pathN?.level ?? 0),
|
|
7770
|
-
|
|
8069
|
+
sexOf5(this.personN),
|
|
7771
8070
|
"asc"
|
|
7772
8071
|
);
|
|
7773
8072
|
}
|
|
7774
8073
|
child() {
|
|
7775
8074
|
return lineal(
|
|
7776
8075
|
Math.abs(this.pathN?.level ?? 0),
|
|
7777
|
-
|
|
8076
|
+
sexOf5(this.personN),
|
|
7778
8077
|
"desc"
|
|
7779
8078
|
);
|
|
7780
8079
|
}
|
|
7781
8080
|
sibling() {
|
|
7782
|
-
return
|
|
8081
|
+
return pick4(sexOf5(this.personN), "\u5144\u5F1F", "\u59C9\u59B9", "\u5144\u5F1F\u59C9\u59B9");
|
|
7783
8082
|
}
|
|
7784
8083
|
halfBlood(relation) {
|
|
7785
8084
|
if (!relation || !this.isHalfBlood) {
|
|
@@ -7788,14 +8087,14 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
|
|
|
7788
8087
|
return `\u7570\u7236\u6BCD\u306E${relation}`;
|
|
7789
8088
|
}
|
|
7790
8089
|
spouse() {
|
|
7791
|
-
return
|
|
8090
|
+
return pick4(sexOf5(this.personN), "\u592B", "\u59BB", "\u914D\u5076\u8005");
|
|
7792
8091
|
}
|
|
7793
8092
|
ofSpouse(relation) {
|
|
7794
8093
|
if (!relation) {
|
|
7795
8094
|
return "";
|
|
7796
8095
|
}
|
|
7797
|
-
const spouseType =
|
|
7798
|
-
|
|
8096
|
+
const spouseType = pick4(
|
|
8097
|
+
sexOf5(this.path?.[1].indi),
|
|
7799
8098
|
"\u592B",
|
|
7800
8099
|
"\u59BB",
|
|
7801
8100
|
"\u914D\u5076\u8005"
|
|
@@ -7807,7 +8106,7 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
|
|
|
7807
8106
|
return "";
|
|
7808
8107
|
}
|
|
7809
8108
|
const spouse = this.path?.[this.path.length - 1].indi;
|
|
7810
|
-
const spouseType =
|
|
8109
|
+
const spouseType = pick4(sexOf5(spouse), "\u592B", "\u59BB", "\u914D\u5076\u8005");
|
|
7811
8110
|
return `${relation}\u306E${spouseType}`;
|
|
7812
8111
|
}
|
|
7813
8112
|
of(relation) {
|
|
@@ -7843,7 +8142,28 @@ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
|
|
|
7843
8142
|
if (!relation || !this.pathN?.relation) {
|
|
7844
8143
|
return relation ?? "";
|
|
7845
8144
|
}
|
|
7846
|
-
|
|
8145
|
+
if (this.pathN.relation === "step") {
|
|
8146
|
+
if (relation === "\u7236") {
|
|
8147
|
+
return "\u7EE7\u7236";
|
|
8148
|
+
}
|
|
8149
|
+
if (relation === "\u6BCD") {
|
|
8150
|
+
return "\u7D99\u6BCD";
|
|
8151
|
+
}
|
|
8152
|
+
if (relation === "\u606F\u5B50") {
|
|
8153
|
+
return "\u7D99\u5B50";
|
|
8154
|
+
}
|
|
8155
|
+
if (relation === "\u5A18") {
|
|
8156
|
+
return "\u7D99\u5A18";
|
|
8157
|
+
}
|
|
8158
|
+
return `\u7D99${relation}`;
|
|
8159
|
+
}
|
|
8160
|
+
if (this.pathN.relation === "adopted") {
|
|
8161
|
+
return `\u990A\u5B50\u306E${relation}`;
|
|
8162
|
+
}
|
|
8163
|
+
if (this.pathN.relation === "foster") {
|
|
8164
|
+
return `\u91CC\u89AA\u306E${relation}`;
|
|
8165
|
+
}
|
|
8166
|
+
return relation;
|
|
7847
8167
|
}
|
|
7848
8168
|
};
|
|
7849
8169
|
|
|
@@ -7852,22 +8172,32 @@ var InLawsZh = {
|
|
|
7852
8172
|
"(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u914D\u5076": "\u513F\u5AB3/\u5973\u5A7F",
|
|
7853
8173
|
"(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u59BB\u5B50": "\u513F\u5AB3",
|
|
7854
8174
|
"(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u4E08\u592B": "\u5973\u5A7F",
|
|
7855
|
-
"
|
|
7856
|
-
"
|
|
7857
|
-
"(\u914D\u5076
|
|
8175
|
+
"\u59BB\u5B50\u7684\u6BCD\u4EB2": "\u5CB3\u6BCD",
|
|
8176
|
+
"\u4E08\u592B\u7684\u6BCD\u4EB2": "\u5A46\u5A46",
|
|
8177
|
+
"(\u914D\u5076)\u7684\u6BCD\u4EB2": "\u5CB3\u6BCD/\u5A46\u5A46",
|
|
8178
|
+
"\u59BB\u5B50\u7684\u7236\u4EB2": "\u5CB3\u7236",
|
|
8179
|
+
"\u4E08\u592B\u7684\u7236\u4EB2": "\u516C\u516C",
|
|
8180
|
+
"(\u914D\u5076)\u7684\u7236\u4EB2": "\u5CB3\u7236/\u516C\u516C",
|
|
8181
|
+
"\u59BB\u5B50\u7684\u7236\u6BCD": "\u5CB3\u7236\u5CB3\u6BCD",
|
|
8182
|
+
"\u4E08\u592B\u7684\u7236\u6BCD": "\u516C\u516C\u5A46\u5A46",
|
|
8183
|
+
"(\u914D\u5076)\u7684\u7236\u6BCD": "\u5CB3\u7236\u5CB3\u6BCD/\u516C\u516C\u5A46\u5A46",
|
|
7858
8184
|
"(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u59BB\u5B50": "\u5AC2\u5B50/\u5F1F\u59B9",
|
|
7859
8185
|
"(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u4E08\u592B": "\u59D0\u592B/\u59B9\u592B",
|
|
7860
8186
|
"(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u914D\u5076": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
|
|
7861
8187
|
"(\u5F02\u7236\u6BCD\u7684)?\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59D0\u592B/\u59B9\u592B",
|
|
7862
8188
|
"(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u5AC2\u5B50/\u5F1F\u59B9",
|
|
7863
8189
|
"(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
|
|
7864
|
-
"(\u5F02\u7236\u6BCD\u7684)
|
|
7865
|
-
"(\u5F02\u7236\u6BCD\u7684)
|
|
8190
|
+
"(\u5F02\u7236\u6BCD\u7684)?\u59BB\u5B50\u7684\u59D0\u59B9": "\u59E8\u5B50",
|
|
8191
|
+
"(\u5F02\u7236\u6BCD\u7684)?\u4E08\u592B\u7684\u59D0\u59B9": "\u59D1\u5B50",
|
|
8192
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076)\u7684\u59D0\u59B9": "\u59D1\u5B50/\u59E8\u5B50",
|
|
8193
|
+
"(\u5F02\u7236\u6BCD\u7684)?\u59BB\u5B50\u7684\u5144\u5F1F": "\u5185\u5144/\u5185\u5F1F",
|
|
8194
|
+
"(\u5F02\u7236\u6BCD\u7684)?\u4E08\u592B\u7684\u5144\u5F1F": "\u5927\u4F2F/\u5C0F\u53D4",
|
|
8195
|
+
"(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076)\u7684\u5144\u5F1F": "\u5927\u4F2F/\u5C0F\u53D4/\u5185\u5144/\u5185\u5F1F",
|
|
7866
8196
|
"(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u5144\u5F1F\u59D0\u59B9": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9"
|
|
7867
8197
|
};
|
|
7868
8198
|
|
|
7869
8199
|
// src/kinship-translator/kinship-translator.zh.ts
|
|
7870
|
-
var
|
|
8200
|
+
var sexOf6 = (person) => {
|
|
7871
8201
|
if (person?.isMale?.()) {
|
|
7872
8202
|
return "m";
|
|
7873
8203
|
}
|
|
@@ -7876,7 +8206,7 @@ var sexOf3 = (person) => {
|
|
|
7876
8206
|
}
|
|
7877
8207
|
return "n";
|
|
7878
8208
|
};
|
|
7879
|
-
var
|
|
8209
|
+
var pick5 = (sex, male, female, neutral) => {
|
|
7880
8210
|
if (sex === "m") {
|
|
7881
8211
|
return male;
|
|
7882
8212
|
}
|
|
@@ -7889,41 +8219,41 @@ var lineal2 = (level, sex, kind) => {
|
|
|
7889
8219
|
const L = Math.max(1, level);
|
|
7890
8220
|
if (kind === "asc") {
|
|
7891
8221
|
if (L <= 1) {
|
|
7892
|
-
return
|
|
8222
|
+
return pick5(sex, "\u7236\u4EB2", "\u6BCD\u4EB2", "\u7236\u6BCD");
|
|
7893
8223
|
}
|
|
7894
8224
|
if (L === 2) {
|
|
7895
|
-
return
|
|
8225
|
+
return pick5(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
|
|
7896
8226
|
}
|
|
7897
8227
|
if (L === 3) {
|
|
7898
|
-
return
|
|
8228
|
+
return pick5(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
|
|
7899
8229
|
}
|
|
7900
8230
|
if (L === 4) {
|
|
7901
|
-
return
|
|
8231
|
+
return pick5(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
|
|
7902
8232
|
}
|
|
7903
|
-
return
|
|
8233
|
+
return pick5(sex, `${L}\u4E16\u7956`, `${L}\u4E16\u7956\u6BCD`, `${L}\u4E16\u7956\u7236\u6BCD`);
|
|
7904
8234
|
}
|
|
7905
8235
|
if (L <= 1) {
|
|
7906
|
-
return
|
|
8236
|
+
return pick5(sex, "\u513F\u5B50", "\u5973\u513F", "\u5B50\u5973");
|
|
7907
8237
|
}
|
|
7908
8238
|
if (L === 2) {
|
|
7909
|
-
return
|
|
8239
|
+
return pick5(sex, "\u5B59\u5B50", "\u5B59\u5973", "\u5B59\u5B50\u5973");
|
|
7910
8240
|
}
|
|
7911
8241
|
if (L === 3) {
|
|
7912
|
-
return
|
|
8242
|
+
return pick5(sex, "\u66FE\u5B59", "\u66FE\u5B59\u5973", "\u66FE\u5B59\u5B50\u5973");
|
|
7913
8243
|
}
|
|
7914
8244
|
if (L === 4) {
|
|
7915
|
-
return
|
|
8245
|
+
return pick5(sex, "\u7384\u5B59", "\u7384\u5B59\u5973", "\u7384\u5B59\u5B50\u5973");
|
|
7916
8246
|
}
|
|
7917
|
-
return
|
|
8247
|
+
return pick5(sex, `${L}\u4E16\u5B59`, `${L}\u4E16\u5B59\u5973`, `${L}\u4E16\u5B59\u5B50\u5973`);
|
|
7918
8248
|
};
|
|
7919
8249
|
var cousinPlain2 = (degree, sex) => {
|
|
7920
8250
|
if (degree <= 1) {
|
|
7921
|
-
return
|
|
8251
|
+
return pick5(sex, "\u5802\u8868\u5144\u5F1F", "\u5802\u8868\u59D0\u59B9", "\u5802\u8868\u4EB2");
|
|
7922
8252
|
}
|
|
7923
8253
|
if (degree === 2) {
|
|
7924
|
-
return
|
|
8254
|
+
return pick5(sex, "\u4ECE\u5802\u8868\u5144\u5F1F", "\u4ECE\u5802\u8868\u59D0\u59B9", "\u4ECE\u5802\u8868\u4EB2");
|
|
7925
8255
|
}
|
|
7926
|
-
return
|
|
8256
|
+
return pick5(
|
|
7927
8257
|
sex,
|
|
7928
8258
|
`${degree}\u4EE3\u5802\u8868\u5144\u5F1F`,
|
|
7929
8259
|
`${degree}\u4EE3\u5802\u8868\u59D0\u59B9`,
|
|
@@ -7936,7 +8266,7 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
|
|
|
7936
8266
|
if (degree > 0) {
|
|
7937
8267
|
degree = degree - 1;
|
|
7938
8268
|
}
|
|
7939
|
-
return cousinPlain2(degree,
|
|
8269
|
+
return cousinPlain2(degree, sexOf6(this.personN));
|
|
7940
8270
|
}
|
|
7941
8271
|
removal() {
|
|
7942
8272
|
const level = this.pathN?.level ?? 0;
|
|
@@ -7948,56 +8278,56 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
|
|
|
7948
8278
|
return level < 0 ? this.nibling() : this.auncle();
|
|
7949
8279
|
}
|
|
7950
8280
|
const removed = Math.abs(level);
|
|
7951
|
-
return `${cousinPlain2(degree,
|
|
8281
|
+
return `${cousinPlain2(degree, sexOf6(this.personN))}\uFF08\u9694${removed}\u4EE3\uFF09`;
|
|
7952
8282
|
}
|
|
7953
8283
|
auncle() {
|
|
7954
8284
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7955
|
-
const sex =
|
|
7956
|
-
if (level <=
|
|
7957
|
-
return
|
|
8285
|
+
const sex = sexOf6(this.personN);
|
|
8286
|
+
if (level <= 1) {
|
|
8287
|
+
return pick5(sex, "\u53D4\u53D4", "\u963F\u59E8", "\u53D4\u4F2F/\u59D1\u59E8");
|
|
7958
8288
|
}
|
|
7959
|
-
if (level ===
|
|
7960
|
-
return
|
|
8289
|
+
if (level === 2) {
|
|
8290
|
+
return pick5(sex, "\u4F2F\u53D4\u7956\u7236", "\u59D1\u7956\u6BCD", "\u4F2F\u53D4\u7956\u7236\u6BCD");
|
|
7961
8291
|
}
|
|
7962
|
-
return
|
|
8292
|
+
return pick5(
|
|
7963
8293
|
sex,
|
|
7964
|
-
`${level -
|
|
7965
|
-
`${level -
|
|
7966
|
-
`${level -
|
|
8294
|
+
`${level - 1}\u4EE3\u524D\u7684\u53D4\u53D4`,
|
|
8295
|
+
`${level - 1}\u4EE3\u524D\u7684\u963F\u59E8`,
|
|
8296
|
+
`${level - 1}\u4EE3\u524D\u7684\u53D4\u4F2F/\u59D1\u59E8`
|
|
7967
8297
|
);
|
|
7968
8298
|
}
|
|
7969
8299
|
nibling() {
|
|
7970
8300
|
const level = Math.abs(this.pathN?.level ?? 0);
|
|
7971
|
-
const sex =
|
|
7972
|
-
if (level <=
|
|
7973
|
-
return
|
|
8301
|
+
const sex = sexOf6(this.personN);
|
|
8302
|
+
if (level <= 1) {
|
|
8303
|
+
return pick5(sex, "\u4F84\u5B50", "\u4F84\u5973", "\u4F84\u5B50\u5973");
|
|
7974
8304
|
}
|
|
7975
|
-
if (level ===
|
|
7976
|
-
return
|
|
8305
|
+
if (level === 2) {
|
|
8306
|
+
return pick5(sex, "\u4F84\u5B59", "\u4F84\u5B59\u5973", "\u4F84\u5B59\u5B50\u5973");
|
|
7977
8307
|
}
|
|
7978
|
-
return
|
|
8308
|
+
return pick5(
|
|
7979
8309
|
sex,
|
|
7980
|
-
`${level -
|
|
7981
|
-
`${level -
|
|
7982
|
-
`${level -
|
|
8310
|
+
`${level - 1}\u4EE3\u4E0B\u7684\u4F84\u5B50`,
|
|
8311
|
+
`${level - 1}\u4EE3\u4E0B\u7684\u4F84\u5973`,
|
|
8312
|
+
`${level - 1}\u4EE3\u4E0B\u7684\u4F84\u5B50\u5973`
|
|
7983
8313
|
);
|
|
7984
8314
|
}
|
|
7985
8315
|
parent() {
|
|
7986
8316
|
return lineal2(
|
|
7987
8317
|
Math.abs(this.pathN?.level ?? 0),
|
|
7988
|
-
|
|
8318
|
+
sexOf6(this.personN),
|
|
7989
8319
|
"asc"
|
|
7990
8320
|
);
|
|
7991
8321
|
}
|
|
7992
8322
|
child() {
|
|
7993
8323
|
return lineal2(
|
|
7994
8324
|
Math.abs(this.pathN?.level ?? 0),
|
|
7995
|
-
|
|
8325
|
+
sexOf6(this.personN),
|
|
7996
8326
|
"desc"
|
|
7997
8327
|
);
|
|
7998
8328
|
}
|
|
7999
8329
|
sibling() {
|
|
8000
|
-
return
|
|
8330
|
+
return pick5(sexOf6(this.personN), "\u5144\u5F1F", "\u59D0\u59B9", "\u5144\u5F1F\u59D0\u59B9");
|
|
8001
8331
|
}
|
|
8002
8332
|
halfBlood(relation) {
|
|
8003
8333
|
if (!relation || !this.isHalfBlood) {
|
|
@@ -8006,14 +8336,14 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
|
|
|
8006
8336
|
return `\u5F02\u7236\u6BCD\u7684${relation}`;
|
|
8007
8337
|
}
|
|
8008
8338
|
spouse() {
|
|
8009
|
-
return
|
|
8339
|
+
return pick5(sexOf6(this.personN), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
|
|
8010
8340
|
}
|
|
8011
8341
|
ofSpouse(relation) {
|
|
8012
8342
|
if (!relation) {
|
|
8013
8343
|
return "";
|
|
8014
8344
|
}
|
|
8015
|
-
const spouseType =
|
|
8016
|
-
|
|
8345
|
+
const spouseType = pick5(
|
|
8346
|
+
sexOf6(this.path?.[1].indi),
|
|
8017
8347
|
"\u4E08\u592B",
|
|
8018
8348
|
"\u59BB\u5B50",
|
|
8019
8349
|
"\u914D\u5076"
|
|
@@ -8025,7 +8355,7 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
|
|
|
8025
8355
|
return "";
|
|
8026
8356
|
}
|
|
8027
8357
|
const spouse = this.path?.[this.path.length - 1].indi;
|
|
8028
|
-
const spouseType =
|
|
8358
|
+
const spouseType = pick5(sexOf6(spouse), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
|
|
8029
8359
|
return `${relation}\u7684${spouseType}`;
|
|
8030
8360
|
}
|
|
8031
8361
|
of(relation) {
|
|
@@ -8061,7 +8391,40 @@ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
|
|
|
8061
8391
|
if (!relation || !this.pathN?.relation) {
|
|
8062
8392
|
return relation ?? "";
|
|
8063
8393
|
}
|
|
8064
|
-
|
|
8394
|
+
if (this.pathN.relation === "step") {
|
|
8395
|
+
if (relation === "\u7236\u4EB2") {
|
|
8396
|
+
return "\u7EE7\u7236";
|
|
8397
|
+
}
|
|
8398
|
+
if (relation === "\u6BCD\u4EB2") {
|
|
8399
|
+
return "\u7EE7\u6BCD";
|
|
8400
|
+
}
|
|
8401
|
+
if (relation === "\u513F\u5B50") {
|
|
8402
|
+
return "\u7EE7\u5B50";
|
|
8403
|
+
}
|
|
8404
|
+
if (relation === "\u5973\u513F") {
|
|
8405
|
+
return "\u7EE7\u5973";
|
|
8406
|
+
}
|
|
8407
|
+
return `\u7EE7${relation}`;
|
|
8408
|
+
}
|
|
8409
|
+
if (this.pathN.relation === "adopted") {
|
|
8410
|
+
if (relation === "\u7236\u4EB2") {
|
|
8411
|
+
return "\u517B\u7236";
|
|
8412
|
+
}
|
|
8413
|
+
if (relation === "\u6BCD\u4EB2") {
|
|
8414
|
+
return "\u517B\u6BCD";
|
|
8415
|
+
}
|
|
8416
|
+
if (relation === "\u513F\u5B50") {
|
|
8417
|
+
return "\u517B\u5B50";
|
|
8418
|
+
}
|
|
8419
|
+
if (relation === "\u5973\u513F") {
|
|
8420
|
+
return "\u517B\u5973";
|
|
8421
|
+
}
|
|
8422
|
+
return `\u517B${relation}`;
|
|
8423
|
+
}
|
|
8424
|
+
if (this.pathN.relation === "foster") {
|
|
8425
|
+
return `\u5BC4\u517B${relation}`;
|
|
8426
|
+
}
|
|
8427
|
+
return relation;
|
|
8065
8428
|
}
|
|
8066
8429
|
};
|
|
8067
8430
|
|
|
@@ -8840,7 +9203,9 @@ var downloadGedzipMedia = async (media, onProgress) => {
|
|
|
8840
9203
|
id: item.id,
|
|
8841
9204
|
imgId: item.imgId,
|
|
8842
9205
|
key: "key" in item ? item.key : void 0,
|
|
8843
|
-
contentType: item.contentType
|
|
9206
|
+
contentType: item.contentType,
|
|
9207
|
+
person: "person" in item ? item.person : void 0,
|
|
9208
|
+
tree: "tree" in item ? item.tree : void 0
|
|
8844
9209
|
});
|
|
8845
9210
|
if (!resolved?.content) {
|
|
8846
9211
|
return;
|
|
@@ -9365,7 +9730,7 @@ var collectExtensionTagsFrom = (node, into = /* @__PURE__ */ new Set()) => {
|
|
|
9365
9730
|
// package.json
|
|
9366
9731
|
var package_default = {
|
|
9367
9732
|
name: "@treeviz/gedcom-parser",
|
|
9368
|
-
version: "2.1.
|
|
9733
|
+
version: "2.1.12"};
|
|
9369
9734
|
|
|
9370
9735
|
// src/utils/get-product-details.ts
|
|
9371
9736
|
var isDevelopment = () => {
|
|
@@ -9450,16 +9815,26 @@ var Obje = class extends Common {
|
|
|
9450
9815
|
if (!this._gedcom) {
|
|
9451
9816
|
return this;
|
|
9452
9817
|
}
|
|
9818
|
+
if (typeof this.value === "string" && isId(this.value) && this.refType === "OBJE") {
|
|
9819
|
+
const resolved = this.ref;
|
|
9820
|
+
if (resolved && resolved !== this && typeof resolved.standardizeMedia === "function") {
|
|
9821
|
+
resolved.standardizeMedia(
|
|
9822
|
+
namespace,
|
|
9823
|
+
override,
|
|
9824
|
+
urlGetter,
|
|
9825
|
+
gedcomVersion
|
|
9826
|
+
);
|
|
9827
|
+
return this;
|
|
9828
|
+
}
|
|
9829
|
+
}
|
|
9453
9830
|
const rin = this?.get("RIN")?.toValue();
|
|
9454
|
-
const clone = this?.get("_CLON._OID")?.toValue();
|
|
9455
|
-
const mser = this?.get("_MSER._LKID")?.toValue();
|
|
9456
9831
|
const title = this?.get("FILE.TITL")?.toValue() ?? this?.get("TITL")?.toValue() ?? "";
|
|
9457
9832
|
const note = this?.get("FILE.NOTE")?.toValue() ?? this?.get("NOTE")?.toValue() ?? "";
|
|
9458
9833
|
const formRaw = this?.get("FILE.FORM")?.toValue() ?? this?.get("FORM")?.toValue();
|
|
9459
9834
|
const mediType = this?.get("FILE.FORM.TYPE")?.toValue() ?? this?.get("FORM.TYPE")?.toValue() ?? this?.get("MEDI")?.toValue();
|
|
9460
9835
|
const file = this?.get("FILE")?.toValue();
|
|
9461
|
-
const imgId =
|
|
9462
|
-
const url = file || namespace && urlGetter?.(namespace, imgId);
|
|
9836
|
+
const imgId = resolveObjeMediaId(this);
|
|
9837
|
+
const url = file || this.isAncestry() && namespace && urlGetter?.(namespace, imgId);
|
|
9463
9838
|
if (!url) {
|
|
9464
9839
|
return this;
|
|
9465
9840
|
}
|
|
@@ -9972,6 +10347,22 @@ var GedCom = class extends Common {
|
|
|
9972
10347
|
obje(index) {
|
|
9973
10348
|
return this.getMain(this.objes(), index);
|
|
9974
10349
|
}
|
|
10350
|
+
/**
|
|
10351
|
+
* People who link a shared multimedia record (`1 OBJE @On@`), i.e. Ancestry
|
|
10352
|
+
* face tags / everyone the photo is attached to.
|
|
10353
|
+
*/
|
|
10354
|
+
indisLinkingObje(objeKey) {
|
|
10355
|
+
const people = [];
|
|
10356
|
+
this.indis()?.forEach((indi) => {
|
|
10357
|
+
const linked = indi?.get("OBJE")?.toList()?.values()?.some(
|
|
10358
|
+
(item) => item?.toValue?.() === objeKey || item?.id === objeKey
|
|
10359
|
+
);
|
|
10360
|
+
if (linked && indi) {
|
|
10361
|
+
people.push(indi);
|
|
10362
|
+
}
|
|
10363
|
+
});
|
|
10364
|
+
return people;
|
|
10365
|
+
}
|
|
9975
10366
|
sour(index) {
|
|
9976
10367
|
return this.getMain(this.sours(), index);
|
|
9977
10368
|
}
|
|
@@ -11017,4 +11408,4 @@ var hydrateFromContentAsync = async (content, options) => {
|
|
|
11017
11408
|
return hydrateFromContent(content, options);
|
|
11018
11409
|
};
|
|
11019
11410
|
|
|
11020
|
-
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, DEFAULT_GEDCOM_EXPORT_VERSION, GEDCOM7_CALENDARS, GEDCOM7_PEDI_VALUES, GEDCOM7_RESN_VALUES, GEDCOM7_ROLE_VALUES, GEDCOM7_SEX_VALUES, GEDCOM_EXPORT_VERSIONS, GEDCOM_TRAILER_TAG, GEDZIP_EXTENSION, GEDZIP_GEDCOM_ENTRY, GEDZIP_MIME, parser_default as GedcomTree, PEDIGREE_VALUES, PlaceType, STRUCTURAL_FORMAT, STRUCTURAL_VERSION, TREEVIZ_EXTENSION_BASE_URI, TREEVIZ_EXTENSION_URIS, addFamilyFact, addIndividualFact, addNonEvent, appendGedcomTrailer, applyGedcom7DatePhrases, applyGedcom7Enumerations, applyGedcom7RecordMetadata, attachChildToFamily, attachSpouseToFamily, buildGedzip, buildGedzipBlob, bytesToDataUrl, cacheDiscoveredPath, canAttachAsSpouse, collectExtensionTagsFrom, commonDateFormatter, consolidateChildIntoFamily, coupleKeyForFam, create, createEmptyGedcom, createGedcomUid, dateFormatter, deleteIndividual, downloadGedzipMedia, ensureExtensionSchema, extractGedzip, extractGedzipGedcom, extractSeparationYears, extractSplitPoints, familyHasChild, familyHasParent, findDegenerateFamiliesForIndi, findDuplicateCoupleFamiliesForIndi, findMatchingRangeForSplitRange, findReusableParentChildFamily, firstPointerId, formatGedcom7Timestamp, fromObject, fromObjectAsync, fromTuple, generateSplitRanges, getAllProp, getExtensionSchema, getFamilyWith, getFileExtension, getName, getPlaceParts, getPlaces, getRawSize, getVersion, hungarianOrdinalize, hydrateFromContent, hydrateFromContentAsync, implemented, inRange, inferMediaForm, initializeCache, isDegenerateFamily, isDevelopment, isGedcom7, isGedcomTrailerLine, isGedcomTrailerTag, isGedzipContainer, isImageFormat, isIntersectedRange, isObjePointer, isRangeContained, isRemoteOrEmbeddedMediaUrl, isStructuralEnvelope, makePointer, marriageDateFormatter, mergeDuplicateCoupleFamilies, mergeMediaLists, nameFormatter, nextRecordId, normalizeGedcomVersion, notImplemented, noteDateFormatter, ordinalize, parseGedcom7CalendarPrefix, parseRangeBounds, parseStructuralEnvelope, pathCache, placeTranslator, pointerIds, profilePictureCache, pruneEmptyFamilies, pruneFamiliesByIds, registerExtensionTag, relativesCache, remountGedzipMediaAsDataUrls, removePointerByValue, resetRelativesCache, resolveLocalMediaUrl, resolveMediaContent, resolveObjeForm, rewriteGedcomFilePaths, serializeStructural, setCauseOfDeath, setChildPedigree, setDeceased, setFamilyMarriage, setLocalMediaResolver, setMediaContentResolver, setNestedGroup, splitOverlappingRanges, splitRange, spouseTagFor, toGedcomPedigree, unlinkRelative, updateFactRecord, withGedcom7Calendar };
|
|
11411
|
+
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, ANCESTRY_MEDIA_RETRIEVAL_PREFIX, DEFAULT_GEDCOM_EXPORT_VERSION, GEDCOM7_CALENDARS, GEDCOM7_PEDI_VALUES, GEDCOM7_RESN_VALUES, GEDCOM7_ROLE_VALUES, GEDCOM7_SEX_VALUES, GEDCOM_EXPORT_VERSIONS, GEDCOM_TRAILER_TAG, GEDZIP_EXTENSION, GEDZIP_GEDCOM_ENTRY, GEDZIP_MIME, parser_default as GedcomTree, PEDIGREE_VALUES, PlaceType, STRUCTURAL_FORMAT, STRUCTURAL_VERSION, TREEVIZ_EXTENSION_BASE_URI, TREEVIZ_EXTENSION_URIS, addFamilyFact, addIndividualFact, addNonEvent, ancestryMediaFileUrl, appendGedcomTrailer, applyGedcom7DatePhrases, applyGedcom7Enumerations, applyGedcom7RecordMetadata, attachChildToFamily, attachSpouseToFamily, buildGedzip, buildGedzipBlob, bytesToDataUrl, cacheDiscoveredPath, canAttachAsSpouse, collectExtensionTagsFrom, commonDateFormatter, consolidateChildIntoFamily, coupleKeyForFam, create, createEmptyGedcom, createGedcomUid, dateFormatter, deleteIndividual, downloadGedzipMedia, ensureExtensionSchema, extractGedzip, extractGedzipGedcom, extractSeparationYears, extractSplitPoints, familyHasChild, familyHasParent, findDegenerateFamiliesForIndi, findDuplicateCoupleFamiliesForIndi, findMatchingRangeForSplitRange, findReusableParentChildFamily, firstPointerId, formatGedcom7Timestamp, fromObject, fromObjectAsync, fromTuple, generateSplitRanges, getAllProp, getExtensionSchema, getFamilyWith, getFileExtension, getName, getPlaceParts, getPlaces, getRawSize, getVersion, hungarianOrdinalize, hydrateFromContent, hydrateFromContentAsync, implemented, inRange, inferMediaForm, initializeCache, isDegenerateFamily, isDevelopment, isGedcom7, isGedcomTrailerLine, isGedcomTrailerTag, isGedzipContainer, isImageFormat, isIntersectedRange, isObjePointer, isRangeContained, isRemoteOrEmbeddedMediaUrl, isStructuralEnvelope, makePointer, marriageDateFormatter, mergeDuplicateCoupleFamilies, mergeMediaLists, nameFormatter, nextRecordId, normalizeGedcomVersion, notImplemented, noteDateFormatter, objeNoteValue, objeXrefKey, ordinalize, parseGedcom7CalendarPrefix, parseRangeBounds, parseStructuralEnvelope, pathCache, placeTranslator, pointerIds, profilePictureCache, pruneEmptyFamilies, pruneFamiliesByIds, registerExtensionTag, relativesCache, remountGedzipMediaAsDataUrls, removePointerByValue, resetRelativesCache, resolveLocalMediaUrl, resolveMediaContent, resolveObjeForm, resolveObjeMediaId, rewriteGedcomFilePaths, serializeStructural, setCauseOfDeath, setChildPedigree, setDeceased, setFamilyMarriage, setLocalMediaResolver, setMediaContentResolver, setNestedGroup, splitOverlappingRanges, splitRange, spouseTagFor, toGedcomPedigree, unlinkRelative, updateFactRecord, withGedcom7Calendar };
|