Module: ICU::Transliteration

Defined in:
lib/ffi-icu/transliteration.rb

Defined Under Namespace

Classes: Transliterator

Class Method Summary collapse

Class Method Details

.available_idsObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/ffi-icu/transliteration.rb', line 11

def available_ids
  enum_ptr = Lib.check_error do |error|
    Lib.utrans_openIDs(error)
  end

  result = Lib.enum_ptr_to_array(enum_ptr)
  Lib.uenum_close(enum_ptr)

  result
end

.transliterate(translit_id, str, rules = nil) ⇒ Object Also known as: translit



5
6
7
8
# File 'lib/ffi-icu/transliteration.rb', line 5

def transliterate(translit_id, str, rules = nil)
  t = Transliterator.new translit_id, rules
  t.transliterate str
end