| 148 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
declare(strict_types=1);
|
|
|
4 |
|
|
|
5 |
namespace Doctrine\Inflector\Rules\Portuguese;
|
|
|
6 |
|
|
|
7 |
use Doctrine\Inflector\Rules\Pattern;
|
|
|
8 |
use Doctrine\Inflector\Rules\Substitution;
|
|
|
9 |
use Doctrine\Inflector\Rules\Transformation;
|
|
|
10 |
use Doctrine\Inflector\Rules\Word;
|
|
|
11 |
|
|
|
12 |
class Inflectible
|
|
|
13 |
{
|
|
|
14 |
/** @return Transformation[] */
|
|
|
15 |
public static function getSingular(): iterable
|
|
|
16 |
{
|
|
|
17 |
yield new Transformation(new Pattern('/^(g|)ases$/i'), '\1ás');
|
|
|
18 |
yield new Transformation(new Pattern('/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i'), '\1ês');
|
|
|
19 |
yield new Transformation(new Pattern('/(ae|ao|oe)s$/'), 'ao');
|
|
|
20 |
yield new Transformation(new Pattern('/(ãe|ão|õe)s$/'), 'ão');
|
|
|
21 |
yield new Transformation(new Pattern('/^(.*[^s]s)es$/i'), '\1');
|
|
|
22 |
yield new Transformation(new Pattern('/sses$/i'), 'sse');
|
|
|
23 |
yield new Transformation(new Pattern('/ns$/i'), 'm');
|
|
|
24 |
yield new Transformation(new Pattern('/(r|t|f|v)is$/i'), '\1il');
|
|
|
25 |
yield new Transformation(new Pattern('/uis$/i'), 'ul');
|
|
|
26 |
yield new Transformation(new Pattern('/ois$/i'), 'ol');
|
|
|
27 |
yield new Transformation(new Pattern('/eis$/i'), 'ei');
|
|
|
28 |
yield new Transformation(new Pattern('/éis$/i'), 'el');
|
|
|
29 |
yield new Transformation(new Pattern('/([^p])ais$/i'), '\1al');
|
|
|
30 |
yield new Transformation(new Pattern('/(r|z)es$/i'), '\1');
|
|
|
31 |
yield new Transformation(new Pattern('/^(á|gá)s$/i'), '\1s');
|
|
|
32 |
yield new Transformation(new Pattern('/([^ê])s$/i'), '\1');
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
/** @return Transformation[] */
|
|
|
36 |
public static function getPlural(): iterable
|
|
|
37 |
{
|
|
|
38 |
yield new Transformation(new Pattern('/^(alem|c|p)ao$/i'), '\1aes');
|
|
|
39 |
yield new Transformation(new Pattern('/^(irm|m)ao$/i'), '\1aos');
|
|
|
40 |
yield new Transformation(new Pattern('/ao$/i'), 'oes');
|
|
|
41 |
yield new Transformation(new Pattern('/^(alem|c|p)ão$/i'), '\1ães');
|
|
|
42 |
yield new Transformation(new Pattern('/^(irm|m)ão$/i'), '\1ãos');
|
|
|
43 |
yield new Transformation(new Pattern('/ão$/i'), 'ões');
|
|
|
44 |
yield new Transformation(new Pattern('/^(|g)ás$/i'), '\1ases');
|
|
|
45 |
yield new Transformation(new Pattern('/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i'), '\1eses');
|
|
|
46 |
yield new Transformation(new Pattern('/m$/i'), 'ns');
|
|
|
47 |
yield new Transformation(new Pattern('/([^aeou])il$/i'), '\1is');
|
|
|
48 |
yield new Transformation(new Pattern('/ul$/i'), 'uis');
|
|
|
49 |
yield new Transformation(new Pattern('/ol$/i'), 'ois');
|
|
|
50 |
yield new Transformation(new Pattern('/el$/i'), 'eis');
|
|
|
51 |
yield new Transformation(new Pattern('/al$/i'), 'ais');
|
|
|
52 |
yield new Transformation(new Pattern('/(z|r)$/i'), '\1es');
|
|
|
53 |
yield new Transformation(new Pattern('/(s)$/i'), '\1');
|
|
|
54 |
yield new Transformation(new Pattern('/$/'), 's');
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
/** @return Substitution[] */
|
|
|
58 |
public static function getIrregular(): iterable
|
|
|
59 |
{
|
|
|
60 |
yield new Substitution(new Word('abdomen'), new Word('abdomens'));
|
|
|
61 |
yield new Substitution(new Word('alemão'), new Word('alemães'));
|
|
|
62 |
yield new Substitution(new Word('artesã'), new Word('artesãos'));
|
|
|
63 |
yield new Substitution(new Word('álcool'), new Word('álcoois'));
|
|
|
64 |
yield new Substitution(new Word('árvore'), new Word('árvores'));
|
|
|
65 |
yield new Substitution(new Word('bencão'), new Word('bencãos'));
|
|
|
66 |
yield new Substitution(new Word('cão'), new Word('cães'));
|
|
|
67 |
yield new Substitution(new Word('campus'), new Word('campi'));
|
|
|
68 |
yield new Substitution(new Word('cadáver'), new Word('cadáveres'));
|
|
|
69 |
yield new Substitution(new Word('capelão'), new Word('capelães'));
|
|
|
70 |
yield new Substitution(new Word('capitão'), new Word('capitães'));
|
|
|
71 |
yield new Substitution(new Word('chão'), new Word('chãos'));
|
|
|
72 |
yield new Substitution(new Word('charlatão'), new Word('charlatães'));
|
|
|
73 |
yield new Substitution(new Word('cidadão'), new Word('cidadãos'));
|
|
|
74 |
yield new Substitution(new Word('consul'), new Word('consules'));
|
|
|
75 |
yield new Substitution(new Word('cristão'), new Word('cristãos'));
|
|
|
76 |
yield new Substitution(new Word('difícil'), new Word('difíceis'));
|
|
|
77 |
yield new Substitution(new Word('email'), new Word('emails'));
|
|
|
78 |
yield new Substitution(new Word('escrivão'), new Word('escrivães'));
|
|
|
79 |
yield new Substitution(new Word('fóssil'), new Word('fósseis'));
|
|
|
80 |
yield new Substitution(new Word('gás'), new Word('gases'));
|
|
|
81 |
yield new Substitution(new Word('germens'), new Word('germen'));
|
|
|
82 |
yield new Substitution(new Word('grão'), new Word('grãos'));
|
|
|
83 |
yield new Substitution(new Word('hífen'), new Word('hífens'));
|
|
|
84 |
yield new Substitution(new Word('irmão'), new Word('irmãos'));
|
|
|
85 |
yield new Substitution(new Word('liquens'), new Word('liquen'));
|
|
|
86 |
yield new Substitution(new Word('mal'), new Word('males'));
|
|
|
87 |
yield new Substitution(new Word('mão'), new Word('mãos'));
|
|
|
88 |
yield new Substitution(new Word('orfão'), new Word('orfãos'));
|
|
|
89 |
yield new Substitution(new Word('país'), new Word('países'));
|
|
|
90 |
yield new Substitution(new Word('pai'), new Word('pais'));
|
|
|
91 |
yield new Substitution(new Word('pão'), new Word('pães'));
|
|
|
92 |
yield new Substitution(new Word('projétil'), new Word('projéteis'));
|
|
|
93 |
yield new Substitution(new Word('réptil'), new Word('répteis'));
|
|
|
94 |
yield new Substitution(new Word('sacristão'), new Word('sacristães'));
|
|
|
95 |
yield new Substitution(new Word('sotão'), new Word('sotãos'));
|
|
|
96 |
yield new Substitution(new Word('tabelião'), new Word('tabeliães'));
|
|
|
97 |
}
|
|
|
98 |
}
|