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('police'); |
55
|
527 |
|
yield new Word('middleware'); |
56
|
527 |
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return Rule[] |
60
|
|
|
*/ |
61
|
530 |
|
public static function getIrregularRules() : iterable |
62
|
|
|
{ |
63
|
530 |
|
yield new Rule('atlas', 'atlases'); |
64
|
530 |
|
yield new Rule('axe', 'axes'); |
65
|
530 |
|
yield new Rule('beef', 'beefs'); |
66
|
530 |
|
yield new Rule('brother', 'brothers'); |
67
|
530 |
|
yield new Rule('cafe', 'cafes'); |
68
|
530 |
|
yield new Rule('chateau', 'chateaux'); |
69
|
530 |
|
yield new Rule('niveau', 'niveaux'); |
70
|
530 |
|
yield new Rule('child', 'children'); |
71
|
530 |
|
yield new Rule('cookie', 'cookies'); |
72
|
530 |
|
yield new Rule('corpus', 'corpuses'); |
73
|
530 |
|
yield new Rule('cow', 'cows'); |
74
|
530 |
|
yield new Rule('criterion', 'criteria'); |
75
|
530 |
|
yield new Rule('curriculum', 'curricula'); |
76
|
530 |
|
yield new Rule('demo', 'demos'); |
77
|
530 |
|
yield new Rule('domino', 'dominoes'); |
78
|
530 |
|
yield new Rule('echo', 'echoes'); |
79
|
530 |
|
yield new Rule('foot', 'feet'); |
80
|
530 |
|
yield new Rule('fungus', 'fungi'); |
81
|
530 |
|
yield new Rule('ganglion', 'ganglions'); |
82
|
530 |
|
yield new Rule('genie', 'genies'); |
83
|
530 |
|
yield new Rule('genus', 'genera'); |
84
|
530 |
|
yield new Rule('goose', 'geese'); |
85
|
530 |
|
yield new Rule('graffito', 'graffiti'); |
86
|
530 |
|
yield new Rule('hippopotamus', 'hippopotami'); |
87
|
530 |
|
yield new Rule('hoof', 'hoofs'); |
88
|
530 |
|
yield new Rule('human', 'humans'); |
89
|
530 |
|
yield new Rule('iris', 'irises'); |
90
|
530 |
|
yield new Rule('larva', 'larvae'); |
91
|
530 |
|
yield new Rule('leaf', 'leaves'); |
92
|
530 |
|
yield new Rule('loaf', 'loaves'); |
93
|
530 |
|
yield new Rule('man', 'men'); |
94
|
530 |
|
yield new Rule('medium', 'media'); |
95
|
530 |
|
yield new Rule('memorandum', 'memoranda'); |
96
|
530 |
|
yield new Rule('money', 'monies'); |
97
|
530 |
|
yield new Rule('mongoose', 'mongooses'); |
98
|
530 |
|
yield new Rule('motto', 'mottoes'); |
99
|
530 |
|
yield new Rule('move', 'moves'); |
100
|
530 |
|
yield new Rule('mythos', 'mythoi'); |
101
|
530 |
|
yield new Rule('niche', 'niches'); |
102
|
530 |
|
yield new Rule('nucleus', 'nuclei'); |
103
|
530 |
|
yield new Rule('numen', 'numina'); |
104
|
530 |
|
yield new Rule('occiput', 'occiputs'); |
105
|
530 |
|
yield new Rule('octopus', 'octopuses'); |
106
|
530 |
|
yield new Rule('opus', 'opuses'); |
107
|
530 |
|
yield new Rule('ox', 'oxen'); |
108
|
530 |
|
yield new Rule('passerby', 'passersby'); |
109
|
530 |
|
yield new Rule('penis', 'penises'); |
110
|
530 |
|
yield new Rule('person', 'people'); |
111
|
530 |
|
yield new Rule('plateau', 'plateaux'); |
112
|
530 |
|
yield new Rule('runner-up', 'runners-up'); |
113
|
530 |
|
yield new Rule('safe', 'safes'); |
114
|
530 |
|
yield new Rule('sex', 'sexes'); |
115
|
530 |
|
yield new Rule('soliloquy', 'soliloquies'); |
116
|
530 |
|
yield new Rule('son-in-law', 'sons-in-law'); |
117
|
530 |
|
yield new Rule('syllabus', 'syllabi'); |
118
|
530 |
|
yield new Rule('testis', 'testes'); |
119
|
530 |
|
yield new Rule('thief', 'thieves'); |
120
|
530 |
|
yield new Rule('tooth', 'teeth'); |
121
|
530 |
|
yield new Rule('tornado', 'tornadoes'); |
122
|
530 |
|
yield new Rule('trilby', 'trilbys'); |
123
|
530 |
|
yield new Rule('turf', 'turfs'); |
124
|
530 |
|
yield new Rule('valve', 'valves'); |
125
|
530 |
|
yield new Rule('volcano', 'volcanoes'); |
126
|
530 |
|
} |
127
|
|
|
} |
128
|
|
|
|