fonemas 0.0.16 → 0.1.0

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
- ODU5ZGIxZTYwNTI0Y2QwZWE0OTIzNzAyZjgwMTk4NmRiMWZiMDhhNg==
4
+ ODUzNTQ5MzM0YTViMDUyODc1MjM2MDRjYTg5OTUxOTEwYmZlYzNlYQ==
5
5
  data.tar.gz: !binary |-
6
- ODBjNjViN2M3OWIzY2MxYWQxZmI0YzExODVhZGViMjI4ODRjMDA0Yg==
6
+ NjQ0NDlhZDVhZjVhOGY0NThkZjcyODA0ZjZlOWIyYWIzYTkyNDYzOQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MmI5OGZiMDRmYmEyYjBjZWNlNjgwYzA1OGRlZGVkZjRmMzBhZjM3ZDU5NzYx
10
- NDRmNzNiODE0YTE0MmU0OTRlNWZiMzc0YjY3YmM4NTUxN2RiZWQ4NzE4NWNk
11
- Zjc5MjVjNjEzNzBkYzkyYjNhNDdmZGZiZGUzNDRkZGVmYzhhNWQ=
9
+ NTkzNDM4YTI2ZGM0NTExZGViNjhiMmNmN2I2M2Y1NTdhYzdlNWRmY2ExZjVh
10
+ ZWFhMWYzNDcxNWNiNDZkYzdiYWYyNDAyMzVlM2M3YTk3ZDUwZmNhMWE5ODkz
11
+ MmJhZWVhOTRmYWVhNWRmODBiMDk4NjQxZTFhN2FlNWViOTU2ODQ=
12
12
  data.tar.gz: !binary |-
13
- YTE1ZjY5Yzg5NzBhZmRkODUyZjZiNjlmNDMyNjkwMDg1ZjIzMjU5NzA5YmZj
14
- NTBjMDQ0Mjc0ZDgyNjE2MTljZjc5OGI5ZDM4NmVhYmU0MjE4Yjk5ZmExNGFm
15
- MTY1YjUzODUxNzU0YzcxYjg2OWJhNTNhMmJiNDIzMjAwMTMxYjY=
13
+ YTJlMTdhZDZhMzM1YzA2MDU3YWFkMzQyMGEwYTMzYThiZGQ1MTIzYWZiZmJj
14
+ NmZjMWM4OGQyOThlZmIzMjI4NjYzZDIwOTcyMTFjNmFjN2I3MzU4MjE3Nzgw
15
+ YjZkMmM5ZDE5MTc3NTU4ZDhjZGFmOWIxZTMyNTA2ZjRlMTVjYmU=
data/lib/fonemas.rb CHANGED
@@ -125,7 +125,7 @@ module Fonemas
125
125
  s = word[second]
126
126
  abiertas = %w(a e o)
127
127
  cerradas = %w(i u)
128
- return ((abiertas.include? f and cerradas.include? s) or (abiertas.include? s and cerradas.include? f))
128
+ return ((abiertas.include? f and cerradas.include? s) or (abiertas.include? s and cerradas.include? f) or (cerradas.include? f and cerradas.include? s))
129
129
 
130
130
  end
131
131
 
@@ -173,7 +173,7 @@ module Fonemas
173
173
  else
174
174
  fonema << 'a'
175
175
  end
176
- when 'b' then
176
+ when 'b','v' then
177
177
  if word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
178
178
  if entreVocales(word,i)
179
179
  fonema << ['b','g','']
@@ -218,7 +218,10 @@ module Fonemas
218
218
  when 'f' then
219
219
  fonema << 'f'
220
220
  when 'g' then
221
- if word[i+1] == 'e' or word[i+1] == 'i'
221
+ if word[i+1] == 'u' and i == 0
222
+ #nada
223
+
224
+ elsif word[i+1] == 'e' or word[i+1] == 'i'
222
225
  fonema << 'j'
223
226
  else
224
227
  if !entreVocales(word,i) and word[i-1] != 'n'
@@ -228,6 +231,9 @@ module Fonemas
228
231
  end
229
232
  end
230
233
  when 'h' then
234
+ if word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
235
+ fonema << ['','g']
236
+ end
231
237
  #nada
232
238
  when 'i' then
233
239
  if isTonica(word,i)
@@ -294,8 +300,6 @@ module Fonemas
294
300
  else
295
301
  fonema << 'u'
296
302
  end
297
- when 'v' then
298
- fonema << 'b'
299
303
  when 'w' then
300
304
  if i == 0
301
305
  fonema << ['b','B']
@@ -1,3 +1,3 @@
1
1
  module Fonemas
2
- VERSION = "0.0.16"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -11,12 +11,26 @@ describe Fonemas do
11
11
  Fonemas.fonemas('gestión').should include('j e s t i oo n')
12
12
  Fonemas.fonemas('abstraer').should include('a B s t r a ee r')
13
13
  Fonemas.fonemas('presidida').should include('p r e s i ii d a')
14
+ Fonemas.fonemas('guerra').should include('gu ee R a')
15
+ Fonemas.fonemas('buitre').should include('g u ii t r e')
16
+ Fonemas.fonemas('huaso').should include('g u aa s o')
17
+ Fonemas.fonemas('huevo').should include('g u ee b o')
18
+ Fonemas.fonemas('huevo').should include('g u ee o')
19
+ Fonemas.fonemas('huifa').should include('g u ii f a')
20
+
21
+
22
+
23
+
14
24
 
15
25
  for i in Fonemas.fonemas('adskribir')
16
26
  i.should end_with('ii r')
17
27
  end
18
28
  end
19
29
 
30
+ it 'test diptongos' do
31
+ Fonemas.isDiptongo("buitre",1,2).should be(true)
32
+ end
33
+
20
34
  it 'combinar fonemas' do
21
35
  test = ['a',['b','c'],['d','e']]
22
36
  output = Fonemas.normalize(Fonemas.generateFonemas(test))
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.0.16
4
+ version: 0.1.0
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-13 00:00:00.000000000 Z
11
+ date: 2013-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler