Module: Spinying::CoreExt

Defined in:
lib/spinying/core_ext.rb

Class Method Summary collapse

Class Method Details

.get_pinying(word) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/spinying/core_ext.rb', line 6

def self.get_pinying(word)
  pingying = ""
  word.each_codepoint do |codepoint|
    pingying << (hanzi?(codepoint) ? ZHUNICODETABLE[codepoint-ZHUNICODESTART] : codepoint)
  end
  return pingying.downcase
end