module CharUtil

Extended Modules

Defined in:

util/char_util.cr

Constant Summary

CANONICAL = {'\u00A0' => '\u3000', '\u2002' => '\u3000', '\u2003' => '\u3000', '\u2004' => '\u3000', '\u2007' => '\u3000', '\u2008' => '\u3000', '\u205F' => '\u3000', ' ' => '\u3000', '⟨' => '〈', '⟩' => '〉', '︱' => '|', '︳' => '|', '﹒' => '.', '﹐' => ',', '﹑' => '、', '、' => '、', '・' => '‧', '·' => '‧', '•' => '‧', '‵' => '`', '﹤' => '<', '﹥' => '>', '╴' => '_', '︰' => ':', '∶' => ':', '﹕' => ':', '﹔' => ';', '﹖' => '?', '﹗' => '!', '﹙' => '(', '﹚' => ')', '﹛' => '{', '﹜' => '}', '【' => '[', '﹝' => '[', '】' => ']', '﹞' => ']', '﹟' => '#', '﹠' => '&', '﹡' => '*', '﹢' => '+', '—' => '-', '﹣' => '-', 'ˉ' => '-', '¯' => '-', '「' => '“', '」' => '”', '『' => '‘', '』' => '’', '∧' => '︿', '∨' => '﹀', '﹦' => '=', '﹩' => '$', '﹪' => '%', '﹫' => '@', '¨' => '‥', '⦅' => '(', '⦆' => ')', '≒' => '≈', '≦' => '≤', '≧' => '≥'}
HANNUM_CHARS = {'零', '〇', '一', '两', '二', '三', '四', '五', '六', '七', '八', '九', '十', '百', '千', '万', '亿', '兆'}
HANNUM_VALUE = {'零' => 0, '两' => 2, '〇' => 0, '一' => 1, '二' => 2, '三' => 3, '四' => 4, '五' => 5, '六' => 6, '七' => 7, '八' => 8, '九' => 9, '十' => 10, '百' => 100, '千' => 1000, '万' => 10000, '亿' => 100000000, '兆' => 1000000000000_i64}
NORMALIZE = {'〈' => '⟨', '〉' => '⟩', '《' => '⟨', '》' => '⟩', '\u3000' => ' ', 'ˉ' => '¯', '‥' => '¨', '‧' => '·', '•' => '·', '‵' => '`', '。' => '.', '﹒' => '.', '﹐' => ',', '﹑' => ',', '、' => ',', '︰' => ':', '∶' => ':', '﹔' => ';', '﹕' => ':', '﹖' => '?', '﹗' => '!', '﹙' => '(', '﹚' => ')', '﹛' => '{', '﹜' => '}', '【' => '[', '﹝' => '[', '】' => ']', '﹞' => ']', '﹟' => '#', '﹠' => '&', '﹡' => '*', '﹢' => '+', '﹣' => '-', '﹤' => '<', '﹥' => '>', '﹦' => '=', '﹩' => '$', '﹪' => '%', '﹫' => '@', '≒' => '≈', '≦' => '≤', '≧' => '≥', '︱' => '|', '︳' => '|', '︿' => '∧', '﹀' => '∨', '╴' => '_', '「' => '“', '」' => '”', '『' => '‘', '』' => '’', '⦅' => '(', '⦆' => ')'}

Instance Method Summary

Instance Method Detail

def digit_to_int(char : Char) #

[View source]
def downcase_normalize(char : Char) : Char #

[View source]
def fullwidth?(char : Char) #

[View source]
def fw_alnum?(char : Char) #

[View source]
def fw_alpha?(char : Char) #

[View source]
def fw_digit?(char : Char) #

[View source]
def halfwidth?(char : Char) #

[View source]
def hannum?(char : Char) #

[View source]
def hanzi_to_int(char : Char) #

[View source]
def hw_alnum?(char : Char) #

[View source]
def hw_alpha?(char : Char) #

[View source]
def hw_digit?(char : Char) #

[View source]
def normalize(str : String) : String #

[View source]
def normalize(char : Char) : Char #

[View source]
def to_canon(char : Char, upcase : Bool = false) : Char #

convert input to fullwidth form


[View source]
def to_canon(str : String, upcase : Bool = false) : String #

convert input to fullwidth form


[View source]
def to_fullwidth(char : Char) #

[View source]
def to_halfwidth(char : Char) #

[View source]
def to_halfwidth(str : String) #

[View source]