fonemas 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmZiNmJkN2Y0MzFiNTczNTllNDZjM2Y1ZTdmNGFhM2UzOGU3NTQyZA==
4
+ NjU3YjM5ZjNkYWIyYTdjZjJmMWMxZmRjMmQ2MzY4M2UyNThjMzA3Yw==
5
5
  data.tar.gz: !binary |-
6
- OGRhNTM0ZmJiN2Y4NDZiYjc1ZTUyMGNiNTIyNWE4ZDljY2IzZWM5Zg==
6
+ M2VmNDQ3ZTY3NDBhOWUyOWNiZTk2ZGRlZDNmMGZjZWIyOThmNWY0YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MDEwMjVkNzY1YTE5ZDZmYjc5NDNmOWUyY2IwZjg1NTI4NWI0YjQyMDAwMjE0
10
- Yzk0Y2ZjZDcxNDM2NTU4ZmNmM2JmMGEyMmM4OTRiZWYzOWNlMTc0NWI3NGVk
11
- NGEyYjkxYTAwNzYzNmE4OGNlZWU4Y2M0NzA4YmRhZjM3MGJkNjI=
9
+ ODIyMGJlZjg0ZmFjOWZiMjhlNDdhYWU4MjM4NmRjNzBhYWM1NmQ0MWE5NTZj
10
+ ZmM2Y2Y4MDVjNjFjNTlhYjZhN2RkZGVlYzI0MmZhODM0OTliM2YxMDljODg1
11
+ YjNlNTlkNDljYmRhYTMxM2FlZjg5ODUxMDc2OTc5ODQ4MTExNjg=
12
12
  data.tar.gz: !binary |-
13
- ZWM2MGI5M2Y4NDUzNjU4ZDBiOWIwMjljYzZjOTIwMzlmY2E3ZGJmYTljZjg1
14
- ZTk4MzUwZWQwZGQ5NTRjOTk4Nzc3MTUzMWFjZjM4MzRmZTc3NDA0MWI4NGQ4
15
- ZTBiNzYwYzA0NmFmNmNkYWM2MTA1NTAzMTQ5NmNkMjAzNTgzNTM=
13
+ YWExMjlhODgyMmY4NjM0NzlmYjMxOTI2OTMzOWE1OWZmMDEzYTBjOTE2Y2Uz
14
+ N2ViNzMyYmU1YjI2OGJmNmIyY2I5N2ZlZWViZTMxOTliMjkzM2EzYjVjMTFj
15
+ NWY1MGY5ODk1OWU5NmZmNjk2OTEyZGVhZmFmNTdmZDJkMGFiY2E=
@@ -457,12 +457,18 @@ module Fonemas
457
457
  else
458
458
  fonema << 'd'
459
459
  end
460
- when 'e','é','ë' then
461
- if isTonica(word,i)
462
- fonema << 'ee'
460
+ when 'e','ë' then
461
+ if word[i-1] == 'n' and word[i-2] == 'o' and word[i-3] == 'h' and word[i-4] == 'p'
462
+ fonema << ''
463
463
  else
464
- fonema << 'e'
464
+ if isTonica(word,i)
465
+ fonema << 'ee'
466
+ else
467
+ fonema << 'e'
468
+ end
465
469
  end
470
+ when 'é' then
471
+ fonema << 'ee'
466
472
  when 'f' then
467
473
  fonema << 'f'
468
474
  when 'g' then
@@ -492,10 +498,14 @@ module Fonemas
492
498
  end
493
499
  #nada
494
500
  when 'i','í' then
495
- if isTonica(word,i)
496
- fonema << 'ii'
501
+ if word[i+1] == 'p' and word[i+2] == 'h'
502
+ fonema << [['aa','i']]
497
503
  else
498
- fonema << 'i'
504
+ if isTonica(word,i)
505
+ fonema << 'ii'
506
+ else
507
+ fonema << 'i'
508
+ end
499
509
  end
500
510
  when 'j' then
501
511
  if i == 0 and word[i+1] == 'o' and (word[i+2] == 'ã' or word[i+2] == 'h')
@@ -521,14 +531,24 @@ module Fonemas
521
531
  fonema << 'n'
522
532
  when 'ñ' then
523
533
  fonema << 'nh'
524
- when 'o','ó' then
525
- if isTonica(word,i)
526
- fonema << 'oo'
527
- else
534
+ when 'o' then
535
+ if word[i-1] == 'h' and word[i-2] == 'p'
528
536
  fonema << 'o'
537
+ else
538
+ if isTonica(word,i)
539
+ fonema << 'oo'
540
+ else
541
+ fonema << 'o'
542
+ end
529
543
  end
544
+ when 'ó' then
545
+ fonema << 'oo'
530
546
  when 'p' then
531
- fonema << 'p'
547
+ if word[i+1] == 'h'
548
+ fonema << 'f'
549
+ else
550
+ fonema << 'p'
551
+ end
532
552
  when 'q' then
533
553
  fonema << 'k'
534
554
  when 'r' then
@@ -1,3 +1,3 @@
1
1
  module Fonemas
2
- VERSION = '0.7.6'
2
+ VERSION = '0.7.7'
3
3
  end
@@ -176,10 +176,11 @@ describe Fonemas do
176
176
  Fonemas.fonemas('web').should include('g u ee b')
177
177
  Fonemas.fonemas('will').should include('g u i l')
178
178
  Fonemas.fonemas('william').should include('g u i l i aa m')
179
-
180
-
181
179
  end
182
180
 
181
+ it 'palabras gringas' do
182
+ Fonemas.fonemas('iphone').should include('aa i f o n')
183
+ end
183
184
 
184
185
 
185
186
  it 'palabras esdrújulas' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fonemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Bahamondez Honores
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2015-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler