Class: Ting::Initial

Inherits:
Object
  • Object
show all
Extended by:
Enumerable
Defined in:
lib/ting/groundwork.rb

Overview

A Chinese initial (start of a syllable)

Constant Summary collapse

All =
%w(
Empty Bo Po Mo Fo De Te Ne Le Ge Ke He
Ji Qi Xi Zhi Chi Shi Ri Zi Ci Si
).map{|c| const_set c, Initial.new(c)}
Groups =
[
 Group_0=[ Empty ],
 Group_1=[ Bo,Po,Mo,Fo],     #Bilabial and Labio-dental
 Group_2=[ De,Te,Ne,Le ],    #Plosive, nasal and lateral approximant alveolar
 Group_3=[ Ge,Ke,He ],       #Velar
 Group_4=[ Ji,Qi,Xi ],       #Alveolo-palatal
 Group_5=[ Zhi,Chi,Shi,Ri ], #Retroflex
 Group_6=[ Zi,Ci,Si ],       #Fricative and affricate alveolar
]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n) ⇒ Initial

Returns a new instance of Initial.



19
# File 'lib/ting/groundwork.rb', line 19

def initialize(n) ; @name=n ; end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



17
18
19
# File 'lib/ting/groundwork.rb', line 17

def name
  @name
end

Class Method Details

.each(&blk) ⇒ Object



29
# File 'lib/ting/groundwork.rb', line 29

def each(&blk) ; All.each(&blk) ; end

Instance Method Details

#+(f) ⇒ Object



42
43
44
# File 'lib/ting/groundwork.rb', line 42

def +(f)
  Syllable.new(self,f)
end

#inspectObject



46
# File 'lib/ting/groundwork.rb', line 46

def inspect() ; "<#{self.class.name}::#{@name}>" ; end