brtraducao 2.0.6 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/brtraducao/inflector_portuguese.rb +47 -49
- data/lib/brtraducao/version.rb +1 -1
- metadata +2 -2
@@ -2,52 +2,51 @@
|
|
2
2
|
#
|
3
3
|
# http://pt.wikipedia.org/wiki/Plural e
|
4
4
|
# http://pt.wikipedia.org/wiki/Singular
|
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
|
-
# #irregulares
|
5
|
+
ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
inflect.clear
|
7
|
+
|
8
|
+
inflect.plural(/$/, 's')
|
9
|
+
inflect.plural(/(s)$/i, '\1')
|
10
|
+
inflect.plural(/^(paí)s$/i, '\1ses')
|
11
|
+
inflect.plural(/(z|r)$/i, '\1es')
|
12
|
+
inflect.plural(/al$/i, 'ais')
|
13
|
+
inflect.plural(/el$/i, 'eis')
|
14
|
+
inflect.plural(/ol$/i, 'ois')
|
15
|
+
inflect.plural(/ul$/i, 'uis')
|
16
|
+
inflect.plural(/([^aeou])il$/i, '\1is')
|
17
|
+
inflect.plural(/m$/i, 'ns')
|
18
|
+
inflect.plural(/^(japon|escoc|ingl|dinamarqu|fregu|portugu)ês$/i, '\1eses')
|
19
|
+
inflect.plural(/^(|g)ás$/i, '\1ases')
|
20
|
+
inflect.plural(/ão$/i, 'ões')
|
21
|
+
inflect.plural(/^(irm|m)ão$/i, '\1ãos')
|
22
|
+
inflect.plural(/^(alem|c|p)ão$/i, '\1ães')
|
23
|
+
|
24
|
+
# Sem acentos...
|
25
|
+
inflect.plural(/ao$/i, 'oes')
|
26
|
+
inflect.plural(/^(irm|m)ao$/i, '\1aos')
|
27
|
+
inflect.plural(/^(alem|c|p)ao$/i, '\1aes')
|
28
|
+
|
29
|
+
inflect.singular(/([^ê])s$/i, '\1')
|
30
|
+
inflect.singular(/^(á|gá|paí)s$/i, '\1s')
|
31
|
+
inflect.singular(/(r|z)es$/i, '\1')
|
32
|
+
inflect.singular(/([^p])ais$/i, '\1al')
|
33
|
+
inflect.singular(/eis$/i, 'el')
|
34
|
+
inflect.singular(/ois$/i, 'ol')
|
35
|
+
inflect.singular(/uis$/i, 'ul')
|
36
|
+
inflect.singular(/(r|t)is$/i, '\1il')
|
37
|
+
inflect.singular(/ns$/i, 'm')
|
38
|
+
inflect.singular(/sses$/i, 'sse')
|
39
|
+
inflect.singular(/^(.*[^s]s)es$/i, '\1')
|
40
|
+
inflect.singular(/ães$/i, 'ão')
|
41
|
+
inflect.singular(/aes$/i, 'ao')
|
42
|
+
inflect.singular(/ãos$/i, 'ão')
|
43
|
+
inflect.singular(/aos$/i, 'ao')
|
44
|
+
inflect.singular(/ões$/i, 'ão')
|
45
|
+
inflect.singular(/oes$/i, 'ao')
|
46
|
+
inflect.singular(/(japon|escoc|ingl|dinamarqu|fregu|portugu)eses$/i, '\1ês')
|
47
|
+
inflect.singular(/^(g|)ases$/i, '\1ás')
|
48
|
+
|
49
|
+
# #irregulares
|
51
50
|
# irregulares = {'país' => 'paises'}
|
52
51
|
#
|
53
52
|
#
|
@@ -55,7 +54,6 @@ module Inflector
|
|
55
54
|
# inflect.plural(/^#{key.to_s}$/, value)
|
56
55
|
# inflect.singular(/^#{value}$/, key.to_s)
|
57
56
|
# end
|
58
|
-
|
59
|
-
|
60
|
-
end
|
57
|
+
|
58
|
+
inflect.uncountable %w( tórax tênis ônibus lápis fênix )
|
61
59
|
end
|
data/lib/brtraducao/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brtraducao
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Marcos Tapaj\xC3\xB3s"
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2008-09-
|
15
|
+
date: 2008-09-23 00:00:00 -03:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|