fonemas 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fonemas/version.rb +1 -1
- data/lib/fonemas.rb +12 -18
- data/spec/fonemas/fonema_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWY2MDgwYzMxMDBiNzRiNWVhOTk0YWEwNTYyMmViY2ZkNDRlZDdkOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Mzk5NjRjYWVkZjQzMmVjZmE3YWY5OGM2MmJhODdkNjM4OWExZjg2Zg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjUzNzU1ZGQyMTc2NGNhNmM2N2U5OWU0NDIwYjZmOTg3ZGVkMTIwZjJlMjg4
|
10
|
+
ZTliYzU1ZDdkZmQyNWU5NWZiOGZiNDFmODA3NjJmMDA2NzVhMjI0NDBkZTIz
|
11
|
+
ZDdkMDExNTU2ZDE0OTIwMTQ2ODNiOWJkZDM5M2Q2MDRmNTY0MmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWMwMjI5OTQxYjlhODk3MDllNjNhYWIzNzhkY2NmMWQ0NmY4OWM0ZjM3MmI4
|
14
|
+
NWQ5NmI3N2Y3Zjc4NDVlODg3ZDEyZTEwNzgwYzczZjNiMDVhZjY5YTk1MzY1
|
15
|
+
ZWVhZjI1YTAwMGYzNWQzNDQ2MzEyNzdhMzFhYmIwMWUwYjY4Zjg=
|
data/lib/fonemas/version.rb
CHANGED
data/lib/fonemas.rb
CHANGED
@@ -36,7 +36,7 @@ module Fonemas
|
|
36
36
|
def self.isTonica(word,i)
|
37
37
|
#falta considerar las palabras que poseen acento pero no tilde
|
38
38
|
return true if word.size == 1
|
39
|
-
tildes = %w(á é í ó ú ã)
|
39
|
+
tildes = %w(á é í ó ú ã ä ë)
|
40
40
|
w = word.join
|
41
41
|
if tildes.include? word[i]
|
42
42
|
return true
|
@@ -46,7 +46,7 @@ module Fonemas
|
|
46
46
|
#puts es.visualize(w)
|
47
47
|
hh = es.visualize(w).split("-")
|
48
48
|
#puts hh.size
|
49
|
-
if w =~ /[
|
49
|
+
if w =~ /[áéíóúãäë]/
|
50
50
|
#acento ya existe en otra silaba
|
51
51
|
return false
|
52
52
|
else
|
@@ -211,17 +211,7 @@ module Fonemas
|
|
211
211
|
for i in 0..(word.length-1)
|
212
212
|
letra = word[i]
|
213
213
|
case letra
|
214
|
-
when 'á','ã' then
|
215
|
-
fonema << 'aa'
|
216
|
-
when 'é' then
|
217
|
-
fonema << 'ee'
|
218
|
-
when 'í' then
|
219
|
-
fonema << 'ii'
|
220
|
-
when 'ó' then
|
221
|
-
fonema << 'oo'
|
222
|
-
when 'ú' then
|
223
|
-
fonema << 'uu'
|
224
|
-
when 'a' then
|
214
|
+
when 'a','á','ä','ã' then
|
225
215
|
if isTonica(word,i)
|
226
216
|
fonema << 'aa'
|
227
217
|
else
|
@@ -273,7 +263,7 @@ module Fonemas
|
|
273
263
|
else
|
274
264
|
fonema << 'd'
|
275
265
|
end
|
276
|
-
when 'e' then
|
266
|
+
when 'e','é','ë' then
|
277
267
|
if isTonica(word,i)
|
278
268
|
fonema << 'ee'
|
279
269
|
else
|
@@ -299,14 +289,18 @@ module Fonemas
|
|
299
289
|
fonema << ['','g']
|
300
290
|
end
|
301
291
|
#nada
|
302
|
-
when 'i' then
|
292
|
+
when 'i','í' then
|
303
293
|
if isTonica(word,i)
|
304
294
|
fonema << 'ii'
|
305
295
|
else
|
306
296
|
fonema << 'i'
|
307
297
|
end
|
308
298
|
when 'j' then
|
309
|
-
|
299
|
+
if word[i+1] == 'o' and word[i+2] == 'ã'
|
300
|
+
fonema << 'll'
|
301
|
+
else
|
302
|
+
fonema << 'j'
|
303
|
+
end
|
310
304
|
when 'k' then
|
311
305
|
fonema << 'k'
|
312
306
|
when 'l' then
|
@@ -319,7 +313,7 @@ module Fonemas
|
|
319
313
|
fonema << 'n'
|
320
314
|
when 'ñ' then
|
321
315
|
fonema << 'nh'
|
322
|
-
when 'o' then
|
316
|
+
when 'o','ó' then
|
323
317
|
if isTonica(word,i)
|
324
318
|
fonema << 'oo'
|
325
319
|
else
|
@@ -353,7 +347,7 @@ module Fonemas
|
|
353
347
|
fonema << 't'
|
354
348
|
when 'ü' then
|
355
349
|
fonema << 'u'
|
356
|
-
when 'u' then
|
350
|
+
when 'u','ú' then
|
357
351
|
if word[i-1] == 'g' and i == 1 and isTonica(word,i+1)
|
358
352
|
fonema << ['gu']
|
359
353
|
elsif isTonica(word,i)
|
data/spec/fonemas/fonema_spec.rb
CHANGED