Class: Runglish::RusToLatConverter

Inherits:
Converter
  • Object
show all
Defined in:
lib/runglish.rb

Instance Method Summary collapse

Methods inherited from Converter

#transliterate

Constructor Details

#initializeRusToLatConverter

Returns a new instance of RusToLatConverter.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/runglish.rb', line 46

def initialize
  lower_single = {
    "і"=>"i", "ґ"=>"g", "ё"=>"yo", ""=>"#", "є"=>"e", "ї"=>"yi",
    "а"=>"a", "б"=>"b", "в"=>"v", "г"=>"g", "д"=>"d", "е"=>"e", "ж"=>"zh",
    "з"=>"z", "и"=>"i", "й"=>"y", "к"=>"k", "л"=>"l", "м"=>"m", "н"=>"n", "о"=>"o", "п"=>"p", "р"=>"r",
    "с"=>"s", "т"=>"t", "у"=>"u", "ф"=>"f", "х"=>"h", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh", "щ"=>"sch",
    "ъ"=>"'", "ы"=>"y", "ь"=>"", "э"=>"e", "ю"=>"yu", "я"=>"ya"
  }

  lower_multi = {
    "ье"=>"ie",
    "ьё"=>"ie"
  }

  upper_single = {
    "Ґ"=>"G", "Ё"=>"YO", "Є"=>"E", "Ї"=>"YI", "І"=>"I",
    "А"=>"A", "Б"=>"B", "В"=>"V", "Г"=>"G", "Д"=>"D", "Е"=>"E", "Ж"=>"ZH",
    "З"=>"Z", "И"=>"I", "Й"=>"Y", "К"=>"K", "Л"=>"L", "М"=>"M", "Н"=>"N", "О"=>"O", "П"=>"P", "Р"=>"R",
    "С"=>"S", "Т"=>"T", "У"=>"U", "Ф"=>"F", "Х"=>"H", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH", "Щ"=>"SCH",
    "Ъ"=>"'", "Ы"=>"Y", "Ь"=>"", "Э"=>"E", "Ю"=>"YU", "Я"=>"YA"
  }

  upper_multi = {
    "ЬЕ"=>"IE",
    "ЬЁ"=>"IE"
  }

  super(lower_single, lower_multi, upper_single, upper_multi)
end