Class: Pinyin::TonelessSyllable
- Inherits:
-
Object
- Object
- Pinyin::TonelessSyllable
- Defined in:
- lib/pinyin/groundwork.rb
Overview
Combination of an initial and a final Not to be confused with a syllable that has the neutral tone
Direct Known Subclasses
Instance Attribute Summary collapse
-
#final ⇒ Object
Returns the value of attribute final.
-
#initial ⇒ Object
Returns the value of attribute initial.
Class Method Summary collapse
Instance Method Summary collapse
- #+(tone) ⇒ Object
-
#initialize(initial, final) ⇒ TonelessSyllable
constructor
A new instance of TonelessSyllable.
- #inspect ⇒ Object (also: #to_s)
Constructor Details
#initialize(initial, final) ⇒ TonelessSyllable
Returns a new instance of TonelessSyllable.
89 90 91 92 |
# File 'lib/pinyin/groundwork.rb', line 89 def initialize(initial, final) self.initial = initial self.final = final end |
Instance Attribute Details
#final ⇒ Object
Returns the value of attribute final.
87 88 89 |
# File 'lib/pinyin/groundwork.rb', line 87 def final @final end |
#initial ⇒ Object
Returns the value of attribute initial.
87 88 89 |
# File 'lib/pinyin/groundwork.rb', line 87 def initial @initial end |
Class Method Details
.illegal?(i, f) ⇒ Boolean
102 103 104 |
# File 'lib/pinyin/groundwork.rb', line 102 def self.illegal?(i,f) ILLEGAL_COMBINATIONS.any? {|in_gr, fin_gr| in_gr.include?(i) && fin_gr.include?(f)} end |
Instance Method Details
#+(tone) ⇒ Object
94 95 96 |
# File 'lib/pinyin/groundwork.rb', line 94 def +(tone) Syllable.new(initial, final, tone) end |
#inspect ⇒ Object Also known as: to_s
98 99 100 |
# File 'lib/pinyin/groundwork.rb', line 98 def inspect "<#{self.class.name} <initial=#{initial.name}, final=#{final.name}>>" end |