@@ -25,8 +25,32 @@ final class EnglishInflector implements InflectorInterface
25
25
// Fourth entry: Whether the suffix may succeed a consonant
26
26
// Fifth entry: singular suffix, normal
27
27
28
- // bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
29
- ['a ' , 1 , true , true , ['on ' , 'um ' ]],
28
+ // bacteria (bacterium)
29
+ ['airetcab ' , 8 , true , true , 'bacterium ' ],
30
+
31
+ // corpora (corpus)
32
+ ['aroproc ' , 7 , true , true , 'corpus ' ],
33
+
34
+ // criteria (criterion)
35
+ ['airetirc ' , 8 , true , true , 'criterion ' ],
36
+
37
+ // curricula (curriculum)
38
+ ['alucirruc ' , 9 , true , true , 'curriculum ' ],
39
+
40
+ // genera (genus)
41
+ ['areneg ' , 6 , true , true , 'genus ' ],
42
+
43
+ // media (medium)
44
+ ['aidem ' , 5 , true , true , 'medium ' ],
45
+
46
+ // memoranda (memorandum)
47
+ ['adnaromem ' , 9 , true , true , 'memorandum ' ],
48
+
49
+ // phenomena (phenomenon)
50
+ ['anemonehp ' , 9 , true , true , 'phenomenon ' ],
51
+
52
+ // strata (stratum)
53
+ ['atarts ' , 6 , true , true , 'stratum ' ],
30
54
31
55
// nebulae (nebula)
32
56
['ea ' , 2 , true , true , 'a ' ],
@@ -141,7 +165,7 @@ final class EnglishInflector implements InflectorInterface
141
165
// shoes (shoe)
142
166
['se ' , 2 , true , true , ['' , 'e ' ]],
143
167
144
- // status (status)
168
+ // status (status)
145
169
['sutats ' , 6 , true , true , 'status ' ],
146
170
147
171
// tags (tag)
@@ -241,7 +265,7 @@ final class EnglishInflector implements InflectorInterface
241
265
// albums (album)
242
266
['mubla ' , 5 , true , true , 'albums ' ],
243
267
244
- // bacteria (bacterium), criteria (criterion ), phenomena (phenomenon)
268
+ // bacteria (bacterium), curricula (curriculum ), media (medium), memoranda (memorandum), phenomena (phenomenon), strata (stratum )
245
269
['mu ' , 2 , true , true , 'a ' ],
246
270
247
271
// men (man), women (woman)
@@ -250,20 +274,11 @@ final class EnglishInflector implements InflectorInterface
250
274
// people (person)
251
275
['nosrep ' , 6 , true , true , ['persons ' , 'people ' ]],
252
276
253
- // bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
254
- ['noi ' , 3 , true , true , 'ions ' ],
255
-
256
- // coupon (coupons)
257
- ['nop ' , 3 , true , true , 'pons ' ],
258
-
259
- // seasons (season), treasons (treason), poisons (poison), lessons (lesson)
260
- ['nos ' , 3 , true , true , 'sons ' ],
261
-
262
- // icons (icon)
263
- ['noc ' , 3 , true , true , 'cons ' ],
277
+ // criteria (criterion)
278
+ ['noiretirc ' , 9 , true , true , 'criteria ' ],
264
279
265
- // bacteria (bacterium), criteria (criterion), phenomena (phenomenon)
266
- ['no ' , 2 , true , true , 'a ' ],
280
+ // phenomena (phenomenon)
281
+ ['nonemonehp ' , 10 , true , true , 'phenomena ' ],
267
282
268
283
// echoes (echo)
269
284
['ohce ' , 4 , true , true , 'echoes ' ],
@@ -404,9 +419,6 @@ final class EnglishInflector implements InflectorInterface
404
419
'erawdrah ' ,
405
420
];
406
421
407
- /**
408
- * {@inheritdoc}
409
- */
410
422
public function singularize (string $ plural ): array
411
423
{
412
424
$ pluralRev = strrev ($ plural );
@@ -438,7 +450,7 @@ public function singularize(string $plural): array
438
450
if ($ j === $ suffixLength ) {
439
451
// Is there any character preceding the suffix in the plural string?
440
452
if ($ j < $ pluralLength ) {
441
- $ nextIsVowel = false !== strpos ('aeiou ' , $ lowerPluralRev [$ j ]);
453
+ $ nextIsVowel = str_contains ('aeiou ' , $ lowerPluralRev [$ j ]);
442
454
443
455
if (!$ map [2 ] && $ nextIsVowel ) {
444
456
// suffix may not succeed a vowel but next char is one
@@ -483,9 +495,6 @@ public function singularize(string $plural): array
483
495
return [$ plural ];
484
496
}
485
497
486
- /**
487
- * {@inheritdoc}
488
- */
489
498
public function pluralize (string $ singular ): array
490
499
{
491
500
$ singularRev = strrev ($ singular );
@@ -518,7 +527,7 @@ public function pluralize(string $singular): array
518
527
if ($ j === $ suffixLength ) {
519
528
// Is there any character preceding the suffix in the plural string?
520
529
if ($ j < $ singularLength ) {
521
- $ nextIsVowel = false !== strpos ('aeiou ' , $ lowerSingularRev [$ j ]);
530
+ $ nextIsVowel = str_contains ('aeiou ' , $ lowerSingularRev [$ j ]);
522
531
523
532
if (!$ map [2 ] && $ nextIsVowel ) {
524
533
// suffix may not succeed a vowel but next char is one
0 commit comments