Module: Charwidth::ClassMethods
- Included in:
- Charwidth
- Defined in:
- lib/charwidth.rb
Instance Method Summary collapse
-
#normalize(string, options = {}) ⇒ Object
Normalize Unicode fullwidth / halfwidth (zenkaku / hankaku) characters options: { only: [:ascii, :white_parenthesis, :cjk_punctuation, :katakana, :space], except: [:ascii, :white_parenthesis, :cjk_punctuation, :katakana, :space] }.
-
#normalize!(string, options = {}) ⇒ Object
Normalize Unicode fullwidth / halfwidth (zenkaku / hankaku) characters (destructive).
Instance Method Details
#normalize(string, options = {}) ⇒ Object
Normalize Unicode fullwidth / halfwidth (zenkaku / hankaku) characters options:
only: [:ascii, :white_parenthesis, :cjk_punctuation, :katakana, :space],
except: [:ascii, :white_parenthesis, :cjk_punctuation, :katakana, :space]
14 15 16 |
# File 'lib/charwidth.rb', line 14 def normalize(string, = {}) normalize!(string.dup, ) end |
#normalize!(string, options = {}) ⇒ Object
Normalize Unicode fullwidth / halfwidth (zenkaku / hankaku) characters (destructive)
19 20 21 22 |
# File 'lib/charwidth.rb', line 19 def normalize!(string, = {}) unify_voiced_katakana!(string) normalize_charwidth!(string, ) end |