pascoale 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b3664da1373d2a874aeebb408c9a0bf570af45b
4
- data.tar.gz: 52bc36e4eafa3d91502623ab4e7205bd1236c218
3
+ metadata.gz: 7c29f334c80514fa47e9fe2f725f4ee72805fd23
4
+ data.tar.gz: e932c003c4e9c6c193c4bdb45c2373d2c87f0564
5
5
  SHA512:
6
- metadata.gz: ac4faf465b0590e2d2df274d140384275c9ef92c24aea32121dc1af9dfde827ad0454a96ab2b539bc4b4284828ca8c7b6775add21d8d14c9de2bd347526e9b1c
7
- data.tar.gz: fde813ac61ddda5d2bea775b4cfb60717d67547a51c0bf72a748929a0702e3740ea4dc4e38b92a8386bb59db5b2a1a6a304d97380dd5c715b637277191e51066
6
+ metadata.gz: 495abc17e08f8e5a791f6df943c897e341c8919f997dc9609e198be79f4012c66a8880b662d7f3df7347ee3ccc6192a56a35223b893b12905f59dc106620aca7
7
+ data.tar.gz: 2604c9bb04cbe9197a58c5010f192c47cdea503f893a38328cb960cb241079b193be37b9f80cc2baf6ef0da107b96d4023a1d032abd1f7616b71070d970ac94e
@@ -15,8 +15,6 @@ module Pascoale
15
15
 
16
16
  # Most common case in portuguese
17
17
  def paroxytone?
18
- return false if separated.size < 2
19
- return true if separated[-2] =~ /[#{ACCENTED}]/
20
18
  !proparoxytone? && !oxytone?
21
19
  end
22
20
 
@@ -24,9 +22,19 @@ module Pascoale
24
22
  def oxytone?
25
23
  return true if separated.size == 1
26
24
  return true if separated[-1] =~ /[#{ACCENTED}]/
25
+ return false if separated[-2] =~ /[#{ACCENTED}]/
26
+ return false if separated[-3] =~ /[#{ACCENTED}]/
27
27
  separated[-1] =~ /(is?|im|ins?|us?|um|uns?|l|n|r|x|ps|ãs?|ãos?|ons?|ais?|eis?|ois?|aus?|eus?|ous?|ias?|ies?|ios?|uas?|ues?|uos?)$/
28
28
  end
29
29
 
30
+ def syllable_index
31
+ return -1 if oxytone?
32
+ return -2 if paroxytone?
33
+ return -3 if proparoxytone?
34
+ # Shoud never happen because defaut is paroxytone
35
+ raise "Can't understand word"
36
+ end
37
+
30
38
  private
31
39
 
32
40
  def separated
@@ -1,3 +1,3 @@
1
1
  module Pascoale
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
@@ -35,6 +35,9 @@ describe Reflector do
35
35
  expect(Reflector.new('ruim')).to be_oxytone
36
36
  expect(Reflector.new('condor')).to be_oxytone
37
37
  expect(Reflector.new('anzol')).to be_oxytone
38
+ expect(Reflector.new('variável')).not_to be_oxytone
39
+ expect(Reflector.new('prováveis')).not_to be_oxytone
40
+ expect(Reflector.new('ámavel')).not_to be_oxytone
38
41
  end
39
42
  end
40
43
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pascoale
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ronie Uliana