fonemas 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Yjc4YjBjY2YxM2E3MDBiOGZhZDBkOTFjNDZjM2M2NGE2ZGYzMmNlNA==
4
+ NmM1OWY1M2EzMDhhOTExNThmZjE4ODcwYjdmOTJkMmFmMGIxMzhiOA==
5
5
  data.tar.gz: !binary |-
6
- YmI3NzEwZDkzNDNjMDkyNmUxNThkNjIxM2U0Mjg2NzNlOTE4OGFlYg==
6
+ NzQxZGJjNjE0ZGYxZTA0MTU3MzRhZWM1Y2VjNzg0ZmEyOGQ2YTBkNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MTAyZTAzMjljYjZjZGU2MGM2MmVmY2UyYzJjZDM4MjE0YTVlNWQ1MTk5N2E2
10
- ZmMxMzRmMWY4YzE1MDczYmMxYmZiOTk5NzAxNzc2OTI3MjZkNDAzNGEwMzkw
11
- NWJiYjVhNWY5ZTNmNjZjNWZjYWI2ODk1MTMxZTM2ZDM1NDRjNmQ=
9
+ OGMyNWRhZDNlZmNkZWVmZmU2MTlhMmQ2ODI1NDBiMzkzZmY2M2NjM2ZjMTM3
10
+ ZGY1ODk1MTNiYmE3MzM5MGI5OWRkZjFiOWM4NTI3ODI0ZDkzMTA3YmJhMWNk
11
+ ZTRhMzhmZTNlMGVjYmI3ZGQ3M2E3ZGRjN2E0NjRiNWVmYjhmN2Y=
12
12
  data.tar.gz: !binary |-
13
- YzgzYWJjNDNmOTBjODQwNzUyYjdkMzI4YzY1NzU3NjY2NzJiYTgxNTAyMmY0
14
- ODE2OTQxOWZjMmVhM2FmOTlhYjk0YjBhZTg1YWU3ODE5ODA5NzJjZTE1MzVk
15
- YjA3YmM5NzNiM2Y3NTcwMjU0MTY4YWM0YzAxYjEzMDU1NDVmNTE=
13
+ NzllZmNkYjczMDUwMTczN2Y3MjIxMGVkNjBiMTNlODc0ZTQ0NzczOTNlODcz
14
+ NjQ0OTU3NWMxMDlkMTI3NjU3MGM0Y2Y3NjJjNjliNjAxNzBmYjY4ZTI0NDgz
15
+ OGY4NjQ0ZWMzZWM4MTIyOWJmNjE0MjIzZmYwN2ZhNDg4YzQ4Njc=
data/lib/fonemas.rb CHANGED
@@ -174,7 +174,15 @@ module Fonemas
174
174
  fonema << 'a'
175
175
  end
176
176
  when 'b','v' then
177
- if word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
177
+ if isVocal(word,i-1) and (word[i+1] == 'b' or word[i+1] == 'v')
178
+ fonema << ['B','']
179
+ elsif i == 0 and isVocal(word,i+1)
180
+ if word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
181
+ fonema << ['B','b','g']
182
+ else
183
+ fonema << ['B','b']
184
+ end
185
+ elsif word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
178
186
  if entreVocales(word,i)
179
187
  fonema << ['b','g','']
180
188
  else
@@ -202,7 +210,9 @@ module Fonemas
202
210
  fonema << ['ch','sh','tch']
203
211
  end
204
212
  when 'd' then
205
- if entreVocales(word,i) or i == word.size-1
213
+ if i == 0 and isVocal(word,i+1)
214
+ fonema << ['D','d']
215
+ elsif entreVocales(word,i) or i == word.size-1
206
216
  fonema << ['d','']
207
217
  elsif entreVocalyConsonante(word,i)
208
218
  fonema << ['D','d']
@@ -291,7 +301,7 @@ module Fonemas
291
301
  fonema << 'u'
292
302
  when 'u' then
293
303
  if word[i-1] == 'g' and i == 1 and isTonica(word,i+1)
294
- fonema << ['gu','']
304
+ fonema << ['gu']
295
305
  elsif word[i-1] == 'q' or word[i-1] == 'g'
296
306
  #nada
297
307
 
@@ -1,3 +1,3 @@
1
1
  module Fonemas
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -2,9 +2,9 @@
2
2
  require 'spec_helper'
3
3
  describe Fonemas do
4
4
  it 'test acentos' do
5
- Fonemas.fonemas('hasta')[0].should eql("aa s t a")
6
- Fonemas.fonemas('torta')[0].should eql("t oo r t a")
7
- Fonemas.fonemas('ungüento')[0].should eql("u n g u ee n t o")
5
+ Fonemas.fonemas('hasta').should include("aa s t a")
6
+ Fonemas.fonemas('torta').should include("t oo r t a")
7
+ Fonemas.fonemas('ungüento').should include("u n g u ee n t o")
8
8
  Fonemas.fonemas('abuela').should include('a g u ee l a')
9
9
  Fonemas.fonemas('aro').should include('aa r o')
10
10
  Fonemas.fonemas('bondad').should include('b o n D aa d')
@@ -17,6 +17,14 @@ describe Fonemas do
17
17
  Fonemas.fonemas('huevo').should include('g u ee b o')
18
18
  Fonemas.fonemas('huevo').should include('g u ee o')
19
19
  Fonemas.fonemas('huifa').should include('g u ii f a')
20
+ Fonemas.fonemas('diente').should include('d i ee n t e')
21
+ Fonemas.fonemas('diente').should include('D i ee n t e')
22
+ Fonemas.fonemas('bueno').should include('b u ee n o')
23
+ Fonemas.fonemas('bueno').should include('B u ee n o')
24
+ Fonemas.fonemas('obvio').should include('oo B b i o')
25
+ Fonemas.fonemas('obvio').should include('oo b i o')
26
+ Fonemas.fonemas('guerra').should_not include('ee R a')
27
+
20
28
 
21
29
 
22
30
 
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.1.1
4
+ version: 0.1.2
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: 2013-06-17 00:00:00.000000000 Z
11
+ date: 2013-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler