phonology 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/lib/phonology/ipa.rb CHANGED
@@ -4,7 +4,7 @@ module Phonology
4
4
  extend self
5
5
 
6
6
  def primary_stress
7
- "\u02c8"
7
+ "ˈ"
8
8
  end
9
9
 
10
10
  end
@@ -8,6 +8,11 @@ module Phonology
8
8
  last_sound.__send__(sym, *args, &block)
9
9
  end
10
10
 
11
+ def context(before, after)
12
+ string.downcase[offset - before.length, before.length] == before &&
13
+ string.downcase[offset + 1, after.length] == after
14
+ end
15
+
11
16
  def anticipate(&block)
12
17
  @anticipation = block
13
18
  nil
@@ -36,6 +41,10 @@ module Phonology
36
41
  false
37
42
  end
38
43
 
44
+ def offset
45
+ @index
46
+ end
47
+
39
48
  def between(before, after)
40
49
  follows(*before) && precedes(*after)
41
50
  end
@@ -34,11 +34,11 @@ module Phonology
34
34
 
35
35
  def sonority
36
36
  case
37
- when vocalic? then 5
37
+ when vocalic? then 5
38
38
  when approximant? then 4
39
- when liquid? then 3
40
- when nasal? then 2
41
- when fricative? then 1
39
+ when liquid? then 3
40
+ when nasal? then 2
41
+ when fricative? then 1
42
42
  else 0
43
43
  end
44
44
  end
@@ -160,7 +160,7 @@ module Phonology
160
160
  end
161
161
 
162
162
 
163
- # A sound which begins plosive and finished fricative.
163
+ # A sound which begins plosive and finishes fricative.
164
164
  class Affricate
165
165
 
166
166
  include SoundBase
@@ -1,3 +1,3 @@
1
1
  module Phonology
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 8
9
- version: 0.0.8
8
+ - 9
9
+ version: 0.0.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Norman Clarke
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-10 00:00:00 -03:00
17
+ date: 2010-07-13 00:00:00 -03:00
18
18
  default_executable:
19
19
  dependencies: []
20
20