|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Doctrine\Inflector\Rules; |
|
6
|
|
|
|
|
7
|
|
|
class Plural |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* @return Rule[] |
|
11
|
|
|
*/ |
|
12
|
527 |
|
public static function getDefaultRules() : iterable |
|
13
|
|
|
{ |
|
14
|
527 |
|
yield new Rule('/(s)tatus$/i', '\1\2tatuses'); |
|
15
|
527 |
|
yield new Rule('/(quiz)$/i', '\1zes'); |
|
16
|
527 |
|
yield new Rule('/^(ox)$/i', '\1\2en'); |
|
17
|
527 |
|
yield new Rule('/([m|l])ouse$/i', '\1ice'); |
|
18
|
527 |
|
yield new Rule('/(matr|vert|ind)(ix|ex)$/i', '\1ices'); |
|
19
|
527 |
|
yield new Rule('/(x|ch|ss|sh)$/i', '\1es'); |
|
20
|
527 |
|
yield new Rule('/([^aeiouy]|qu)y$/i', '\1ies'); |
|
21
|
527 |
|
yield new Rule('/(hive|gulf)$/i', '\1s'); |
|
22
|
527 |
|
yield new Rule('/(?:([^f])fe|([lr])f)$/i', '\1\2ves'); |
|
23
|
527 |
|
yield new Rule('/sis$/i', 'ses'); |
|
24
|
527 |
|
yield new Rule('/([ti])um$/i', '\1a'); |
|
25
|
527 |
|
yield new Rule('/(tax)on$/i', '\1a'); |
|
26
|
527 |
|
yield new Rule('/(c)riterion$/i', '\1riteria'); |
|
27
|
527 |
|
yield new Rule('/(p)erson$/i', '\1eople'); |
|
28
|
527 |
|
yield new Rule('/(m)an$/i', '\1en'); |
|
29
|
527 |
|
yield new Rule('/(c)hild$/i', '\1hildren'); |
|
30
|
527 |
|
yield new Rule('/(f)oot$/i', '\1eet'); |
|
31
|
527 |
|
yield new Rule('/(buffal|her|potat|tomat|volcan)o$/i', '\1\2oes'); |
|
32
|
527 |
|
yield new Rule('/(alumn|bacill|cact|foc|fung|nucle|radi|stimul|syllab|termin|vir)us$/i', '\1i'); |
|
33
|
527 |
|
yield new Rule('/us$/i', 'uses'); |
|
34
|
527 |
|
yield new Rule('/(alias)$/i', '\1es'); |
|
35
|
527 |
|
yield new Rule('/(analys|ax|cris|test|thes)is$/i', '\1es'); |
|
36
|
527 |
|
yield new Rule('/s$/', 's'); |
|
37
|
527 |
|
yield new Rule('/^$/', ''); |
|
38
|
527 |
|
yield new Rule('/$/', 's'); |
|
39
|
527 |
|
} |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* @return Word[] |
|
43
|
|
|
*/ |
|
44
|
527 |
|
public static function getUninflectedWords() : iterable |
|
45
|
|
|
{ |
|
46
|
527 |
|
yield new Word('.*[nrlm]ese'); |
|
47
|
527 |
|
yield new Word('.*deer'); |
|
48
|
527 |
|
yield new Word('.*fish'); |
|
49
|
527 |
|
yield new Word('.*measles'); |
|
50
|
527 |
|
yield new Word('.*ois'); |
|
51
|
527 |
|
yield new Word('.*pox'); |
|
52
|
527 |
|
yield new Word('.*sheep'); |
|
53
|
527 |
|
yield new Word('people'); |
|
54
|
527 |
|
yield new Word('cookie'); |
|
55
|
527 |
|
yield new Word('police'); |
|
56
|
527 |
|
yield new Word('middleware'); |
|
57
|
527 |
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* @return Rule[] |
|
61
|
|
|
*/ |
|
62
|
530 |
|
public static function getIrregularRules() : iterable |
|
63
|
|
|
{ |
|
64
|
530 |
|
yield new Rule('atlas', 'atlases'); |
|
65
|
530 |
|
yield new Rule('axe', 'axes'); |
|
66
|
530 |
|
yield new Rule('beef', 'beefs'); |
|
67
|
530 |
|
yield new Rule('brother', 'brothers'); |
|
68
|
530 |
|
yield new Rule('cafe', 'cafes'); |
|
69
|
530 |
|
yield new Rule('chateau', 'chateaux'); |
|
70
|
530 |
|
yield new Rule('niveau', 'niveaux'); |
|
71
|
530 |
|
yield new Rule('child', 'children'); |
|
72
|
530 |
|
yield new Rule('cookie', 'cookies'); |
|
73
|
530 |
|
yield new Rule('corpus', 'corpuses'); |
|
74
|
530 |
|
yield new Rule('cow', 'cows'); |
|
75
|
530 |
|
yield new Rule('criterion', 'criteria'); |
|
76
|
530 |
|
yield new Rule('curriculum', 'curricula'); |
|
77
|
530 |
|
yield new Rule('demo', 'demos'); |
|
78
|
530 |
|
yield new Rule('domino', 'dominoes'); |
|
79
|
530 |
|
yield new Rule('echo', 'echoes'); |
|
80
|
530 |
|
yield new Rule('foot', 'feet'); |
|
81
|
530 |
|
yield new Rule('fungus', 'fungi'); |
|
82
|
530 |
|
yield new Rule('ganglion', 'ganglions'); |
|
83
|
530 |
|
yield new Rule('genie', 'genies'); |
|
84
|
530 |
|
yield new Rule('genus', 'genera'); |
|
85
|
530 |
|
yield new Rule('goose', 'geese'); |
|
86
|
530 |
|
yield new Rule('graffito', 'graffiti'); |
|
87
|
530 |
|
yield new Rule('hippopotamus', 'hippopotami'); |
|
88
|
530 |
|
yield new Rule('hoof', 'hoofs'); |
|
89
|
530 |
|
yield new Rule('human', 'humans'); |
|
90
|
530 |
|
yield new Rule('iris', 'irises'); |
|
91
|
530 |
|
yield new Rule('larva', 'larvae'); |
|
92
|
530 |
|
yield new Rule('leaf', 'leaves'); |
|
93
|
530 |
|
yield new Rule('loaf', 'loaves'); |
|
94
|
530 |
|
yield new Rule('man', 'men'); |
|
95
|
530 |
|
yield new Rule('medium', 'media'); |
|
96
|
530 |
|
yield new Rule('memorandum', 'memoranda'); |
|
97
|
530 |
|
yield new Rule('money', 'monies'); |
|
98
|
530 |
|
yield new Rule('mongoose', 'mongooses'); |
|
99
|
530 |
|
yield new Rule('motto', 'mottoes'); |
|
100
|
530 |
|
yield new Rule('move', 'moves'); |
|
101
|
530 |
|
yield new Rule('mythos', 'mythoi'); |
|
102
|
530 |
|
yield new Rule('niche', 'niches'); |
|
103
|
530 |
|
yield new Rule('nucleus', 'nuclei'); |
|
104
|
530 |
|
yield new Rule('numen', 'numina'); |
|
105
|
530 |
|
yield new Rule('occiput', 'occiputs'); |
|
106
|
530 |
|
yield new Rule('octopus', 'octopuses'); |
|
107
|
530 |
|
yield new Rule('opus', 'opuses'); |
|
108
|
530 |
|
yield new Rule('ox', 'oxen'); |
|
109
|
530 |
|
yield new Rule('passerby', 'passersby'); |
|
110
|
530 |
|
yield new Rule('penis', 'penises'); |
|
111
|
530 |
|
yield new Rule('person', 'people'); |
|
112
|
530 |
|
yield new Rule('plateau', 'plateaux'); |
|
113
|
530 |
|
yield new Rule('runner-up', 'runners-up'); |
|
114
|
530 |
|
yield new Rule('safe', 'safes'); |
|
115
|
530 |
|
yield new Rule('sex', 'sexes'); |
|
116
|
530 |
|
yield new Rule('soliloquy', 'soliloquies'); |
|
117
|
530 |
|
yield new Rule('son-in-law', 'sons-in-law'); |
|
118
|
530 |
|
yield new Rule('syllabus', 'syllabi'); |
|
119
|
530 |
|
yield new Rule('testis', 'testes'); |
|
120
|
530 |
|
yield new Rule('thief', 'thieves'); |
|
121
|
530 |
|
yield new Rule('tooth', 'teeth'); |
|
122
|
530 |
|
yield new Rule('tornado', 'tornadoes'); |
|
123
|
530 |
|
yield new Rule('trilby', 'trilbys'); |
|
124
|
530 |
|
yield new Rule('turf', 'turfs'); |
|
125
|
530 |
|
yield new Rule('valve', 'valves'); |
|
126
|
530 |
|
yield new Rule('volcano', 'volcanoes'); |
|
127
|
530 |
|
} |
|
128
|
|
|
} |
|
129
|
|
|
|