fonemas 0.3.4 → 0.3.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 +14 -1
- data/lib/fonemas/version.rb +1 -1
- data/spec/fonemas/fonema_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjMzYmVkZmE2Y2I3MDJkYTIyNjBhNWMxNWQ2ZjdiODEyMjVmNDJhYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2Q3YWFlYmI0NDQ5MGEzMTQ0OGVlY2M4ZDA0MTFiMGQ5YjRmMGVkYw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDIxMjY1YjdlNjRkOWY1Y2I0Yjg5ZDcwYTQ4ODIxMDI5ZTk4NGMyMzdiZTUx
|
10
|
+
NzAxYzA1MGY0MWM0MjUzZjQ2ZjViNTA1ZGEyOTAwOGNhY2NmNGNmOTBiYmIx
|
11
|
+
ZDJjMjIxNzI2NmJhMTEyOWMzMzlkODMxZGQ4NTllMWRhOWUzOGU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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'
|
data/lib/fonemas/version.rb
CHANGED
data/spec/fonemas/fonema_spec.rb
CHANGED
@@ -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
|