-
Notifications
You must be signed in to change notification settings - Fork 216
Expand file tree
/
Copy pathFr.php
More file actions
68 lines (63 loc) · 2.04 KB
/
Copy pathFr.php
File metadata and controls
68 lines (63 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace Stringy\Inflections;
/**
* French inflection rules.
*/
class Fr extends Inflector
{
/**
* Return an array of pluralization rules, from most to least specific, in the form $rule => $replacement
*
* @return array
*/
public function pluralRules()
{
return [
'/(s|x|z)$/' => '\1',
'/(b|cor|ém|gemm|soupir|trav|vant|vitr)ail$/' => '\1aux',
'/ail$/' => 'ails',
'/al$/' => 'aux',
'/(bleu|émeu|landau|lieu|pneu|sarrau)$/' => '\1s',
'/(bijou|caillou|chou|genou|hibou|joujou|pou|au|eu|eau)$/' => '\1x',
'/$/' => 's',
];
}
/**
* Return an array of singularization rules, from most to least specific, in the form $rule => $replacement
*
*
* @return array
*/
public function singularRules()
{
return [
'/(b|cor|ém|gemm|soupir|trav|vant|vitr)aux$/' => '\1ail',
'/ails$/' => 'ail',
'/(journ|chev)aux$/' => '\1al',
'/(bijou|caillou|chou|genou|hibou|joujou|pou|au|eu|eau)x$/' => '\1',
'/s$/' => '',
];
}
/**
* Return an array of irregular replacements, in the form singular => plural ('goose' => 'geese')
*
* @return array
*/
public function irregularRules()
{
return [
'monsieur' => 'messieurs',
'madame' => 'mesdames',
'mademoiselle' => 'mesdemoiselles',
];
}
/**
* Return an array of uncountable rules (sheep, police)
*
* @return array
*/
public function uncountableRules()
{
return [];
}
}