fonemas 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/fonemas.rb +13 -3
- data/lib/fonemas/version.rb +1 -1
- data/spec/fonemas/fonema_spec.rb +11 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmM1OWY1M2EzMDhhOTExNThmZjE4ODcwYjdmOTJkMmFmMGIxMzhiOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzQxZGJjNjE0ZGYxZTA0MTU3MzRhZWM1Y2VjNzg0ZmEyOGQ2YTBkNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGMyNWRhZDNlZmNkZWVmZmU2MTlhMmQ2ODI1NDBiMzkzZmY2M2NjM2ZjMTM3
|
10
|
+
ZGY1ODk1MTNiYmE3MzM5MGI5OWRkZjFiOWM4NTI3ODI0ZDkzMTA3YmJhMWNk
|
11
|
+
ZTRhMzhmZTNlMGVjYmI3ZGQ3M2E3ZGRjN2E0NjRiNWVmYjhmN2Y=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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] == '
|
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
|
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
|
|
data/lib/fonemas/version.rb
CHANGED
data/spec/fonemas/fonema_spec.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
describe Fonemas do
|
4
4
|
it 'test acentos' do
|
5
|
-
Fonemas.fonemas('hasta')
|
6
|
-
Fonemas.fonemas('torta')
|
7
|
-
Fonemas.fonemas('ungüento')
|
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.
|
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-
|
11
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|