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