fonemas 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fonemas.rb +6 -0
- data/lib/fonemas/version.rb +1 -1
- data/spec/fonemas/fonema_spec.rb +6 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec0a455137b78115386830309c0e990862d7b41b
|
4
|
+
data.tar.gz: b2c6625877649e1f578cca98fe1374d92f5faa5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1aac3977295a87128e7d0a8b84b397a6a669e007ae70978c96406c26b3053bfcabdde49a81db1a47d95d0a8c02fc6903c0c61b3db367e856b7c5bfcda88b1ba
|
7
|
+
data.tar.gz: 770da8254f183ce6cc71aa7a495f3ff677aa23a28c37194825a692fc3b5a76fc572f88530ffc3e89bded92734d5c89a78cfd90eaed4a95a686f9abdd208d4610
|
data/lib/fonemas.rb
CHANGED
@@ -377,6 +377,9 @@ module Fonemas
|
|
377
377
|
return nil
|
378
378
|
end
|
379
379
|
|
380
|
+
def self.limpiarVocalesDuplicadas(word)
|
381
|
+
word.gsub(/a+/,'a').gsub(/e+/,'e').gsub(/i+/,'i').gsub(/o+/,'o').gsub(/u+/,'u')
|
382
|
+
end
|
380
383
|
|
381
384
|
def self.fonemas(word)
|
382
385
|
if word.include? ' '
|
@@ -390,6 +393,9 @@ module Fonemas
|
|
390
393
|
return self.nombres(word) unless self.nombres(word).nil?
|
391
394
|
return self.extranjeras(word) unless self.extranjeras(word).nil?
|
392
395
|
word = word.gsub(/'/,'')
|
396
|
+
|
397
|
+
word = limpiarVocalesDuplicadas(word)
|
398
|
+
|
393
399
|
if word.size == 1
|
394
400
|
return fonemaLetra(word)
|
395
401
|
end
|
data/lib/fonemas/version.rb
CHANGED
data/spec/fonemas/fonema_spec.rb
CHANGED
@@ -58,7 +58,7 @@ describe Fonemas do
|
|
58
58
|
|
59
59
|
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
it 'soporta mayúsculas acentuadas' do
|
63
63
|
Fonemas.fonemas('África').should include('aa f r i k a')
|
64
64
|
end
|
@@ -204,12 +204,15 @@ describe Fonemas do
|
|
204
204
|
|
205
205
|
end
|
206
206
|
|
207
|
+
it 'palabras con letras repetidas' do
|
208
|
+
Fonemas.fonemas('aaah').should eql(Fonemas.fonemas('aah'))
|
209
|
+
end
|
210
|
+
|
207
211
|
it 'debe caerse con guiones entre medio' do
|
208
212
|
|
209
213
|
expect { Fonemas.fonemas('a-b') }.to raise_error
|
210
214
|
|
211
|
-
|
212
215
|
end
|
213
216
|
|
214
217
|
|
215
|
-
end
|
218
|
+
end
|