fonemas 0.5.4 → 0.5.5
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 +8 -8
- data/lib/fonemas.rb +13 -6
- data/lib/fonemas/version.rb +1 -1
- data/spec/fonemas/fonema_spec.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTFhNzJiMmRlMDI5MDA0YjZlNWI2ZTJmNGEyMWY3ZTY4OWEzODRkZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Yzc3MDc5ODc1ZWM2NjI3Y2E2OWUzOWYwZTVkOTYyMWIyNGM4NGM0NQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWQ1ODdhOTRjNDYyYWEyY2E3ODkxOWFkY2QyNzJhZTNhZDJjOTQzZjZhNDIw
|
10
|
+
OTM5MzkwZDhjYjQ0ODU4OGZiZGJiN2M5MDNhYjY2MWM0OGY1NzljZWU5MTcz
|
11
|
+
Yjc1NDY3ZjUzNzZjNzBjZGUwOTUwNTU3MzQyYzAyYWJkZmQ1NWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGFlMjU0ZjQwNDJlZjMzMjdjMjU4YWFjZmY4YTlmYzg3MGE2OTkzMGIyNDEx
|
14
|
+
NzZkMDJlNzBlN2Y5N2EyNWIxNGRkZDhkYjQzNGVlMTMyNDFiNDY2MjE0OThm
|
15
|
+
ZjFmZGFjNGYyMmViMjVjNjIxM2QwNTFkZGQ5Y2RhZmIyZDJlNGI=
|
data/lib/fonemas.rb
CHANGED
@@ -23,7 +23,7 @@ module Fonemas
|
|
23
23
|
def self.lastVocal(word,from)
|
24
24
|
#puts "last vocal for #{word} from #{from}"
|
25
25
|
for i in 1..from
|
26
|
-
|
26
|
+
#puts i
|
27
27
|
#puts word[from-i]
|
28
28
|
if word[from-i] =~ /[aeiou]/
|
29
29
|
return word[from-i]
|
@@ -160,6 +160,7 @@ module Fonemas
|
|
160
160
|
else
|
161
161
|
g = silabar(w)
|
162
162
|
hh = g.split("-")
|
163
|
+
|
163
164
|
p = calcularPosicionSilabas(g)
|
164
165
|
|
165
166
|
if hh.size == 1 and w.size > 4 and w.include? 'h' and w[0] != 'h'
|
@@ -179,7 +180,9 @@ module Fonemas
|
|
179
180
|
else
|
180
181
|
#puts es.visualize(w)
|
181
182
|
if hh.size == 1
|
182
|
-
|
183
|
+
#puts "hh size 1"
|
184
|
+
#puts "lastVocal: #{lastVocal(w,w.size)} == #{word[i]}"
|
185
|
+
if lastVocal(w,w.size) == word[i]
|
183
186
|
return true
|
184
187
|
else
|
185
188
|
return false
|
@@ -447,7 +450,7 @@ module Fonemas
|
|
447
450
|
fonema << 'j'
|
448
451
|
else
|
449
452
|
if !entreVocales(word,i) and word[i-1] != 'n'
|
450
|
-
fonema << '
|
453
|
+
fonema << 'g'
|
451
454
|
else
|
452
455
|
fonema << 'g'
|
453
456
|
end
|
@@ -525,7 +528,11 @@ module Fonemas
|
|
525
528
|
if word[i-1] == 'q'
|
526
529
|
#nada
|
527
530
|
elsif word[i-1] == 'g' and i == 1 and isTonica(word,i+1)
|
528
|
-
|
531
|
+
if word[i+1] == 'e'
|
532
|
+
fonema << 'g'
|
533
|
+
else
|
534
|
+
fonema << [['g','u']]
|
535
|
+
end
|
529
536
|
elsif isTonica(word,i)
|
530
537
|
fonema << 'uu'
|
531
538
|
else
|
@@ -539,7 +546,7 @@ module Fonemas
|
|
539
546
|
elsif word[i+1] == 'i'
|
540
547
|
fonema << 'u'
|
541
548
|
else #if entreVocales(word,i)
|
542
|
-
fonema << '
|
549
|
+
fonema << [['g','u']]
|
543
550
|
# else
|
544
551
|
# fonema << 'Gu'
|
545
552
|
end
|
@@ -637,7 +644,7 @@ module Fonemas
|
|
637
644
|
def self.lista_de_fonemas
|
638
645
|
phonelist = ['SIL']
|
639
646
|
phonelist += %w{a e i o u aa ee ii oo uu}
|
640
|
-
phonelist += %w{bb b d e f g i j k l m n o p rr r s t u ks k
|
647
|
+
phonelist += %w{bb b d e f g i j k l m n o p rr r s t u ks k ch dd ll nh}
|
641
648
|
phonelist.uniq
|
642
649
|
end
|
643
650
|
|
data/lib/fonemas/version.rb
CHANGED
data/spec/fonemas/fonema_spec.rb
CHANGED
@@ -11,7 +11,7 @@ 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 bb 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('
|
14
|
+
Fonemas.fonemas('guerra').should include('g ee rr a')
|
15
15
|
Fonemas.fonemas('buitre').should include('g u ii t r e')
|
16
16
|
Fonemas.fonemas('huaso').should include('g u aa s o')
|
17
17
|
Fonemas.fonemas('huevo').should include('g u ee b o')
|
@@ -27,8 +27,8 @@ describe Fonemas do
|
|
27
27
|
Fonemas.fonemas('d').should_not include('')
|
28
28
|
Fonemas.fonemas('dé').should include('d ee')
|
29
29
|
Fonemas.fonemas('guatón').should include('g u a t oo n')
|
30
|
-
Fonemas.fonemas('gu').should include('
|
31
|
-
Fonemas.fonemas('guagua').should include('
|
30
|
+
Fonemas.fonemas('gu').should include('g uu')
|
31
|
+
Fonemas.fonemas('guagua').should include('g u aa g u a')
|
32
32
|
Fonemas.fonemas('johan').should include('ll oo j a n')
|
33
33
|
Fonemas.fonemas('adquirir').should include('a d k i r ii r')
|
34
34
|
for i in Fonemas.fonemas('adskribir')
|
@@ -37,6 +37,7 @@ describe Fonemas do
|
|
37
37
|
Fonemas.fonemas('alcancía').should include('a l k a n s ii a')
|
38
38
|
Fonemas.fonemas('aproximadamente').should include('a p r o ks i m a d a m ee n t e')
|
39
39
|
Fonemas.fonemas('aproximadamente').should_not include('a p r o k i m a d a m ee n t e')
|
40
|
+
Fonemas.fonemas('software').should include('s o f t g u aa r e')
|
40
41
|
|
41
42
|
end
|
42
43
|
|
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.5.
|
4
|
+
version: 0.5.5
|
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-09-
|
11
|
+
date: 2013-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|