fonemas 0.3.4 → 0.3.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
- OGI1ZjQ5MmJiYTlhYTEyZDdhYjE2Njg2OWEyNTU1MjBiNzZmNTk1MA==
4
+ NjMzYmVkZmE2Y2I3MDJkYTIyNjBhNWMxNWQ2ZjdiODEyMjVmNDJhYg==
5
5
  data.tar.gz: !binary |-
6
- ZTRmOWVlZGE3MDMxMWEzNWVhMzNmYWI3NzFjYjM0ZjI3ZTg3YzBhNw==
6
+ M2Q3YWFlYmI0NDQ5MGEzMTQ0OGVlY2M4ZDA0MTFiMGQ5YjRmMGVkYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- MDEwNjNiYTk5NjU3OGQ1ODVkZmJiOTdmNTgzMzFlNjFlNWVkN2ZmODRmZmMw
10
- YTFlNTBkMjVmN2RiNGJlMmZhNzI5MmEwMGYwYzk3YzQ0NGY4ZDI2NDViNWZl
11
- MWQ3YjE2MjkxMWNlM2YwNjhkYTczMDkwOTg5ZmYyNTQzMjRjZjk=
9
+ ZDIxMjY1YjdlNjRkOWY1Y2I0Yjg5ZDcwYTQ4ODIxMDI5ZTk4NGMyMzdiZTUx
10
+ NzAxYzA1MGY0MWM0MjUzZjQ2ZjViNTA1ZGEyOTAwOGNhY2NmNGNmOTBiYmIx
11
+ ZDJjMjIxNzI2NmJhMTEyOWMzMzlkODMxZGQ4NTllMWRhOWUzOGU=
12
12
  data.tar.gz: !binary |-
13
- OGUxZDY1OTYzYzZkZWFlMDNjMjhkM2MzNjVlZWEwMmMyZDBhYmRiMmQ3ZTVm
14
- ODI4NTIzMTcwM2YxYWVhZDY3MjE0YWM4ZGIyM2JhMDU2MGE5MjU5YjczZWU3
15
- YzViYzZjN2Y4OGQ5NDVkYzg1MWM4ZWYwZjg2NzM0ZDFjNjkzMWM=
13
+ NGJiOGExNDczNjFmYWQwNmM4ZTc5N2UzODcyNjIwMzZkNzczODljNGI5MDI3
14
+ NzVhZjYxM2E5YTM2ZmU4NzJlMTBjOTRjMTQ1NTRjMGZhZDBiMDVlNzY2ZGQ2
15
+ M2M4YjI5YzBjMGRjZmIzYTQwMDVlN2E5MDc0YzI1ZWNmNzgyOWY=
data/lib/fonemas.rb CHANGED
@@ -45,6 +45,17 @@ module Fonemas
45
45
  p = es.hyphenate(w)
46
46
  #puts es.visualize(w)
47
47
  hh = es.visualize(w).split("-")
48
+
49
+ if hh.size == 1 and w.size > 4 and w.include? 'h' and w[0] != 'h'
50
+ #caso johan
51
+ p = w.index('h')
52
+ if i < p
53
+ return true
54
+ else
55
+ return false
56
+ end
57
+ end
58
+
48
59
  #puts hh.size
49
60
  if w =~ /[áéíóúãäë]/
50
61
  #acento ya existe en otra silaba
@@ -287,6 +298,8 @@ module Fonemas
287
298
  when 'h' then
288
299
  if word[i+1] == 'u' and isDiptongo(word,i+1,i+2)
289
300
  fonema << ['','g']
301
+ elsif i > 0 and word[i-1] == 'o' and word[i+1] == 'a'
302
+ fonema << 'j'
290
303
  end
291
304
  #nada
292
305
  when 'i','í' then
@@ -296,7 +309,7 @@ module Fonemas
296
309
  fonema << 'i'
297
310
  end
298
311
  when 'j' then
299
- if word[i+1] == 'o' and word[i+2] == 'ã'
312
+ if i == 0 and word[i+1] == 'o' and (word[i+2] == 'ã' or word[i+2] == 'h')
300
313
  fonema << 'll'
301
314
  else
302
315
  fonema << 'j'
@@ -1,3 +1,3 @@
1
1
  module Fonemas
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
@@ -93,6 +93,7 @@ describe Fonemas do
93
93
  Fonemas.fonemas('z').should include('s ee t a')
94
94
  Fonemas.fonemas('é').should include('ee')
95
95
  Fonemas.fonemas('joão').should include('ll o aa o')
96
+ Fonemas.fonemas('johan').should include('ll oo j a n')
96
97
  end
97
98
 
98
99
  it 'test diptongos' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fonemas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Bahamondez Honores