Class: CodyRobbins::Syllabify::Syllable

Inherits:
Object
  • Object
show all
Defined in:
lib/cody_robbins/syllabify/syllable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codaObject (readonly)

The coda (κ) of the syllable.



16
17
18
# File 'lib/cody_robbins/syllabify/syllable.rb', line 16

def coda
  @coda
end

#nucleusObject (readonly)

The nucleus (ν) of the syllable.



13
14
15
# File 'lib/cody_robbins/syllabify/syllable.rb', line 13

def nucleus
  @nucleus
end

#onsetObject (readonly)

The onset (ω) of the syllable.



10
11
12
# File 'lib/cody_robbins/syllabify/syllable.rb', line 10

def onset
  @onset
end

#stressObject (readonly)

Any stress marks associated with the syllable as a whole.



7
8
9
# File 'lib/cody_robbins/syllabify/syllable.rb', line 7

def stress
  @stress
end

Instance Method Details

#to_sString

Joins the stress, onset, nucleus, and coda to form a single string representation of the syllable.

Examples:

CodyRobbins::Syllabify.new(:en, 'dɪˌsɔrgənəˈze͡ɪʃən').syllables[4].to_s #=> 'ˈze͡ɪ'

Returns:

  • (String)


32
33
34
# File 'lib/cody_robbins/syllabify/syllable.rb', line 32

def to_s
  join(stress, onset, nucleus, coda)
end