Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/pinyin/string.rb,
lib/pinyin/support.rb
Instance Method Summary collapse
Instance Method Details
#bpmf ⇒ Object
8 9 10 11 12 13 |
# File 'lib/pinyin/string.rb', line 8 def bpmf self.gsub('u:','ü').scan(/[A-Za-züÜ]{1,5}\d/).map do |m| Pinyin.ZhuyinWriter(:marks) << (Pinyin.HanyuReader(:numbers) << m.downcase) end.join(' ') end |
#chars ⇒ Object
2 3 4 |
# File 'lib/pinyin/support.rb', line 2 def chars self.unpack('U*').map{|c| [c].pack('U')} end |