@treeviz/gedcom-parser 1.0.13 → 1.0.15
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/index.d.ts +2 -28
- package/dist/classes/index.js +6713 -21
- package/dist/classes/index.js.map +1 -0
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js +7826 -24
- package/dist/cli/index.js.map +1 -0
- package/dist/constants/index.d.ts +49 -4
- package/dist/constants/index.js +5797 -4
- package/dist/constants/index.js.map +1 -0
- package/dist/factories/index.d.ts +202 -13
- package/dist/factories/index.js +5782 -8
- package/dist/factories/index.js.map +1 -0
- package/dist/index-BvW-KWJP.d.ts +1654 -0
- package/dist/index.d.ts +9 -28
- package/dist/index.js +7380 -35
- package/dist/index.js.map +1 -0
- package/dist/interfaces/index.d.ts +2 -12
- package/dist/interfaces/index.js +3 -1
- package/dist/interfaces/index.js.map +1 -0
- package/dist/kinship-translator/index.d.ts +146 -11
- package/dist/kinship-translator/index.js +5727 -9
- package/dist/kinship-translator/index.js.map +1 -0
- package/dist/place-parser-RlXCXZ8F.d.ts +37 -0
- package/dist/structures/index.d.ts +25 -27
- package/dist/structures/index.js +3 -1
- package/dist/structures/index.js.map +1 -0
- package/dist/types/index.d.ts +69 -8
- package/dist/types/index.js +31 -6
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +91 -18
- package/dist/utils/index.js +6953 -17
- package/dist/utils/index.js.map +1 -0
- package/package.json +4 -3
- package/dist/classes/common.d.ts +0 -91
- package/dist/classes/common.d.ts.map +0 -1
- package/dist/classes/common.js +0 -488
- package/dist/classes/date.d.ts +0 -27
- package/dist/classes/date.d.ts.map +0 -1
- package/dist/classes/date.js +0 -178
- package/dist/classes/fam.d.ts +0 -19
- package/dist/classes/fam.d.ts.map +0 -1
- package/dist/classes/fam.js +0 -38
- package/dist/classes/fams.d.ts +0 -16
- package/dist/classes/fams.d.ts.map +0 -1
- package/dist/classes/fams.js +0 -41
- package/dist/classes/gedcom.d.ts +0 -139
- package/dist/classes/gedcom.d.ts.map +0 -1
- package/dist/classes/gedcom.js +0 -910
- package/dist/classes/index.d.ts.map +0 -1
- package/dist/classes/indi.d.ts +0 -323
- package/dist/classes/indi.d.ts.map +0 -1
- package/dist/classes/indi.js +0 -2131
- package/dist/classes/indis.d.ts +0 -55
- package/dist/classes/indis.d.ts.map +0 -1
- package/dist/classes/indis.js +0 -457
- package/dist/classes/list.d.ts +0 -55
- package/dist/classes/list.d.ts.map +0 -1
- package/dist/classes/list.js +0 -440
- package/dist/classes/name.d.ts +0 -20
- package/dist/classes/name.d.ts.map +0 -1
- package/dist/classes/name.js +0 -48
- package/dist/classes/note.d.ts +0 -12
- package/dist/classes/note.d.ts.map +0 -1
- package/dist/classes/note.js +0 -46
- package/dist/classes/obje.d.ts +0 -12
- package/dist/classes/obje.d.ts.map +0 -1
- package/dist/classes/obje.js +0 -81
- package/dist/classes/objes.d.ts +0 -8
- package/dist/classes/objes.d.ts.map +0 -1
- package/dist/classes/objes.js +0 -13
- package/dist/classes/repo.d.ts +0 -11
- package/dist/classes/repo.d.ts.map +0 -1
- package/dist/classes/repo.js +0 -6
- package/dist/classes/repos.d.ts +0 -8
- package/dist/classes/repos.d.ts.map +0 -1
- package/dist/classes/repos.js +0 -13
- package/dist/classes/sour.d.ts +0 -11
- package/dist/classes/sour.d.ts.map +0 -1
- package/dist/classes/sour.js +0 -6
- package/dist/classes/sours.d.ts +0 -8
- package/dist/classes/sours.d.ts.map +0 -1
- package/dist/classes/sours.js +0 -13
- package/dist/classes/subm.d.ts +0 -10
- package/dist/classes/subm.d.ts.map +0 -1
- package/dist/classes/subm.js +0 -6
- package/dist/classes/subms.d.ts +0 -8
- package/dist/classes/subms.d.ts.map +0 -1
- package/dist/classes/subms.js +0 -13
- package/dist/cli/commands/convert.d.ts +0 -3
- package/dist/cli/commands/convert.d.ts.map +0 -1
- package/dist/cli/commands/convert.js +0 -83
- package/dist/cli/commands/extract.d.ts +0 -3
- package/dist/cli/commands/extract.d.ts.map +0 -1
- package/dist/cli/commands/extract.js +0 -85
- package/dist/cli/commands/find.d.ts +0 -3
- package/dist/cli/commands/find.d.ts.map +0 -1
- package/dist/cli/commands/find.js +0 -97
- package/dist/cli/commands/info.d.ts +0 -3
- package/dist/cli/commands/info.d.ts.map +0 -1
- package/dist/cli/commands/info.js +0 -80
- package/dist/cli/commands/merge.d.ts +0 -3
- package/dist/cli/commands/merge.d.ts.map +0 -1
- package/dist/cli/commands/merge.js +0 -61
- package/dist/cli/commands/relatives.d.ts +0 -3
- package/dist/cli/commands/relatives.d.ts.map +0 -1
- package/dist/cli/commands/relatives.js +0 -107
- package/dist/cli/commands/show.d.ts +0 -3
- package/dist/cli/commands/show.d.ts.map +0 -1
- package/dist/cli/commands/show.js +0 -176
- package/dist/cli/commands/stats.d.ts +0 -3
- package/dist/cli/commands/stats.d.ts.map +0 -1
- package/dist/cli/commands/stats.js +0 -59
- package/dist/cli/commands/validate.d.ts +0 -3
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/commands/validate.js +0 -148
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/utils/formatters.d.ts +0 -69
- package/dist/cli/utils/formatters.d.ts.map +0 -1
- package/dist/cli/utils/formatters.js +0 -125
- package/dist/cli/utils/helpers.d.ts +0 -21
- package/dist/cli/utils/helpers.d.ts.map +0 -1
- package/dist/cli/utils/helpers.js +0 -58
- package/dist/constants/constants.d.ts +0 -14
- package/dist/constants/constants.d.ts.map +0 -1
- package/dist/constants/constants.js +0 -13
- package/dist/constants/filters.d.ts +0 -18
- package/dist/constants/filters.d.ts.map +0 -1
- package/dist/constants/filters.js +0 -44
- package/dist/constants/index.d.ts.map +0 -1
- package/dist/constants/orders.d.ts +0 -17
- package/dist/constants/orders.d.ts.map +0 -1
- package/dist/constants/orders.js +0 -240
- package/dist/factories/cache-factory.d.ts +0 -30
- package/dist/factories/cache-factory.d.ts.map +0 -1
- package/dist/factories/cache-factory.js +0 -43
- package/dist/factories/date-locale-factory.d.ts +0 -30
- package/dist/factories/date-locale-factory.d.ts.map +0 -1
- package/dist/factories/date-locale-factory.js +0 -34
- package/dist/factories/i18n-factory.d.ts +0 -40
- package/dist/factories/i18n-factory.d.ts.map +0 -1
- package/dist/factories/i18n-factory.js +0 -44
- package/dist/factories/index.d.ts.map +0 -1
- package/dist/factories/kinship-factory.d.ts +0 -38
- package/dist/factories/kinship-factory.d.ts.map +0 -1
- package/dist/factories/kinship-factory.js +0 -35
- package/dist/factories/place-parser-provider.d.ts +0 -32
- package/dist/factories/place-parser-provider.d.ts.map +0 -1
- package/dist/factories/place-parser-provider.js +0 -35
- package/dist/factories/place-translator-provider.d.ts +0 -32
- package/dist/factories/place-translator-provider.d.ts.map +0 -1
- package/dist/factories/place-translator-provider.js +0 -35
- package/dist/index.d.ts.map +0 -1
- package/dist/interfaces/common.d.ts +0 -43
- package/dist/interfaces/common.d.ts.map +0 -1
- package/dist/interfaces/common.js +0 -1
- package/dist/interfaces/fam.d.ts +0 -11
- package/dist/interfaces/fam.d.ts.map +0 -1
- package/dist/interfaces/fam.js +0 -1
- package/dist/interfaces/fams.d.ts +0 -9
- package/dist/interfaces/fams.d.ts.map +0 -1
- package/dist/interfaces/fams.js +0 -1
- package/dist/interfaces/gedcom.d.ts +0 -30
- package/dist/interfaces/gedcom.d.ts.map +0 -1
- package/dist/interfaces/gedcom.js +0 -1
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/indi.d.ts +0 -113
- package/dist/interfaces/indi.d.ts.map +0 -1
- package/dist/interfaces/indi.js +0 -1
- package/dist/interfaces/indis.d.ts +0 -31
- package/dist/interfaces/indis.d.ts.map +0 -1
- package/dist/interfaces/indis.js +0 -1
- package/dist/interfaces/list.d.ts +0 -52
- package/dist/interfaces/list.d.ts.map +0 -1
- package/dist/interfaces/list.js +0 -1
- package/dist/interfaces/obje.d.ts +0 -7
- package/dist/interfaces/obje.d.ts.map +0 -1
- package/dist/interfaces/obje.js +0 -1
- package/dist/interfaces/repo.d.ts +0 -7
- package/dist/interfaces/repo.d.ts.map +0 -1
- package/dist/interfaces/repo.js +0 -1
- package/dist/interfaces/sour.d.ts +0 -7
- package/dist/interfaces/sour.d.ts.map +0 -1
- package/dist/interfaces/sour.js +0 -1
- package/dist/interfaces/subm.d.ts +0 -6
- package/dist/interfaces/subm.d.ts.map +0 -1
- package/dist/interfaces/subm.js +0 -1
- package/dist/kinship-translator/index.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.basic.d.ts +0 -30
- package/dist/kinship-translator/kinship-translator.basic.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.basic.js +0 -74
- package/dist/kinship-translator/kinship-translator.d.ts +0 -26
- package/dist/kinship-translator/kinship-translator.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.de.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.de.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.de.js +0 -180
- package/dist/kinship-translator/kinship-translator.en.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.en.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.en.js +0 -182
- package/dist/kinship-translator/kinship-translator.es.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.es.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.es.js +0 -181
- package/dist/kinship-translator/kinship-translator.fr.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.fr.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.fr.js +0 -181
- package/dist/kinship-translator/kinship-translator.hu.d.ts +0 -19
- package/dist/kinship-translator/kinship-translator.hu.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.hu.js +0 -226
- package/dist/kinship-translator/kinship-translator.interface.d.ts +0 -19
- package/dist/kinship-translator/kinship-translator.interface.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.interface.js +0 -1
- package/dist/kinship-translator/kinship-translator.js +0 -103
- package/dist/kinship-translator/patterns.de.d.ts +0 -2
- package/dist/kinship-translator/patterns.de.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.de.js +0 -14
- package/dist/kinship-translator/patterns.en.d.ts +0 -2
- package/dist/kinship-translator/patterns.en.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.en.js +0 -14
- package/dist/kinship-translator/patterns.es.d.ts +0 -2
- package/dist/kinship-translator/patterns.es.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.es.js +0 -14
- package/dist/kinship-translator/patterns.fr.d.ts +0 -2
- package/dist/kinship-translator/patterns.fr.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.fr.js +0 -14
- package/dist/kinship-translator/patterns.hu.d.ts +0 -6
- package/dist/kinship-translator/patterns.hu.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.hu.js +0 -97
- package/dist/kinship-translator/translators.d.ts +0 -6
- package/dist/kinship-translator/translators.d.ts.map +0 -1
- package/dist/kinship-translator/translators.js +0 -5
- package/dist/kinship-translator/types.d.ts +0 -9
- package/dist/kinship-translator/types.d.ts.map +0 -1
- package/dist/kinship-translator/types.js +0 -1
- package/dist/structures/address.d.ts +0 -14
- package/dist/structures/address.d.ts.map +0 -1
- package/dist/structures/address.js +0 -1
- package/dist/structures/association.d.ts +0 -13
- package/dist/structures/association.d.ts.map +0 -1
- package/dist/structures/association.js +0 -1
- package/dist/structures/change-date.d.ts +0 -8
- package/dist/structures/change-date.d.ts.map +0 -1
- package/dist/structures/change-date.js +0 -1
- package/dist/structures/creation-date.d.ts +0 -7
- package/dist/structures/creation-date.d.ts.map +0 -1
- package/dist/structures/creation-date.js +0 -1
- package/dist/structures/date.d.ts +0 -9
- package/dist/structures/date.d.ts.map +0 -1
- package/dist/structures/date.js +0 -1
- package/dist/structures/event-detail-structure.d.ts +0 -25
- package/dist/structures/event-detail-structure.d.ts.map +0 -1
- package/dist/structures/event-detail-structure.js +0 -1
- package/dist/structures/family.d.ts +0 -34
- package/dist/structures/family.d.ts.map +0 -1
- package/dist/structures/family.js +0 -1
- package/dist/structures/gedcom.d.ts +0 -59
- package/dist/structures/gedcom.d.ts.map +0 -1
- package/dist/structures/gedcom.js +0 -1
- package/dist/structures/index.d.ts.map +0 -1
- package/dist/structures/individual-event-detail-structure.d.ts +0 -9
- package/dist/structures/individual-event-detail-structure.d.ts.map +0 -1
- package/dist/structures/individual-event-detail-structure.js +0 -1
- package/dist/structures/individual-event-structure.d.ts +0 -83
- package/dist/structures/individual-event-structure.d.ts.map +0 -1
- package/dist/structures/individual-event-structure.js +0 -1
- package/dist/structures/individual.d.ts +0 -40
- package/dist/structures/individual.d.ts.map +0 -1
- package/dist/structures/individual.js +0 -1
- package/dist/structures/lds-ordinance-detail.d.ts +0 -17
- package/dist/structures/lds-ordinance-detail.d.ts.map +0 -1
- package/dist/structures/lds-ordinance-detail.js +0 -1
- package/dist/structures/lds-spouse-sealing.d.ts +0 -7
- package/dist/structures/lds-spouse-sealing.d.ts.map +0 -1
- package/dist/structures/lds-spouse-sealing.js +0 -1
- package/dist/structures/marriage-date.d.ts +0 -11
- package/dist/structures/marriage-date.d.ts.map +0 -1
- package/dist/structures/marriage-date.js +0 -1
- package/dist/structures/multimedia-link.d.ts +0 -16
- package/dist/structures/multimedia-link.d.ts.map +0 -1
- package/dist/structures/multimedia-link.js +0 -1
- package/dist/structures/non-event.d.ts +0 -12
- package/dist/structures/non-event.d.ts.map +0 -1
- package/dist/structures/non-event.js +0 -1
- package/dist/structures/note.d.ts +0 -16
- package/dist/structures/note.d.ts.map +0 -1
- package/dist/structures/note.js +0 -1
- package/dist/structures/personal-name-pieces.d.ts +0 -11
- package/dist/structures/personal-name-pieces.d.ts.map +0 -1
- package/dist/structures/personal-name-pieces.js +0 -1
- package/dist/structures/personal-name.d.ts +0 -16
- package/dist/structures/personal-name.d.ts.map +0 -1
- package/dist/structures/personal-name.js +0 -1
- package/dist/structures/place.d.ts +0 -20
- package/dist/structures/place.d.ts.map +0 -1
- package/dist/structures/place.js +0 -1
- package/dist/structures/repository.d.ts +0 -6
- package/dist/structures/repository.d.ts.map +0 -1
- package/dist/structures/repository.js +0 -1
- package/dist/structures/source-citation.d.ts +0 -27
- package/dist/structures/source-citation.d.ts.map +0 -1
- package/dist/structures/source-citation.js +0 -1
- package/dist/structures/source-repository-citation.d.ts +0 -13
- package/dist/structures/source-repository-citation.d.ts.map +0 -1
- package/dist/structures/source-repository-citation.js +0 -1
- package/dist/structures/source.d.ts +0 -28
- package/dist/structures/source.d.ts.map +0 -1
- package/dist/structures/source.js +0 -1
- package/dist/types/ancestry-media.d.ts +0 -65
- package/dist/types/ancestry-media.d.ts.map +0 -1
- package/dist/types/ancestry-media.js +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/settings.d.ts +0 -12
- package/dist/types/settings.d.ts.map +0 -1
- package/dist/types/settings.js +0 -1
- package/dist/types/types.d.ts +0 -225
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/types.js +0 -26
- package/dist/utils/cache.d.ts +0 -22
- package/dist/utils/cache.d.ts.map +0 -1
- package/dist/utils/cache.js +0 -57
- package/dist/utils/common-creator.d.ts +0 -13
- package/dist/utils/common-creator.d.ts.map +0 -1
- package/dist/utils/common-creator.js +0 -72
- package/dist/utils/date-formatter.d.ts +0 -35
- package/dist/utils/date-formatter.d.ts.map +0 -1
- package/dist/utils/date-formatter.js +0 -207
- package/dist/utils/get-all-prop.d.ts +0 -4
- package/dist/utils/get-all-prop.d.ts.map +0 -1
- package/dist/utils/get-all-prop.js +0 -5
- package/dist/utils/get-family-with.d.ts +0 -5
- package/dist/utils/get-family-with.d.ts.map +0 -1
- package/dist/utils/get-family-with.js +0 -11
- package/dist/utils/get-places.d.ts +0 -21
- package/dist/utils/get-places.d.ts.map +0 -1
- package/dist/utils/get-places.js +0 -77
- package/dist/utils/get-product-details.d.ts +0 -4
- package/dist/utils/get-product-details.d.ts.map +0 -1
- package/dist/utils/get-product-details.js +0 -6
- package/dist/utils/get-raw-size.d.ts +0 -2
- package/dist/utils/get-raw-size.d.ts.map +0 -1
- package/dist/utils/get-raw-size.js +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/logger.d.ts +0 -3
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -11
- package/dist/utils/name-formatter.d.ts +0 -10
- package/dist/utils/name-formatter.d.ts.map +0 -1
- package/dist/utils/name-formatter.js +0 -45
- package/dist/utils/nested-group.d.ts +0 -4
- package/dist/utils/nested-group.d.ts.map +0 -1
- package/dist/utils/nested-group.js +0 -34
- package/dist/utils/ordinalize.d.ts +0 -3
- package/dist/utils/ordinalize.d.ts.map +0 -1
- package/dist/utils/ordinalize.js +0 -104
- package/dist/utils/parser.d.ts +0 -17
- package/dist/utils/parser.d.ts.map +0 -1
- package/dist/utils/parser.js +0 -321
- package/dist/utils/place-parser.d.ts +0 -16
- package/dist/utils/place-parser.d.ts.map +0 -1
- package/dist/utils/place-parser.js +0 -46
- package/dist/utils/place-translator.d.ts +0 -6
- package/dist/utils/place-translator.d.ts.map +0 -1
- package/dist/utils/place-translator.js +0 -8
- package/dist/utils/place-types.d.ts +0 -27
- package/dist/utils/place-types.d.ts.map +0 -1
- package/dist/utils/place-types.js +0 -14
- package/dist/utils/range.d.ts +0 -19
- package/dist/utils/range.d.ts.map +0 -1
- package/dist/utils/range.js +0 -265
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { nameFormatter } from "../utils/name-formatter.js";
|
|
2
|
-
import { ordinalize } from "../utils/ordinalize.js";
|
|
3
|
-
import KinshipTranslatorBasic from "./kinship-translator.basic.js";
|
|
4
|
-
import { InLawsEn } from "./patterns.en.js";
|
|
5
|
-
export default class KinshipTranslatorEn extends KinshipTranslatorBasic {
|
|
6
|
-
directPrefix() {
|
|
7
|
-
const level = Math.abs(this.pathN?.level ?? 0);
|
|
8
|
-
if (level <= 1) {
|
|
9
|
-
return "";
|
|
10
|
-
}
|
|
11
|
-
if (level === 2) {
|
|
12
|
-
return "grand";
|
|
13
|
-
}
|
|
14
|
-
if (level === 3) {
|
|
15
|
-
return "great-grand";
|
|
16
|
-
}
|
|
17
|
-
return `${ordinalize(level - 2)} great-grand`;
|
|
18
|
-
}
|
|
19
|
-
indirect() {
|
|
20
|
-
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
21
|
-
if (degree > 0) {
|
|
22
|
-
degree = degree - 1;
|
|
23
|
-
}
|
|
24
|
-
if (degree === 1) {
|
|
25
|
-
return `cousin`;
|
|
26
|
-
}
|
|
27
|
-
return `${ordinalize(degree)} cousin`;
|
|
28
|
-
}
|
|
29
|
-
removal() {
|
|
30
|
-
const level = this.pathN?.level ?? 0;
|
|
31
|
-
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
32
|
-
if (degree > 0) {
|
|
33
|
-
degree = degree - 1;
|
|
34
|
-
}
|
|
35
|
-
if (!degree) {
|
|
36
|
-
return level < 0 ? this.nibling() : this.auncle();
|
|
37
|
-
}
|
|
38
|
-
return `${ordinalize(degree)} cousin ${level}x removed`;
|
|
39
|
-
}
|
|
40
|
-
auncle() {
|
|
41
|
-
const prefix = this.directPrefix();
|
|
42
|
-
if (this.personN?.isMale()) {
|
|
43
|
-
return `${prefix}uncle`;
|
|
44
|
-
}
|
|
45
|
-
if (this.personN?.isFemale()) {
|
|
46
|
-
return `${prefix}aunt`;
|
|
47
|
-
}
|
|
48
|
-
return `${prefix}auncle`;
|
|
49
|
-
}
|
|
50
|
-
nibling() {
|
|
51
|
-
const prefix = this.directPrefix();
|
|
52
|
-
if (this.personN?.isMale()) {
|
|
53
|
-
return `${prefix}nephew`;
|
|
54
|
-
}
|
|
55
|
-
if (this.personN?.isFemale()) {
|
|
56
|
-
return `${prefix}niece`;
|
|
57
|
-
}
|
|
58
|
-
return `${prefix}nibling`;
|
|
59
|
-
}
|
|
60
|
-
parent() {
|
|
61
|
-
const prefix = this.directPrefix();
|
|
62
|
-
if (this.personN?.isMale()) {
|
|
63
|
-
return `${prefix}father`;
|
|
64
|
-
}
|
|
65
|
-
if (this.personN?.isFemale()) {
|
|
66
|
-
return `${prefix}mother`;
|
|
67
|
-
}
|
|
68
|
-
return `${prefix}parent`;
|
|
69
|
-
}
|
|
70
|
-
child() {
|
|
71
|
-
const prefix = this.directPrefix();
|
|
72
|
-
if (this.personN?.isMale()) {
|
|
73
|
-
return `${prefix}son`;
|
|
74
|
-
}
|
|
75
|
-
if (this.personN?.isFemale()) {
|
|
76
|
-
return `${prefix}daughter`;
|
|
77
|
-
}
|
|
78
|
-
return `${prefix}child`;
|
|
79
|
-
}
|
|
80
|
-
sibling() {
|
|
81
|
-
const parents1 = this.person1?.getBiologicalParents();
|
|
82
|
-
const parentsN = this.personN?.getBiologicalParents();
|
|
83
|
-
const inter = parents1?.intersection(parentsN);
|
|
84
|
-
// TODO if both has one parent in tree, this returns with an invalid/unsure half-blood state
|
|
85
|
-
let prefix = "";
|
|
86
|
-
if (!inter || inter.length < 2) {
|
|
87
|
-
prefix = "half-";
|
|
88
|
-
}
|
|
89
|
-
if (this.personN?.isMale()) {
|
|
90
|
-
return `${prefix}brother`;
|
|
91
|
-
}
|
|
92
|
-
if (this.personN?.isFemale()) {
|
|
93
|
-
return `${prefix}sister`;
|
|
94
|
-
}
|
|
95
|
-
return `${prefix}sibling`;
|
|
96
|
-
}
|
|
97
|
-
spouse() {
|
|
98
|
-
if (this.personN?.isMale()) {
|
|
99
|
-
return "husband";
|
|
100
|
-
}
|
|
101
|
-
if (this.personN?.isFemale()) {
|
|
102
|
-
return "wife";
|
|
103
|
-
}
|
|
104
|
-
return "spouse";
|
|
105
|
-
}
|
|
106
|
-
ofSpouse(relation) {
|
|
107
|
-
if (!relation) {
|
|
108
|
-
return "";
|
|
109
|
-
}
|
|
110
|
-
const spouse = this.path?.[1].indi;
|
|
111
|
-
let spouseType = "spouse";
|
|
112
|
-
if (spouse?.isMale()) {
|
|
113
|
-
spouseType = "husband";
|
|
114
|
-
}
|
|
115
|
-
if (spouse?.isFemale()) {
|
|
116
|
-
spouseType = "wife";
|
|
117
|
-
}
|
|
118
|
-
return `${relation} of ${spouseType}`;
|
|
119
|
-
}
|
|
120
|
-
spouseOf(relation) {
|
|
121
|
-
if (!relation) {
|
|
122
|
-
return "";
|
|
123
|
-
}
|
|
124
|
-
const spouse = this.path?.[this.path.length - 1].indi;
|
|
125
|
-
let spouseType = "spouse";
|
|
126
|
-
if (spouse?.isMale()) {
|
|
127
|
-
spouseType = "husband";
|
|
128
|
-
}
|
|
129
|
-
if (spouse?.isFemale()) {
|
|
130
|
-
spouseType = "wife";
|
|
131
|
-
}
|
|
132
|
-
return `${spouseType} of ${relation}`;
|
|
133
|
-
}
|
|
134
|
-
of(relation) {
|
|
135
|
-
const formattedName = nameFormatter(this.path?.[0]?.indi, {
|
|
136
|
-
nameOrder: "first-last",
|
|
137
|
-
});
|
|
138
|
-
let name = formattedName.inOrder.filter(Boolean).join(" ");
|
|
139
|
-
if (this.displayName === "none") {
|
|
140
|
-
name = "";
|
|
141
|
-
}
|
|
142
|
-
else if (this.displayName === "givenname") {
|
|
143
|
-
name = formattedName.givenname;
|
|
144
|
-
}
|
|
145
|
-
else if (this.displayName === "surname") {
|
|
146
|
-
name = `${formattedName.surname}`;
|
|
147
|
-
}
|
|
148
|
-
if (!name || !relation) {
|
|
149
|
-
return relation ?? "";
|
|
150
|
-
}
|
|
151
|
-
if (relation.includes(" of ")) {
|
|
152
|
-
return relation.replace(" of ", ` of ${name}'s `);
|
|
153
|
-
}
|
|
154
|
-
return `${name}'s ${relation}`;
|
|
155
|
-
}
|
|
156
|
-
inLaw(relation) {
|
|
157
|
-
let inLawRelation = relation;
|
|
158
|
-
Object.keys(InLawsEn).find((pattern) => {
|
|
159
|
-
const regex = new RegExp(`(?<space> )(?<word1>${pattern})$|^(?<word2>${pattern})$`);
|
|
160
|
-
if (relation?.match(regex)) {
|
|
161
|
-
inLawRelation = relation?.replace(regex, (m, ...rest) => {
|
|
162
|
-
const groups = rest[rest.length - 1];
|
|
163
|
-
const word = groups?.word1 || groups?.word2;
|
|
164
|
-
if (!word) {
|
|
165
|
-
return m;
|
|
166
|
-
}
|
|
167
|
-
const toReplace = InLawsEn[word.trim()] || InLawsEn[pattern];
|
|
168
|
-
return toReplace ? `${groups.space || ""}${toReplace}` : m;
|
|
169
|
-
});
|
|
170
|
-
return true;
|
|
171
|
-
}
|
|
172
|
-
return false;
|
|
173
|
-
});
|
|
174
|
-
return inLawRelation ?? "";
|
|
175
|
-
}
|
|
176
|
-
relationType(relation) {
|
|
177
|
-
if (!relation || !this.pathN?.relation) {
|
|
178
|
-
return relation ?? "";
|
|
179
|
-
}
|
|
180
|
-
return `${this.pathN.relation} ${relation}`;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import KinshipTranslatorBasic from "./kinship-translator.basic";
|
|
2
|
-
export default class KinshipTranslatorEs extends KinshipTranslatorBasic {
|
|
3
|
-
private directPrefix;
|
|
4
|
-
indirect(): string;
|
|
5
|
-
removal(): string;
|
|
6
|
-
auncle(): string;
|
|
7
|
-
nibling(): string;
|
|
8
|
-
parent(): string;
|
|
9
|
-
child(): string;
|
|
10
|
-
sibling(): string;
|
|
11
|
-
spouse(): "esposo" | "esposa" | "cónyuge";
|
|
12
|
-
ofSpouse(relation?: string | undefined): string;
|
|
13
|
-
spouseOf(relation?: string | undefined): string;
|
|
14
|
-
of(relation?: string | undefined): string;
|
|
15
|
-
inLaw(relation?: string | undefined): string;
|
|
16
|
-
relationType(relation?: string | undefined): string;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=kinship-translator.es.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kinship-translator.es.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.es.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAGhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,OAAO,CAAC,YAAY;IAiBpB,QAAQ;IAaR,OAAO;IAcP,MAAM;IAcN,OAAO;IAcP,MAAM;IAcN,KAAK;IAcL,OAAO;IAsBP,MAAM;IAYN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IA0BhC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAiCnC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAO1C"}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { nameFormatter } from "../utils/name-formatter.js";
|
|
2
|
-
import { ordinalize } from "../utils/ordinalize.js";
|
|
3
|
-
import KinshipTranslatorBasic from "./kinship-translator.basic.js";
|
|
4
|
-
import { InLawsEs } from "./patterns.es.js";
|
|
5
|
-
export default class KinshipTranslatorEs extends KinshipTranslatorBasic {
|
|
6
|
-
directPrefix() {
|
|
7
|
-
const level = Math.abs(this.pathN?.level ?? 0);
|
|
8
|
-
if (level <= 1) {
|
|
9
|
-
return "";
|
|
10
|
-
}
|
|
11
|
-
if (level === 2) {
|
|
12
|
-
return "bisabuel";
|
|
13
|
-
}
|
|
14
|
-
if (level === 3) {
|
|
15
|
-
return "tatarabuel";
|
|
16
|
-
}
|
|
17
|
-
return `tátara${level - 2}-abuel`;
|
|
18
|
-
}
|
|
19
|
-
indirect() {
|
|
20
|
-
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
21
|
-
if (degree > 0) {
|
|
22
|
-
degree = degree - 1;
|
|
23
|
-
}
|
|
24
|
-
if (degree === 1) {
|
|
25
|
-
return `primo`;
|
|
26
|
-
}
|
|
27
|
-
return `primo ${ordinalize(degree)}`;
|
|
28
|
-
}
|
|
29
|
-
removal() {
|
|
30
|
-
const level = this.pathN?.level ?? 0;
|
|
31
|
-
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
32
|
-
if (degree > 0) {
|
|
33
|
-
degree = degree - 1;
|
|
34
|
-
}
|
|
35
|
-
if (!degree) {
|
|
36
|
-
return level < 0 ? this.nibling() : this.auncle();
|
|
37
|
-
}
|
|
38
|
-
return `primo ${ordinalize(degree)} ${Math.abs(level)}× separado`;
|
|
39
|
-
}
|
|
40
|
-
auncle() {
|
|
41
|
-
const prefix = this.directPrefix();
|
|
42
|
-
if (this.personN?.isMale()) {
|
|
43
|
-
return `${prefix}tío`;
|
|
44
|
-
}
|
|
45
|
-
if (this.personN?.isFemale()) {
|
|
46
|
-
return `${prefix}tía`;
|
|
47
|
-
}
|
|
48
|
-
return `${prefix}tío/tía`;
|
|
49
|
-
}
|
|
50
|
-
nibling() {
|
|
51
|
-
const prefix = this.directPrefix();
|
|
52
|
-
if (this.personN?.isMale()) {
|
|
53
|
-
return `${prefix}sobrino`;
|
|
54
|
-
}
|
|
55
|
-
if (this.personN?.isFemale()) {
|
|
56
|
-
return `${prefix}sobrina`;
|
|
57
|
-
}
|
|
58
|
-
return `${prefix}sobrino/sobrina`;
|
|
59
|
-
}
|
|
60
|
-
parent() {
|
|
61
|
-
const prefix = this.directPrefix();
|
|
62
|
-
if (this.personN?.isMale()) {
|
|
63
|
-
return `${prefix}padre`;
|
|
64
|
-
}
|
|
65
|
-
if (this.personN?.isFemale()) {
|
|
66
|
-
return `${prefix}madre`;
|
|
67
|
-
}
|
|
68
|
-
return `${prefix}padre/madre`;
|
|
69
|
-
}
|
|
70
|
-
child() {
|
|
71
|
-
const prefix = this.directPrefix();
|
|
72
|
-
if (this.personN?.isMale()) {
|
|
73
|
-
return `${prefix}hijo`;
|
|
74
|
-
}
|
|
75
|
-
if (this.personN?.isFemale()) {
|
|
76
|
-
return `${prefix}hija`;
|
|
77
|
-
}
|
|
78
|
-
return `${prefix}hijo/hija`;
|
|
79
|
-
}
|
|
80
|
-
sibling() {
|
|
81
|
-
const parents1 = this.person1?.getBiologicalParents();
|
|
82
|
-
const parentsN = this.personN?.getBiologicalParents();
|
|
83
|
-
const inter = parents1?.intersection(parentsN);
|
|
84
|
-
let prefix = "";
|
|
85
|
-
if (!inter || inter.length < 2) {
|
|
86
|
-
prefix = "medio ";
|
|
87
|
-
}
|
|
88
|
-
if (this.personN?.isMale()) {
|
|
89
|
-
return `${prefix}hermano`;
|
|
90
|
-
}
|
|
91
|
-
if (this.personN?.isFemale()) {
|
|
92
|
-
return `${prefix}hermana`;
|
|
93
|
-
}
|
|
94
|
-
return `${prefix}hermano/hermana`;
|
|
95
|
-
}
|
|
96
|
-
spouse() {
|
|
97
|
-
if (this.personN?.isMale()) {
|
|
98
|
-
return "esposo";
|
|
99
|
-
}
|
|
100
|
-
if (this.personN?.isFemale()) {
|
|
101
|
-
return "esposa";
|
|
102
|
-
}
|
|
103
|
-
return "cónyuge";
|
|
104
|
-
}
|
|
105
|
-
ofSpouse(relation) {
|
|
106
|
-
if (!relation) {
|
|
107
|
-
return "";
|
|
108
|
-
}
|
|
109
|
-
const spouse = this.path?.[1].indi;
|
|
110
|
-
let spouseType = "cónyuge";
|
|
111
|
-
if (spouse?.isMale()) {
|
|
112
|
-
spouseType = "esposo";
|
|
113
|
-
}
|
|
114
|
-
if (spouse?.isFemale()) {
|
|
115
|
-
spouseType = "esposa";
|
|
116
|
-
}
|
|
117
|
-
return `${relation} del ${spouseType}`;
|
|
118
|
-
}
|
|
119
|
-
spouseOf(relation) {
|
|
120
|
-
if (!relation) {
|
|
121
|
-
return "";
|
|
122
|
-
}
|
|
123
|
-
const spouse = this.path?.[this.path.length - 1].indi;
|
|
124
|
-
let spouseType = "cónyuge";
|
|
125
|
-
if (spouse?.isMale()) {
|
|
126
|
-
spouseType = "esposo";
|
|
127
|
-
}
|
|
128
|
-
if (spouse?.isFemale()) {
|
|
129
|
-
spouseType = "esposa";
|
|
130
|
-
}
|
|
131
|
-
return `${spouseType} de ${relation}`;
|
|
132
|
-
}
|
|
133
|
-
of(relation) {
|
|
134
|
-
const formattedName = nameFormatter(this.path?.[0]?.indi, {
|
|
135
|
-
nameOrder: "first-last",
|
|
136
|
-
});
|
|
137
|
-
let name = formattedName.inOrder.filter(Boolean).join(" ");
|
|
138
|
-
if (this.displayName === "none") {
|
|
139
|
-
name = "";
|
|
140
|
-
}
|
|
141
|
-
else if (this.displayName === "givenname") {
|
|
142
|
-
name = formattedName.givenname;
|
|
143
|
-
}
|
|
144
|
-
else if (this.displayName === "surname") {
|
|
145
|
-
name = `${formattedName.surname}`;
|
|
146
|
-
}
|
|
147
|
-
if (!name || !relation) {
|
|
148
|
-
return relation ?? "";
|
|
149
|
-
}
|
|
150
|
-
if (relation.includes(" del ") || relation.includes(" de ")) {
|
|
151
|
-
return relation.replace(/ (del|de) /, ` $1 ${name} `);
|
|
152
|
-
}
|
|
153
|
-
return `${relation} de ${name}`;
|
|
154
|
-
}
|
|
155
|
-
inLaw(relation) {
|
|
156
|
-
let inLawRelation = relation;
|
|
157
|
-
Object.keys(InLawsEs).find((pattern) => {
|
|
158
|
-
const regex = new RegExp(`(?<space> )(?<word1>${pattern})$|^(?<word2>${pattern})$`);
|
|
159
|
-
if (relation?.match(regex)) {
|
|
160
|
-
inLawRelation = relation?.replace(regex, (m, ...rest) => {
|
|
161
|
-
const groups = rest[rest.length - 1];
|
|
162
|
-
const word = groups?.word1 || groups?.word2;
|
|
163
|
-
if (!word) {
|
|
164
|
-
return m;
|
|
165
|
-
}
|
|
166
|
-
const toReplace = InLawsEs[word.trim()] || InLawsEs[pattern];
|
|
167
|
-
return toReplace ? `${groups.space || ""}${toReplace}` : m;
|
|
168
|
-
});
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
return false;
|
|
172
|
-
});
|
|
173
|
-
return inLawRelation ?? "";
|
|
174
|
-
}
|
|
175
|
-
relationType(relation) {
|
|
176
|
-
if (!relation || !this.pathN?.relation) {
|
|
177
|
-
return relation ?? "";
|
|
178
|
-
}
|
|
179
|
-
return `${this.pathN.relation} ${relation}`;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import KinshipTranslatorBasic from "./kinship-translator.basic";
|
|
2
|
-
export default class KinshipTranslatorFr extends KinshipTranslatorBasic {
|
|
3
|
-
private directPrefix;
|
|
4
|
-
indirect(): string;
|
|
5
|
-
removal(): string;
|
|
6
|
-
auncle(): string;
|
|
7
|
-
nibling(): string;
|
|
8
|
-
parent(): string;
|
|
9
|
-
child(): string;
|
|
10
|
-
sibling(): string;
|
|
11
|
-
spouse(): "mari" | "épouse" | "conjoint";
|
|
12
|
-
ofSpouse(relation?: string | undefined): string;
|
|
13
|
-
spouseOf(relation?: string | undefined): string;
|
|
14
|
-
of(relation?: string | undefined): string;
|
|
15
|
-
inLaw(relation?: string | undefined): string;
|
|
16
|
-
relationType(relation?: string | undefined): string;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=kinship-translator.fr.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kinship-translator.fr.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.fr.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAGhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,OAAO,CAAC,YAAY;IAiBpB,QAAQ;IAaR,OAAO;IAcP,MAAM;IAcN,OAAO;IAcP,MAAM;IAcN,KAAK;IAcL,OAAO;IAsBP,MAAM;IAYN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IA0BhC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAiCnC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAO1C"}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { nameFormatter } from "../utils/name-formatter.js";
|
|
2
|
-
import { ordinalize } from "../utils/ordinalize.js";
|
|
3
|
-
import KinshipTranslatorBasic from "./kinship-translator.basic.js";
|
|
4
|
-
import { InLawsFr } from "./patterns.fr.js";
|
|
5
|
-
export default class KinshipTranslatorFr extends KinshipTranslatorBasic {
|
|
6
|
-
directPrefix() {
|
|
7
|
-
const level = Math.abs(this.pathN?.level ?? 0);
|
|
8
|
-
if (level <= 1) {
|
|
9
|
-
return "";
|
|
10
|
-
}
|
|
11
|
-
if (level === 2) {
|
|
12
|
-
return "grand-";
|
|
13
|
-
}
|
|
14
|
-
if (level === 3) {
|
|
15
|
-
return "arrière-grand-";
|
|
16
|
-
}
|
|
17
|
-
return `arrière${level - 2}-grand-`;
|
|
18
|
-
}
|
|
19
|
-
indirect() {
|
|
20
|
-
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
21
|
-
if (degree > 0) {
|
|
22
|
-
degree = degree - 1;
|
|
23
|
-
}
|
|
24
|
-
if (degree === 1) {
|
|
25
|
-
return `cousin`;
|
|
26
|
-
}
|
|
27
|
-
return `cousin au ${ordinalize(degree)} degré`;
|
|
28
|
-
}
|
|
29
|
-
removal() {
|
|
30
|
-
const level = this.pathN?.level ?? 0;
|
|
31
|
-
let degree = Math.abs(this.pathN?.degree ?? 0);
|
|
32
|
-
if (degree > 0) {
|
|
33
|
-
degree = degree - 1;
|
|
34
|
-
}
|
|
35
|
-
if (!degree) {
|
|
36
|
-
return level < 0 ? this.nibling() : this.auncle();
|
|
37
|
-
}
|
|
38
|
-
return `cousin au ${ordinalize(degree)} degré ${Math.abs(level)}× éloigné`;
|
|
39
|
-
}
|
|
40
|
-
auncle() {
|
|
41
|
-
const prefix = this.directPrefix();
|
|
42
|
-
if (this.personN?.isMale()) {
|
|
43
|
-
return `${prefix}oncle`;
|
|
44
|
-
}
|
|
45
|
-
if (this.personN?.isFemale()) {
|
|
46
|
-
return `${prefix}tante`;
|
|
47
|
-
}
|
|
48
|
-
return `${prefix}oncle/tante`;
|
|
49
|
-
}
|
|
50
|
-
nibling() {
|
|
51
|
-
const prefix = this.directPrefix();
|
|
52
|
-
if (this.personN?.isMale()) {
|
|
53
|
-
return `${prefix}neveu`;
|
|
54
|
-
}
|
|
55
|
-
if (this.personN?.isFemale()) {
|
|
56
|
-
return `${prefix}nièce`;
|
|
57
|
-
}
|
|
58
|
-
return `${prefix}neveu/nièce`;
|
|
59
|
-
}
|
|
60
|
-
parent() {
|
|
61
|
-
const prefix = this.directPrefix();
|
|
62
|
-
if (this.personN?.isMale()) {
|
|
63
|
-
return `${prefix}père`;
|
|
64
|
-
}
|
|
65
|
-
if (this.personN?.isFemale()) {
|
|
66
|
-
return `${prefix}mère`;
|
|
67
|
-
}
|
|
68
|
-
return `${prefix}parent`;
|
|
69
|
-
}
|
|
70
|
-
child() {
|
|
71
|
-
const prefix = this.directPrefix();
|
|
72
|
-
if (this.personN?.isMale()) {
|
|
73
|
-
return `${prefix}fils`;
|
|
74
|
-
}
|
|
75
|
-
if (this.personN?.isFemale()) {
|
|
76
|
-
return `${prefix}fille`;
|
|
77
|
-
}
|
|
78
|
-
return `${prefix}enfant`;
|
|
79
|
-
}
|
|
80
|
-
sibling() {
|
|
81
|
-
const parents1 = this.person1?.getBiologicalParents();
|
|
82
|
-
const parentsN = this.personN?.getBiologicalParents();
|
|
83
|
-
const inter = parents1?.intersection(parentsN);
|
|
84
|
-
let prefix = "";
|
|
85
|
-
if (!inter || inter.length < 2) {
|
|
86
|
-
prefix = "demi-";
|
|
87
|
-
}
|
|
88
|
-
if (this.personN?.isMale()) {
|
|
89
|
-
return `${prefix}frère`;
|
|
90
|
-
}
|
|
91
|
-
if (this.personN?.isFemale()) {
|
|
92
|
-
return `${prefix}sœur`;
|
|
93
|
-
}
|
|
94
|
-
return `${prefix}frère/sœur`;
|
|
95
|
-
}
|
|
96
|
-
spouse() {
|
|
97
|
-
if (this.personN?.isMale()) {
|
|
98
|
-
return "mari";
|
|
99
|
-
}
|
|
100
|
-
if (this.personN?.isFemale()) {
|
|
101
|
-
return "épouse";
|
|
102
|
-
}
|
|
103
|
-
return "conjoint";
|
|
104
|
-
}
|
|
105
|
-
ofSpouse(relation) {
|
|
106
|
-
if (!relation) {
|
|
107
|
-
return "";
|
|
108
|
-
}
|
|
109
|
-
const spouse = this.path?.[1].indi;
|
|
110
|
-
let spouseType = "conjoint";
|
|
111
|
-
if (spouse?.isMale()) {
|
|
112
|
-
spouseType = "mari";
|
|
113
|
-
}
|
|
114
|
-
if (spouse?.isFemale()) {
|
|
115
|
-
spouseType = "épouse";
|
|
116
|
-
}
|
|
117
|
-
return `${relation} du ${spouseType}`;
|
|
118
|
-
}
|
|
119
|
-
spouseOf(relation) {
|
|
120
|
-
if (!relation) {
|
|
121
|
-
return "";
|
|
122
|
-
}
|
|
123
|
-
const spouse = this.path?.[this.path.length - 1].indi;
|
|
124
|
-
let spouseType = "conjoint";
|
|
125
|
-
if (spouse?.isMale()) {
|
|
126
|
-
spouseType = "mari";
|
|
127
|
-
}
|
|
128
|
-
if (spouse?.isFemale()) {
|
|
129
|
-
spouseType = "épouse";
|
|
130
|
-
}
|
|
131
|
-
return `${spouseType} de ${relation}`;
|
|
132
|
-
}
|
|
133
|
-
of(relation) {
|
|
134
|
-
const formattedName = nameFormatter(this.path?.[0]?.indi, {
|
|
135
|
-
nameOrder: "first-last",
|
|
136
|
-
});
|
|
137
|
-
let name = formattedName.inOrder.filter(Boolean).join(" ");
|
|
138
|
-
if (this.displayName === "none") {
|
|
139
|
-
name = "";
|
|
140
|
-
}
|
|
141
|
-
else if (this.displayName === "givenname") {
|
|
142
|
-
name = formattedName.givenname;
|
|
143
|
-
}
|
|
144
|
-
else if (this.displayName === "surname") {
|
|
145
|
-
name = `${formattedName.surname}`;
|
|
146
|
-
}
|
|
147
|
-
if (!name || !relation) {
|
|
148
|
-
return relation ?? "";
|
|
149
|
-
}
|
|
150
|
-
if (relation.includes(" du ") || relation.includes(" de ")) {
|
|
151
|
-
return relation.replace(/ (du|de) /, ` $1 ${name} `);
|
|
152
|
-
}
|
|
153
|
-
return `${relation} de ${name}`;
|
|
154
|
-
}
|
|
155
|
-
inLaw(relation) {
|
|
156
|
-
let inLawRelation = relation;
|
|
157
|
-
Object.keys(InLawsFr).find((pattern) => {
|
|
158
|
-
const regex = new RegExp(`(?<space> )(?<word1>${pattern})$|^(?<word2>${pattern})$`);
|
|
159
|
-
if (relation?.match(regex)) {
|
|
160
|
-
inLawRelation = relation?.replace(regex, (m, ...rest) => {
|
|
161
|
-
const groups = rest[rest.length - 1];
|
|
162
|
-
const word = groups?.word1 || groups?.word2;
|
|
163
|
-
if (!word) {
|
|
164
|
-
return m;
|
|
165
|
-
}
|
|
166
|
-
const toReplace = InLawsFr[word.trim()] || InLawsFr[pattern];
|
|
167
|
-
return toReplace ? `${groups.space || ""}${toReplace}` : m;
|
|
168
|
-
});
|
|
169
|
-
return true;
|
|
170
|
-
}
|
|
171
|
-
return false;
|
|
172
|
-
});
|
|
173
|
-
return inLawRelation ?? "";
|
|
174
|
-
}
|
|
175
|
-
relationType(relation) {
|
|
176
|
-
if (!relation || !this.pathN?.relation) {
|
|
177
|
-
return relation ?? "";
|
|
178
|
-
}
|
|
179
|
-
return `${this.pathN.relation} ${relation}`;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import KinshipTranslatorBasic from "./kinship-translator.basic";
|
|
2
|
-
export default class KinshipTranslatorHU extends KinshipTranslatorBasic {
|
|
3
|
-
private directPrefix;
|
|
4
|
-
private caseReplacer;
|
|
5
|
-
indirect(): string;
|
|
6
|
-
removal(): string;
|
|
7
|
-
auncle(): string;
|
|
8
|
-
nibling(): string;
|
|
9
|
-
parent(): string;
|
|
10
|
-
child(): string;
|
|
11
|
-
sibling(): "testvér" | "féltestvér";
|
|
12
|
-
spouse(): "férj" | "feleség" | "házastárs";
|
|
13
|
-
ofSpouse(relation?: string | undefined): string;
|
|
14
|
-
spouseOf(relation?: string | undefined): string;
|
|
15
|
-
of(relation?: string | undefined): string;
|
|
16
|
-
inLaw(relation?: string | undefined): string;
|
|
17
|
-
relationType(relation?: string | undefined): string;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=kinship-translator.hu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kinship-translator.hu.d.ts","sourceRoot":"","sources":["../../src/kinship-translator/kinship-translator.hu.ts"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,MAAM,4BAA4B,CAAC;AAIhE,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,sBAAsB;IACtE,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,YAAY;IA+BpB,QAAQ;IAaR,OAAO;IAgBP,MAAM;IA6BN,OAAO;IAmCP,MAAM;IAcN,KAAK;IAYL,OAAO;IAcP,MAAM;IAYN,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAmBtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAuBtC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAoChC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IA6CnC,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;CAO1C"}
|