Module: ZhongwenTools::StringExtension
- Defined in:
- lib/zhongwen_tools/string_extension.rb
Instance Method Summary collapse
- #ascii? ⇒ Boolean
- #bpmf? ⇒ Boolean
- #capitalize ⇒ Object
- #from_codepoint ⇒ Object
- #fullwidth? ⇒ Boolean
- #halfwidth? ⇒ Boolean
- #has_zh? ⇒ Boolean
- #has_zh_punctuation? ⇒ Boolean
- #mps2? ⇒ Boolean
- #multibyte? ⇒ Boolean
- #py? ⇒ Boolean
- #pyn? ⇒ Boolean
- #romanization? ⇒ Boolean
- #split_romanization ⇒ Object
- #strip_zh_punctuation ⇒ Object
- #to_bpmf(from = nil) ⇒ Object (also: #to_zyfh, #to_zhyfh, #to_bopomofo)
- #to_codepoint ⇒ Object
- #to_halfwidth ⇒ Object
- #to_mps2(from = nil) ⇒ Object
- #to_pinyin(from = nil) ⇒ Object (also: #to_py)
- #to_pyn(from = nil) ⇒ Object
- #to_typy(from = nil) ⇒ Object (also: #to_tongyong, #to_tongyong_pinyin)
- #to_wg(from = nil) ⇒ Object (also: #to_wade_giles)
- #to_yale(from = nil) ⇒ Object
- #to_zhcn ⇒ Object
- #to_zhhk ⇒ Object
- #to_zhs ⇒ Object
- #to_zht ⇒ Object
- #to_zhtw ⇒ Object
- #typy? ⇒ Boolean
- #uri_encode ⇒ Object
- #uri_escape ⇒ Object
- #wg? ⇒ Boolean
- #yale? ⇒ Boolean
- #zh? ⇒ Boolean
- #zh_downcase ⇒ Object
- #zh_upcase ⇒ Object
- #zhs? ⇒ Boolean
- #zht? ⇒ Boolean
Instance Method Details
#ascii? ⇒ Boolean
41 42 43 |
# File 'lib/zhongwen_tools/string_extension.rb', line 41 def ascii? ZhongwenTools::Unicode.ascii?(self) end |
#bpmf? ⇒ Boolean
116 117 118 |
# File 'lib/zhongwen_tools/string_extension.rb', line 116 def bpmf? ZhongwenTools::Romanization::ZhuyinFuhao.bpmf?(self) end |
#capitalize ⇒ Object
5 6 7 |
# File 'lib/zhongwen_tools/string_extension.rb', line 5 def capitalize ZhongwenTools::Caps.capitalize(self) end |
#from_codepoint ⇒ Object
65 66 67 |
# File 'lib/zhongwen_tools/string_extension.rb', line 65 def from_codepoint ZhongwenTools::Unicode.from_codepoint(self) end |
#fullwidth? ⇒ Boolean
53 54 55 |
# File 'lib/zhongwen_tools/string_extension.rb', line 53 def fullwidth? ZhongwenTools::Fullwidth.fullwidth?(self) end |
#halfwidth? ⇒ Boolean
49 50 51 |
# File 'lib/zhongwen_tools/string_extension.rb', line 49 def halfwidth? ZhongwenTools::Fullwidth.halfwidth?(self) end |
#has_zh? ⇒ Boolean
17 18 19 |
# File 'lib/zhongwen_tools/string_extension.rb', line 17 def has_zh? ZhongwenTools::Zhongwen.has_zh?(self) end |
#has_zh_punctuation? ⇒ Boolean
21 22 23 |
# File 'lib/zhongwen_tools/string_extension.rb', line 21 def has_zh_punctuation? ZhongwenTools::Zhongwen.has_zh_punctuation?(self) end |
#mps2? ⇒ Boolean
132 133 134 |
# File 'lib/zhongwen_tools/string_extension.rb', line 132 def mps2? ZhongwenTools::Romanization::MPS2.mps2?(self) end |
#multibyte? ⇒ Boolean
45 46 47 |
# File 'lib/zhongwen_tools/string_extension.rb', line 45 def multibyte? ZhongwenTools::Unicode.multibyte?(self) end |
#py? ⇒ Boolean
108 109 110 |
# File 'lib/zhongwen_tools/string_extension.rb', line 108 def py? ZhongwenTools::Romanization::Pinyin.py?(self) end |
#pyn? ⇒ Boolean
112 113 114 |
# File 'lib/zhongwen_tools/string_extension.rb', line 112 def pyn? ZhongwenTools::Romanization::Pinyin.pyn?(self) end |
#romanization? ⇒ Boolean
136 137 138 |
# File 'lib/zhongwen_tools/string_extension.rb', line 136 def romanization? ZhongwenTools::Romanization.romanization?(self) end |
#split_romanization ⇒ Object
140 141 142 |
# File 'lib/zhongwen_tools/string_extension.rb', line 140 def split_romanization ZhongwenTools::Romanization.split(self) end |
#strip_zh_punctuation ⇒ Object
29 30 31 |
# File 'lib/zhongwen_tools/string_extension.rb', line 29 def strip_zh_punctuation ZhongwenTools::Zhongwen.strip_zh_punctuation(self) end |
#to_bpmf(from = nil) ⇒ Object Also known as: to_zyfh, to_zhyfh, to_bopomofo
79 80 81 |
# File 'lib/zhongwen_tools/string_extension.rb', line 79 def to_bpmf(from = nil) ZhongwenTools::Romanization::ZhuyinFuhao::to_bpmf(self, from) end |
#to_codepoint ⇒ Object
61 62 63 |
# File 'lib/zhongwen_tools/string_extension.rb', line 61 def to_codepoint ZhongwenTools::Unicode.to_codepoint(self) end |
#to_halfwidth ⇒ Object
57 58 59 |
# File 'lib/zhongwen_tools/string_extension.rb', line 57 def to_halfwidth ZhongwenTools::Fullwidth.to_halfwidth(self) end |
#to_mps2(from = nil) ⇒ Object
104 105 106 |
# File 'lib/zhongwen_tools/string_extension.rb', line 104 def to_mps2(from = nil) ZhongwenTools::Romanization::MPS2::to_mps2(self, from) end |
#to_pinyin(from = nil) ⇒ Object Also known as: to_py
69 70 71 |
# File 'lib/zhongwen_tools/string_extension.rb', line 69 def (from = nil) ZhongwenTools::Romanization::Pinyin::to_py(self, from) end |
#to_pyn(from = nil) ⇒ Object
75 76 77 |
# File 'lib/zhongwen_tools/string_extension.rb', line 75 def to_pyn(from = nil) ZhongwenTools::Romanization::Pinyin::to_pyn(self, from) end |
#to_typy(from = nil) ⇒ Object Also known as: to_tongyong, to_tongyong_pinyin
97 98 99 |
# File 'lib/zhongwen_tools/string_extension.rb', line 97 def to_typy(from = nil) ZhongwenTools::Romanization::TongyongPinyin::to_typy(self, from) end |
#to_wg(from = nil) ⇒ Object Also known as: to_wade_giles
87 88 89 |
# File 'lib/zhongwen_tools/string_extension.rb', line 87 def to_wg(from = nil) ZhongwenTools::Romanization::WadeGiles::to_wg(self, from) end |
#to_yale(from = nil) ⇒ Object
93 94 95 |
# File 'lib/zhongwen_tools/string_extension.rb', line 93 def to_yale(from = nil) ZhongwenTools::Romanization::Yale::to_yale(self, from) end |
#to_zhcn ⇒ Object
152 153 154 |
# File 'lib/zhongwen_tools/string_extension.rb', line 152 def to_zhcn ZhongwenTools::Script.to_zhs(self, :zhcn) end |
#to_zhhk ⇒ Object
156 157 158 |
# File 'lib/zhongwen_tools/string_extension.rb', line 156 def to_zhhk ZhongwenTools::Script.to_zht(self, :zhhk) end |
#to_zhs ⇒ Object
160 161 162 |
# File 'lib/zhongwen_tools/string_extension.rb', line 160 def to_zhs ZhongwenTools::Script.to_zhs(self, :zhs) end |
#to_zht ⇒ Object
164 165 166 |
# File 'lib/zhongwen_tools/string_extension.rb', line 164 def to_zht ZhongwenTools::Script.to_zht(self, :zht) end |
#to_zhtw ⇒ Object
168 169 170 |
# File 'lib/zhongwen_tools/string_extension.rb', line 168 def to_zhtw ZhongwenTools::Script.to_zht(self, :zhtw) end |
#typy? ⇒ Boolean
128 129 130 |
# File 'lib/zhongwen_tools/string_extension.rb', line 128 def typy? ZhongwenTools::Romanization::TongyongPinyin.typy?(self) end |
#uri_encode ⇒ Object
33 34 35 |
# File 'lib/zhongwen_tools/string_extension.rb', line 33 def uri_encode ZhongwenTools::URI.encode(self) end |
#uri_escape ⇒ Object
37 38 39 |
# File 'lib/zhongwen_tools/string_extension.rb', line 37 def uri_escape ZhongwenTools::URI.escape(self) end |
#wg? ⇒ Boolean
120 121 122 |
# File 'lib/zhongwen_tools/string_extension.rb', line 120 def wg? ZhongwenTools::Romanization::WadeGiles.wg?(self) end |
#yale? ⇒ Boolean
124 125 126 |
# File 'lib/zhongwen_tools/string_extension.rb', line 124 def yale? ZhongwenTools::Romanization::Yale.yale?(self) end |
#zh? ⇒ Boolean
25 26 27 |
# File 'lib/zhongwen_tools/string_extension.rb', line 25 def zh? ZhongwenTools::Zhongwen.zh?(self) end |
#zh_downcase ⇒ Object
9 10 11 |
# File 'lib/zhongwen_tools/string_extension.rb', line 9 def zh_downcase ZhongwenTools::Caps.downcase(self) end |
#zh_upcase ⇒ Object
13 14 15 |
# File 'lib/zhongwen_tools/string_extension.rb', line 13 def zh_upcase ZhongwenTools::Caps.upcase(self) end |
#zhs? ⇒ Boolean
144 145 146 |
# File 'lib/zhongwen_tools/string_extension.rb', line 144 def zhs? ZhongwenTools::Script.zhs?(self) end |
#zht? ⇒ Boolean
148 149 150 |
# File 'lib/zhongwen_tools/string_extension.rb', line 148 def zht? ZhongwenTools::Script.zht?(self) end |