spanish 0.0.4 → 0.0.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.
- data/lib/spanish/orthography.rb +8 -3
- data/lib/spanish/phonology.rb +1 -1
- data/lib/spanish/version.rb +1 -1
- data/test/phonology_test.rb +11 -0
- data/test/test_helper.rb +1 -0
- metadata +5 -9
data/lib/spanish/orthography.rb
CHANGED
@@ -47,7 +47,12 @@ module Spanish
|
|
47
47
|
when "ñ" then get(:palatal, :nasal)
|
48
48
|
when "ó" then get(:close_mid, :back).hint(:primary_stress)
|
49
49
|
when "o" then get(:close_mid, :back)
|
50
|
-
when "p"
|
50
|
+
when "p"
|
51
|
+
if initial? and precedes("s")
|
52
|
+
anticipate {|sound| sound.orthography.insert(0, "p")}
|
53
|
+
else
|
54
|
+
get(:unvoiced, :bilabial, :plosive)
|
55
|
+
end
|
51
56
|
when "q" then get(:unvoiced, :velar, :plosive)
|
52
57
|
when "r" then initial? ? get(:trill) : get(:flap)
|
53
58
|
when "rr" then get(:trill)
|
@@ -71,7 +76,7 @@ module Spanish
|
|
71
76
|
when "v" then get(:voiced, :bilabial, :plosive)
|
72
77
|
when "w" then get(:velar, :approximant)
|
73
78
|
when "x"
|
74
|
-
if initial?
|
79
|
+
if initial? or context("me", "ic") or context("mé", "ic") or context("qui", "ot") # exceptions for "México and Quixote"
|
75
80
|
get(:unvoiced, :velar, :fricative)
|
76
81
|
else
|
77
82
|
[get(:unvoiced, :velar, :plosive), ::Phonology::Sound.new("s")]
|
@@ -105,4 +110,4 @@ module Spanish
|
|
105
110
|
orth
|
106
111
|
end
|
107
112
|
end
|
108
|
-
end
|
113
|
+
end
|
data/lib/spanish/phonology.rb
CHANGED
@@ -30,7 +30,7 @@ module Spanish
|
|
30
30
|
voice if alveolar? and fricative? and precedes(:voiced, :non_vocoid)
|
31
31
|
},
|
32
32
|
:aspiration => ::Phonology::Rule.new {
|
33
|
-
if syllable_final? and alveolar? and fricative? and follows(:vocoid)
|
33
|
+
if syllable_final? and alveolar? and fricative? and follows(:vocoid) and !final?
|
34
34
|
devoice
|
35
35
|
add :glottal
|
36
36
|
add! :approximant
|
data/lib/spanish/version.rb
CHANGED
data/test/phonology_test.rb
CHANGED
@@ -53,6 +53,17 @@ class PhonologyTest < Test::Unit::TestCase
|
|
53
53
|
assert_sound "pinɡwino", "pingüino"
|
54
54
|
end
|
55
55
|
|
56
|
+
test "word-initial ps" do
|
57
|
+
assert_sound "sikoloxia", "psicología"
|
58
|
+
end
|
59
|
+
|
60
|
+
test "x archaism" do
|
61
|
+
assert_sound "mexiko", "México"
|
62
|
+
assert_sound "eksmexikano", "exmexicano"
|
63
|
+
assert_sound "kixote", "Quixote"
|
64
|
+
assert_sound "kixotesko", "quixotesco"
|
65
|
+
end
|
66
|
+
|
56
67
|
test "diphthongs" do
|
57
68
|
assert_sound "buo", "buho"
|
58
69
|
assert_sound "pua", "púa"
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spanish
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 23
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Norman Clarke
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-13 00:00:00 -03:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,12 +25,11 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 15
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
- 0
|
33
|
-
-
|
34
|
-
version: 0.0.
|
31
|
+
- 9
|
32
|
+
version: 0.0.9
|
35
33
|
type: :runtime
|
36
34
|
version_requirements: *id001
|
37
35
|
description: A Spanish phonology, orthography and grammar library for Ruby.
|
@@ -68,7 +66,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
68
66
|
requirements:
|
69
67
|
- - ">="
|
70
68
|
- !ruby/object:Gem::Version
|
71
|
-
hash: 57
|
72
69
|
segments:
|
73
70
|
- 1
|
74
71
|
- 8
|
@@ -79,7 +76,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
76
|
requirements:
|
80
77
|
- - ">="
|
81
78
|
- !ruby/object:Gem::Version
|
82
|
-
hash: 3
|
83
79
|
segments:
|
84
80
|
- 0
|
85
81
|
version: "0"
|