spanish 0.0.3 → 0.0.4

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.
@@ -44,11 +44,13 @@ module Spanish
44
44
 
45
45
  include Enumerable
46
46
 
47
- attr :index, :sounds, :syllable
47
+ attr :index
48
+ attr :sounds
49
+ attr :syllable
48
50
 
49
51
  def self.apply_stress(syllables)
50
- if syllables.detect {|s| s.stress}
51
- elsif syllables.length == 1
52
+ return syllables if syllables.detect {|s| s.stress}
53
+ if syllables.length == 1
52
54
  syllables[0].stress = true
53
55
  else
54
56
  last = syllables.last.to_a
@@ -1,3 +1,3 @@
1
1
  module Spanish
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -5,6 +5,22 @@ class SyllabificationTest < Test::Unit::TestCase
5
5
 
6
6
  include Spanish
7
7
 
8
+ test "should syllabify and apply stree rules to single sound word" do
9
+ sequence = ::Phonology::SoundSequence.new(::Phonology::Sound.new("o"))
10
+ assert Syllabifier.syllabify(sequence).first.stress
11
+ end
12
+
13
+ test "should syllabify and apply stree rules to multi sound word" do
14
+ sequence = Orthography.translator.translate("hola")
15
+ Syllabifier.new(sequence)
16
+ end
17
+
18
+ end
19
+
20
+ class SyllableTest < Test::Unit::TestCase
21
+
22
+ include Spanish
23
+
8
24
  test "should add consonant to empty onset" do
9
25
  s = Syllable.new
10
26
  assert s.onset_wants? Phonology::Sound.new("t")
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spanish
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 3
9
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
10
11
  platform: ruby
11
12
  authors:
12
13
  - Norman Clarke
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-07-09 00:00:00 -03:00
18
+ date: 2010-07-10 00:00:00 -03:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,11 +26,12 @@ dependencies:
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 15
28
30
  segments:
29
31
  - 0
30
32
  - 0
31
- - 5
32
- version: 0.0.5
33
+ - 8
34
+ version: 0.0.8
33
35
  type: :runtime
34
36
  version_requirements: *id001
35
37
  description: A Spanish phonology, orthography and grammar library for Ruby.
@@ -66,15 +68,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
68
  requirements:
67
69
  - - ">="
68
70
  - !ruby/object:Gem::Version
71
+ hash: 57
69
72
  segments:
70
73
  - 1
71
- - 9
72
- version: "1.9"
74
+ - 8
75
+ - 7
76
+ version: 1.8.7
73
77
  required_rubygems_version: !ruby/object:Gem::Requirement
74
78
  none: false
75
79
  requirements:
76
80
  - - ">="
77
81
  - !ruby/object:Gem::Version
82
+ hash: 3
78
83
  segments:
79
84
  - 0
80
85
  version: "0"