class ICU::Transliterator

Overview

Text Transformation Transliteration

Usage

trans = ICU::Transliterator.new({from: "Greek", to: "Latin"})
trans.transliterate("Αλφαβητικός Κατάλογος") # => "Alphabētikós Katálogos"

trans = ICU::Transliterator.new("Katakana-Hiragana")
trans.transliterate("ミヤモト ムサシ") # => "みやもと むさし"

See also

Defined in:

icu/transliterator.cr

Constant Summary

IDS = begin ids = (0...LibICU.utrans_count_available_i_ds).map do |i| buf = Bytes.new(50) size = LibICU.utrans_get_available_id(i, buf, buf.size) str2id(String.new(buf[0, size])) end Set(ID).new(ids) end

The list of available transliterators

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(id : ID, rules : String) #

[View source]
def self.new(id : String, rules : String) #

[View source]
def self.new(id : ID) #

[View source]
def self.new(id : String) #

[View source]

Class Method Detail

def self.id2str(id : ID) : String #

[View source]
def self.str2id(idstr : String) : ID #

[View source]

Instance Method Detail

def finalize #

[View source]
def reverse! #

[View source]
def to_unsafe : Pointer(Pointer(Void)) #

[View source]
def transliterate(text : String) : String #

Transliterates text

trans = ICU::Transliterator.new({from: "Greek", to: "Latin})
trans.transliterate("Αλφαβητικός Κατάλογος") # => "Alphabētikós Katálogos"

[View source]