Module: ZhongwenTools::Romanization::TongyongPinyin
- Defined in:
- lib/zhongwen_tools/romanization/tongyong_pinyin.rb
Class Method Summary collapse
Class Method Details
.split(str) ⇒ Object
16 17 18 19 |
# 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) ⇒ Object
4 5 6 7 8 9 |
# 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) ⇒ Boolean
11 12 13 14 |
# 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 |