-
Notifications
You must be signed in to change notification settings - Fork 22
/
en.php
91 lines (85 loc) · 3.79 KB
/
en.php
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/*
* This file is part of the ICanBoogie package.
*
* (c) Olivier Laviale <olivier.laviale@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ICanBoogie\Inflections;
use ICanBoogie\Inflections;
use ICanBoogie\InflectionsConfigurator;
use function explode;
/**
* English Inflections.
*
* @codeCoverageIgnore
*/
final class en implements InflectionsConfigurator
{
public static function configure(Inflections $inflections): void
{
$inflections
->plural('/$/', 's')
->plural('/s$/i', 's')
->plural('/^(ax|test)is$/i', '\1es')
->plural('/(alias|status)$/i', '\1es')
->plural('/(bu)s$/i', '\1ses')
->plural('/(buffal|tomat|potat|volcan|her)o$/i', '\1oes')
->plural('/([ti])um$/i', '\1a')
->plural('/([ti])a$/i', '\1a')
->plural('/sis$/i', 'ses')
->plural('/(?:([^f])fe|([lr])f)$/i', '\1\2ves')
->plural('/(hive)$/i', '\1s')
->plural('/([^aeiouy]|qu)y$/i', '\1ies')
->plural('/(x|ch|ss|sh)$/i', '\1es')
->plural('/(matr|vert|ind)(?:ix|ex)$/i', '\1ices')
->plural('/^(m|l)ouse$/i', '\1ice')
->plural('/^(m|l)ice$/i', '\1ice')
->plural('/^(ox)$/i', '\1en')
->plural('/^(oxen)$/i', '\1')
->plural('/(quiz)$/i', '\1zes')
->singular('/s$/i', '')
->singular('/(ss)$/i', '\1')
->singular('/(n)ews$/i', '\1ews')
->singular('/([ti])a$/i', '\1um')
->singular('/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i', '\1sis')
->singular('/(^analy)(sis|ses)$/i', '\1sis')
->singular('/([^f])ves$/i', '\1fe')
->singular('/(hive)s$/i', '\1')
->singular('/(tive)s$/i', '\1')
->singular('/([lr])ves$/i', '\1f')
->singular('/([^aeiouy]|qu)ies$/i', '\1y')
->singular('/(s)eries$/i', '\1eries')
->singular('/(m)ovies$/i', '\1ovie')
->singular('/(x|ch|ss|sh)es$/i', '\1')
->singular('/^(m|l)ice$/i', '\1ouse')
->singular('/(bus)(es)?$/i', '\1')
->singular('/(o)es$/i', '\1')
->singular('/(shoe)s$/i', '\1')
->singular('/(cris|test)(is|es)$/i', '\1is')
->singular('/^(a)x[ie]s$/i', '\1xis')
->singular('/(alias|status)(es)?$/i', '\1')
->singular('/^(ox)en/i', '\1')
->singular('/(vert|ind)ices$/i', '\1ex')
->singular('/(matr)ices$/i', '\1ix')
->singular('/(quiz)zes$/i', '\1')
->singular('/(database)s$/i', '\1')
->irregular('bonus', 'bonuses')
->irregular('child', 'children')
->irregular('genus', 'genera')
->irregular('goose', 'geese')
->irregular('leaf', 'leaves')
->irregular('loaf', 'loaves')
->irregular('man', 'men')
->irregular('move', 'moves')
->irregular('octopus', 'octopuses')
->irregular('person', 'people')
->irregular('sex', 'sexes')
->irregular('virus', 'viruses')
->irregular('zombie', 'zombies')
// http://easenglish.net/Files/Grammar/uncountable%20words.pdf
->uncountable(explode(' ', 'advice aircraft art baggage butter clothing coal cotton deer equipment experience feedback fish flour food furniture gas homework impatience information jeans knowledge leather love luggage management money moose music news oil patience police polish progress research rice salmon sand series sheep silk sms soap spam species staff sugar swine talent toothpaste traffic travel vinegar weather wood wool work'));
}
}