Module: Phonology::SoundBase
Instance Attribute Summary collapse
-
#features ⇒ Object
readonly
Returns the value of attribute features.
-
#hints ⇒ Object
readonly
Orthography hints that can be useful to consult when applying rules.
-
#orthography ⇒ Object
Returns the value of attribute orthography.
-
#syllable ⇒ Object
Returns the value of attribute syllable.
Instance Method Summary collapse
-
#backness ⇒ Object
Get the sound’s backness.
-
#coarticulated? ⇒ Boolean
Does the sound have more than one place of articulation?.
- #codepoints ⇒ Object
- #exists? ⇒ Boolean
-
#height ⇒ Object
Get the sound’s height.
-
#hint(*args) ⇒ Object
TODO set up list of valid hints.
-
#manner ⇒ Object
Get the sound’s manner of articulation.
-
#place ⇒ Object
Get the sound’s place of articulation.
-
#place_groups ⇒ Object
Get the place groups (:coronal, :dorsal, etc).
- #sonority ⇒ Object
-
#symbol ⇒ Object
Get the IPA codepoints for the sound, including any diacritics.
Instance Attribute Details
#features ⇒ Object
Returns the value of attribute features.
5 6 7 |
# File 'lib/phonology/sound.rb', line 5 def features @features end |
#hints ⇒ Object
Orthography hints that can be useful to consult when applying rules.
47 48 49 |
# File 'lib/phonology/sound.rb', line 47 def hints @hints end |
#orthography ⇒ Object
Returns the value of attribute orthography.
5 6 7 |
# File 'lib/phonology/sound.rb', line 5 def orthography @orthography end |
#syllable ⇒ Object
Returns the value of attribute syllable.
5 6 7 |
# File 'lib/phonology/sound.rb', line 5 def syllable @syllable end |
Instance Method Details
#backness ⇒ Object
Get the sound’s backness.
95 96 97 |
# File 'lib/phonology/sound.rb', line 95 def backness features.intersection(Features::BACKNESS) end |
#coarticulated? ⇒ Boolean
Does the sound have more than one place of articulation?
75 76 77 |
# File 'lib/phonology/sound.rb', line 75 def coarticulated? place.size > 1 end |
#codepoints ⇒ Object
61 62 63 |
# File 'lib/phonology/sound.rb', line 61 def codepoints raise NotImplementedError end |
#exists? ⇒ Boolean
65 66 67 |
# File 'lib/phonology/sound.rb', line 65 def exists? raise NotImplementedError end |
#height ⇒ Object
Get the sound’s height.
90 91 92 |
# File 'lib/phonology/sound.rb', line 90 def height features.intersection(Features::HEIGHT) end |
#hint(*args) ⇒ Object
TODO set up list of valid hints
52 53 54 55 |
# File 'lib/phonology/sound.rb', line 52 def hint(*args) self.hints += args.flatten self end |
#manner ⇒ Object
Get the sound’s manner of articulation.
85 86 87 |
# File 'lib/phonology/sound.rb', line 85 def manner features.intersection(Features::MANNER) end |
#place ⇒ Object
Get the sound’s place of articulation.
80 81 82 |
# File 'lib/phonology/sound.rb', line 80 def place features.intersection(Features::PLACE) end |
#place_groups ⇒ Object
Get the place groups (:coronal, :dorsal, etc). Normally there should only be one.
100 101 102 |
# File 'lib/phonology/sound.rb', line 100 def place_groups Features.place_groups(features) end |
#sonority ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/phonology/sound.rb', line 35 def sonority case when vocalic? then 5 when approximant? then 4 when liquid? then 3 when nasal? then 2 when fricative? then 1 else 0 end end |
#symbol ⇒ Object
Get the IPA codepoints for the sound, including any diacritics.
70 71 72 |
# File 'lib/phonology/sound.rb', line 70 def symbol codepoints.pack("U*") end |