fonemas 0.2.5 → 0.2.6

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
- M2UyZDY4OGM5NTc4ZjViMDBhMGIxZTU4M2Q3Y2NjNzhkNzVmYWY3MQ==
4
+ ZjJmNzk4ZTA1YTMxNmZmYTIxZjc2ZWE4YTgwNmE4MGM1MjZhMGE1OA==
5
5
  data.tar.gz: !binary |-
6
- NDVmMTdjYzc4ZjQ0Y2U5Mzc3NGZjOGI1ZmU3NWU2OTAyYjAyMjc2Yg==
6
+ N2ZlYjdmYmQ3N2NiMjljMzVlYmE4OGZlZmMwZDVhYTg1NDc5ZjA2OQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- M2YyMjA1MGU1N2EyZWE3NjY2NTQ4MmQxNThlNDAwOTkyMDBiMjdjMjU0NGVk
10
- ZTIzMjdkMDE0YWY4NGJhYjY3MGYyOGUwODM1YmFkNzZiMWMyNTFkMGU3ZWEy
11
- ZWVmYjQzMmFiNDU4NzFmZjRiNjViNWVhZmNhMjlhNWExOGNiNTI=
9
+ ZjhlMDY4MmVkYzhkNWVjYTZjN2M4MzBhZWQwNjlhN2U4NDMxNTE3MTUxNGZj
10
+ NzY4MzUzZDIwNWRiZjlkZmI2NWYzNDMxN2E5NTNmYTA1MDg1ZTdjMTMyNmQ0
11
+ Y2RiM2Y5YzhlZmUxOGYyMTgzNGZjOWVjZDFmZWQ1MjYyZDFjYjU=
12
12
  data.tar.gz: !binary |-
13
- ODNiOTJkY2Q1NDU3NjY1ZTJhY2YxMzFjMjYyNTUyZTkwOWYwNWFlODBjOGRj
14
- ZWZkNDFiYmE1ZjdkMjYxNjE5NjM3NDY4ZGUyZTk2MDM1MmNiZTc2MDhjZmY1
15
- MjI4YmIxMTg3OWE4Y2Q5ODUzZjlkMjAzZWVjMGMxMmEyZDYwMzk=
13
+ NGJjNzkwMTNiYzc3YTA3YTYwNGM1YmNlMWZjMDc0OTJhN2RlZTMzNTM3MjJl
14
+ ZGRlNmE0NTVlMzY0NDNmYjA4MmQ1OGUwZDVhZjY2NmIwYTBmODk0ODUxZGJl
15
+ MzQ1NzM5MDM1OGJiODg5MGI5Y2Q1YmI5MGYxNDM3ZWViOTczMTE=
data/lib/fonemas.rb CHANGED
@@ -159,33 +159,35 @@ module Fonemas
159
159
 
160
160
  def self.fonemaLetra(letra)
161
161
  case letra
162
- when 'a' then ['aa']
162
+ when 'a','á' then ['aa']
163
163
  when 'b' then ['b ee']
164
164
  when 'c' then ['s ee']
165
165
  when 'd' then ['d ee']
166
- when 'e' then ['ee']
166
+ when 'e','é' then ['ee']
167
167
  when 'f' then ['ee f ee']
168
168
  when 'g' then ['g ee']
169
169
  when 'h' then ['aa ch e']
170
- when 'i' then ['ii']
170
+ when 'i','í' then ['ii']
171
171
  when 'j' then ['j oo t a']
172
172
  when 'k' then ['k aa']
173
173
  when 'l' then ['ee l e']
174
174
  when 'm' then ['ee m e']
175
175
  when 'n' then ['ee n e']
176
176
  when 'ñ' then ['ee nh e']
177
- when 'o' then ['oo']
177
+ when 'o','ó' then ['oo']
178
178
  when 'p' then ['p ee']
179
179
  when 'q' then ['c uu']
180
180
  when 'r' then ['ee rr ee','ee r ee']
181
181
  when 's' then ['ee s e']
182
182
  when 't' then ['t ee']
183
- when 'u' then ['uu']
183
+ when 'u','ú' then ['uu']
184
184
  when 'v' then ['b ee','uu b e']
185
185
  when 'w' then ['d o b l e b ee','d o b l e uu v e']
186
186
  when 'x' then ['ee k i s']
187
187
  when 'y' then ['ll ee']
188
188
  when 'z' then ['z ee t a']
189
+ else
190
+ [letra]
189
191
  end
190
192
  end
191
193
 
@@ -225,9 +227,7 @@ module Fonemas
225
227
  fonema << 'a'
226
228
  end
227
229
  when 'b','v' then
228
- if word.size() == 1
229
- return Fonemas.fonemas('be')
230
- elsif isVocal(word,i-1) and (word[i+1] == 'b' or word[i+1] == 'v')
230
+ if isVocal(word,i-1) and (word[i+1] == 'b' or word[i+1] == 'v')
231
231
  fonema << ['bb','']
232
232
  elsif i == 0 and isVocal(word,i+1)
233
233
  if word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
@@ -251,10 +251,7 @@ module Fonemas
251
251
  fonema << 'bb'
252
252
  end
253
253
  when 'c' then
254
- if word.size() == 1
255
- fonema << 's'
256
- fonema << 'ee'
257
- elsif word[i+1] == 'e' or word[i+1] == 'i'
254
+ if word[i+1] == 'e' or word[i+1] == 'i'
258
255
  fonema << 's'
259
256
  else
260
257
  fonema << 'k'
@@ -266,10 +263,7 @@ module Fonemas
266
263
  fonema << ['ch','sh','tch']
267
264
  end
268
265
  when 'd' then
269
- if word.size == 1
270
- fonema << 'd'
271
- fonema << 'e'
272
- elsif i == 0 and isVocal(word,i+1)
266
+ if i == 0 and isVocal(word,i+1)
273
267
  fonema << ['dd','d']
274
268
  elsif entreVocales(word,i) or i == word.size-1
275
269
  fonema << ['d','']
@@ -300,9 +294,7 @@ module Fonemas
300
294
  end
301
295
  end
302
296
  when 'h' then
303
- if word.size == 1
304
- return Fonemas.fonemas('hache')
305
- elsif word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
297
+ if word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
306
298
  fonema << ['','g']
307
299
  end
308
300
  #nada
@@ -1,3 +1,3 @@
1
1
  module Fonemas
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
@@ -94,6 +94,7 @@ describe Fonemas do
94
94
  Fonemas.fonemas('x').should include('ee k i s')
95
95
  Fonemas.fonemas('y').should include('ll ee')
96
96
  Fonemas.fonemas('z').should include('z ee t a')
97
+ Fonemas.fonemas('é').should include('ee')
97
98
  end
98
99
 
99
100
  it 'test diptongos' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fonemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Bahamondez Honores