class Ting::Syllable

Combination of an initial and a final, a tone, and possible capitalization A tone of 'nil' means the tone is not specified

Attributes

capitalized[RW]
capitalized?[RW]
final[RW]
initial[RW]
tone[RW]

Public Class Methods

illegal?(i,f) click to toggle source
# File lib/ting/groundwork.rb, line 106
def self.illegal?(i,f)
  ILLEGAL_COMBINATIONS.any? {|in_gr, fin_gr| in_gr.include?(i) && fin_gr.include?(f)}
end
new(initial, final, tone = nil, capitalized = false) click to toggle source
# File lib/ting/groundwork.rb, line 89
def initialize(initial, final, tone = nil, capitalized = false)
  self.initial     = initial
  self.final       = final
  self.tone        = tone
  self.capitalized = capitalized
end

Public Instance Methods

+(tone) click to toggle source
# File lib/ting/groundwork.rb, line 96
def +(tone)
  self.class.new(self.initial, self.final, tone, self.capitalized)
end
==( other ) click to toggle source
# File lib/ting/groundwork.rb, line 112
def ==( other )
  return false unless other.is_a? Syllable

  [ other.initial, other.final, other.tone, other.capitalized ] ==
    [ self.initial, self.final, self.tone, self.capitalized ]
end
inspect() click to toggle source
# File lib/ting/groundwork.rb, line 100
def inspect
  "<#{self.class.name} <initial=#{initial.name}, final=#{final.name}, tone=#{tone}#{', capitalized' if capitalized}>>"
end
Also aliased as: to_s
to_s()
Alias for: inspect