fonemas 0.5.4 → 0.5.5

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
- MjI1NjI3NDcwMDg5Mzk0NTAzN2IwMzBiZWI5NGI1Nzg3YzE4OTdlMA==
4
+ MTFhNzJiMmRlMDI5MDA0YjZlNWI2ZTJmNGEyMWY3ZTY4OWEzODRkZA==
5
5
  data.tar.gz: !binary |-
6
- ZmEwMjBiMjk2OThjZWFhNmI2MDFiY2Q0N2ZmY2U4MmI5NTgzZDUzMQ==
6
+ Yzc3MDc5ODc1ZWM2NjI3Y2E2OWUzOWYwZTVkOTYyMWIyNGM4NGM0NQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MjEwZWRmMDA4ZTgyMmY4ZDA3OTYzZGRiMzE1ZWIwMjA3MTVmYzQ4NDU4NzE2
10
- NzBiMjQ4ZTI0MGFkNTc0NzllNDAxMDY0YmVhNGQ1NjVjODc3ZTk4ZTNhZmVi
11
- YjVmY2E4MTUwNjliY2VkNWQ2ZTdhNTE0YmQ4ZmEyMDY5Mzg4MjQ=
9
+ OWQ1ODdhOTRjNDYyYWEyY2E3ODkxOWFkY2QyNzJhZTNhZDJjOTQzZjZhNDIw
10
+ OTM5MzkwZDhjYjQ0ODU4OGZiZGJiN2M5MDNhYjY2MWM0OGY1NzljZWU5MTcz
11
+ Yjc1NDY3ZjUzNzZjNzBjZGUwOTUwNTU3MzQyYzAyYWJkZmQ1NWY=
12
12
  data.tar.gz: !binary |-
13
- YjZjYjk4NmJlNDQ4MGRjMWNiOGZkNDcwODkzNDU2YzY0NmU3ZWNiMGU5Y2E0
14
- NDA4MjA5M2U2MjMyZmNhZGMyOGNkMDZhNjlhOThjOGY1OGMyOTBjY2E0Yzc2
15
- MGRhZTU0NWY3N2YwNTg1MTMxOTY2MzM5NGNmODdhNzk3N2UyMWY=
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
- # puts i
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
- if lastVocal(w,w.size-1) == word[i]
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 << 'gg'
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
- fonema << ['gu']
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 << 'gu'
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 gu ch dd gg ll nh}
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
 
@@ -1,3 +1,3 @@
1
1
  module Fonemas
2
- VERSION = '0.5.4'
2
+ VERSION = '0.5.5'
3
3
  end
@@ -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('gu ee rr a')
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('gg u')
31
- Fonemas.fonemas('guagua').should include('gu aa g u a')
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
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-16 00:00:00.000000000 Z
11
+ date: 2013-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler