|
@@ -34,12 +34,12 @@ discard block |
|
|
block discarded – undo |
34
|
34
|
1 => [ |
35
|
35
|
'F' => ['cousine germaine', '%s de la cousine germaine'], |
36
|
36
|
'M' => ['cousin germain', '%s du cousin germain'], |
37
|
|
- 'U' => ['cousin germain', '%s du cousin germain' ] |
|
37
|
+ 'U' => ['cousin germain', '%s du cousin germain'] |
38
|
38
|
], |
39
|
39
|
2 => [ |
40
|
40
|
'F' => ['cousine issue de germain', '%s de la cousine issue de germain'], |
41
|
41
|
'M' => ['cousin issu de germain', '%s du cousin issu de germain'], |
42
|
|
- 'U' => ['cousin issu de germain', '%s du cousin issu de germain' ] |
|
42
|
+ 'U' => ['cousin issu de germain', '%s du cousin issu de germain'] |
43
|
43
|
] |
44
|
44
|
]; |
45
|
45
|
|
|
@@ -110,26 +110,26 @@ discard block |
|
|
block discarded – undo |
110
|
110
|
public function relationships(): array |
111
|
111
|
{ |
112
|
112
|
// Construct the genitive form in French |
113
|
|
- $genitive = fn (string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s]; |
|
113
|
+ $genitive = fn(string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s]; |
114
|
114
|
|
115
|
115
|
// Functions to coumpound the name that can be indefinitely repeated |
116
|
|
- $degree = fn (int $n, string $suffix, string $genitive_link): array => |
|
116
|
+ $degree = fn(int $n, string $suffix, string $genitive_link): array => |
117
|
117
|
$genitive("$suffix au {$n}<sup>e</sup> degré", $genitive_link); |
118
|
118
|
|
119
|
|
- $great = fn (int $n, string $suffix, string $genitive_link): array => |
|
119
|
+ $great = fn(int $n, string $suffix, string $genitive_link): array => |
120
|
120
|
$n <= 1 ? $genitive('arrière-' . $suffix, 'de l’') : $degree($n + 1, $suffix, $genitive_link); |
121
|
121
|
|
122
|
|
- $firstCompound = fn (int $n, string $suffix, string $genitive_link): array => |
|
122
|
+ $firstCompound = fn(int $n, string $suffix, string $genitive_link): array => |
123
|
123
|
$n <= 1 ? $genitive($suffix, $genitive_link) : $great($n - 1, $suffix, $genitive_link); |
124
|
124
|
|
125
|
125
|
$compound = |
126
|
|
- fn (int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array => |
|
126
|
+ fn(int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array => |
127
|
127
|
$n <= 1 ? $genitive($suffix, $genitive_none) : $firstCompound($n - 1, $first_level . $suffix, $genitive_first); |
128
|
128
|
|
129
|
129
|
// Functions to translate cousins' degree of relationship |
130
|
|
- $symmetricCousin = fn (int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive( |
|
130
|
+ $symmetricCousin = fn(int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive( |
131
|
131
|
$sex === 'F' ? 'cousine au ' . $n . '<sup>e</sup> degré' : 'cousin au ' . $n . '<sup>e</sup> degré', |
132
|
|
- $sex === 'F' ? 'de la ' : 'du ' |
|
132
|
+ $sex === 'F' ? 'de la ' : 'du ' |
133
|
133
|
); |
134
|
134
|
|
135
|
135
|
$cousin = |
|
@@ -144,9 +144,8 @@ discard block |
|
|
block discarded – undo |
144
|
144
|
} |
145
|
145
|
return $genitive( |
146
|
146
|
$sex === 'F' ? |
147
|
|
- 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : |
148
|
|
- 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
149
|
|
- $sex === 'F' ? 'de la ' : 'du ' |
|
147
|
+ 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
148
|
+ $sex === 'F' ? 'de la ' : 'du ' |
150
|
149
|
); |
151
|
150
|
}; |
152
|
151
|
|
|
@@ -247,31 +246,31 @@ discard block |
|
|
block discarded – undo |
247
|
246
|
Relationship::fixed('trisaïeul paternel', '%s du trisaïeul paternel')->father()->parent()->parent()->father(), |
248
|
247
|
Relationship::fixed('trisaïeule', '%s de la trisaïeule')->parent()->parent()->parent()->mother(), |
249
|
248
|
Relationship::fixed('trisaïeul', '%s du trisaïeul')->parent()->parent()->parent()->father(), |
250
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(), |
251
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(), |
252
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(), |
253
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(), |
254
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(), |
255
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(), |
256
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(), |
257
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(), |
258
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(), |
|
249
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(), |
|
250
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(), |
|
251
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(), |
|
252
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(), |
|
253
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(), |
|
254
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(), |
|
255
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(), |
|
256
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(), |
|
257
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(), |
259
|
258
|
// Grandchildren and below |
260
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(), |
261
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(), |
262
|
|
- Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(), |
|
259
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(), |
|
260
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(), |
|
261
|
+ Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(), |
263
|
262
|
// Collateral relatives |
264
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(), |
265
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(), |
266
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(), |
267
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(), |
268
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(), |
269
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(), |
270
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(), |
271
|
|
- Relationship::dynamic(fn (int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(), |
|
263
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(), |
|
264
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(), |
|
265
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(), |
|
266
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(), |
|
267
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(), |
|
268
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(), |
|
269
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(), |
|
270
|
+ Relationship::dynamic(fn(int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(), |
272
|
271
|
// Cousins (based on canon law) |
273
|
|
- Relationship::dynamic(fn (int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(), |
274
|
|
- Relationship::dynamic(fn (int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(), |
|
272
|
+ Relationship::dynamic(fn(int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(), |
|
273
|
+ Relationship::dynamic(fn(int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(), |
275
|
274
|
|
276
|
275
|
]; |
277
|
276
|
} |