module ZhongwenTools::Romanization::TongyongPinyin

Public Class Methods

split(str) click to toggle source
# File lib/zhongwen_tools/romanization/tongyong_pinyin.rb, line 16
def self.split(str)
  regex = /(#{ ZhongwenTools::Romanization.detect_regex(:typy) }*)/
  ZhongwenTools::Romanization.split_romanization(str, regex)
end
to_typy(*args) click to toggle source
# File lib/zhongwen_tools/romanization/tongyong_pinyin.rb, line 4
def self.to_typy(*args)
  str, from = args
  from ||= ZhongwenTools::Romanization.romanization?(str)

  ZhongwenTools::Romanization.convert str, :typy, from.to_sym
end
typy?(str) click to toggle source
# File lib/zhongwen_tools/romanization/tongyong_pinyin.rb, line 11
def self.typy?(str)
  regex = ZhongwenTools::Romanization.detect_regex(:typy)
  ZhongwenTools::Romanization.detect_romanization(str, regex)
end