Class: Pinyin::Initial

Inherits:
Object
  • Object
show all
Defined in:
lib/pinyin/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

Instance Method Summary collapse

Constructor Details

#initialize(n) ⇒ Initial

Returns a new instance of Initial.



16
17
18
# File 'lib/pinyin/groundwork.rb', line 16

def initialize(n)
  @name=n
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



15
16
17
# File 'lib/pinyin/groundwork.rb', line 15

def name
  @name
end

Instance Method Details

#+(f) ⇒ Object



39
40
41
# File 'lib/pinyin/groundwork.rb', line 39

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

#inspectObject



43
44
45
# File 'lib/pinyin/groundwork.rb', line 43

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