metadata {

authority_id: mvd
id: 2008
language: iso-639-2:bel
source_script: Cyrl
destination_script: Latn
name: Transliteration system for Belarusian names in the population register (2008)
url:
creation_date: 2008

description: |
  RESOLUTION OF THE MINISTRY OF INTERNAL AFFAIRS OF THE REPUBLIC OF BELARUS
  October 9, 2008, No. 288
  8/19678 (10.23.2008)
  About 8/19678 approval of the Instructions for transliteration of surnames and proper names of citizens of
  the Republic of Belarus when their personal data is included in the population register

notes:
  # Original notes
  # - |
  #   Инструкция по транслитерации фамилий и собственных имен граждан Республики Беларусь при включении
  #   их персональных данных в регистр населения устанавливает правила передачи с белорусской либо русской формы
  #   написания на латиницу при включении фамилий и собственных имен граждан Республики Беларусь в регистр населения.
  # - |
  #   Передача фамилий и собственных имен граждан Республики Беларусь на латиницу осуществляется с их правильного
  #   написания на белорусском либо русском языке, за свидетельствованного документами, удостоверяющими личность.
  # - Передача фамилий и собственных имен граждан Республики Беларусь осуществляется путем транслитерации
  #   литер (букв, знаков) белорусского либорусского написания соответствующими литерами латиницы.
  # - Транслитерацией достигается общность и унифицированность системы латинизированного написания,
  #   позволяющей пользоваться ею во всех латинопишущих государствах.
  # - Смягчение согласной буквы, обозначенное мягким знаком, в белорусской латинице следует показывать
  #   диакритическим знаком (́), который располагается над соответствующей буквой: дзь – dź, зь – ź, ль – ĺ,
  #   нь – ń, сь – ś, ць – ć.
  # - Правила транслитерации букв белорусского и русского алфавитов соответствующими буквами латиницы
  #   приведены в таблице транслитерации букв белорусского и русского алфавитов буквами латиницы соглас
  #   но приложению к настоящей Инструкции.
  # - Сложные и составные фамилии и собственные имена, пишущиеся слитно, раздельно или через дефис,
  #   сохраняют слитное, раздельное или дефисное написание и в латинице.
  - | # 1
    Instructions for transliterating the names and first names of citizens of the Republic of Belarus
    when including their personal data in the population register sets the rules for transferring
    from the Belarusian or Russian form of writing in Latin when including the names and first names
    of citizens of the Republic of Belarus in the population register.
  - | # 2
    Transfer of surnames and proper names of citizens of the Republic of Belarus to the Latin alphabet
    is carried out with their correct spelling in Belarusian or Russian, for evidence of identity documents.
  - | # 3
    The transfer of surnames and proper names of citizens of the Republic of Belarus is carried out by
    transliteration of the letters (letters, signs) of the Belarusian or Russian spelling in the corresponding
    Latin letters.
  - | # 4
    Transliteration achieves the generality and unification of the system of Latinized writing,
    which allows it to be used in all Latin-writing countries.
  - | # 5
    The softening of the consonant, indicated by a soft sign, in the Belarusian Latin should be shown
    with a diacritic mark (́), which is located above the corresponding letter:
      дзь - dź,
      зь - ź,
      ль - ĺ,
      нь - ń,
      сь - ś,
      ць - ć.
  # 6
  - The rules for transliterating letters of the Belarusian and Russian alphabets with the corresponding
    letters of the Latin alphabet are given in the table of transliteration of letters of the Belarusian
    and Russian alphabets with the Latin letters according to the appendix to this Instruction.
  # 7
  - Compound and compound surnames and proper names, spelled together, separately or through a hyphen,
    keep a single, separate or hyphen spelling in Latin.

}

tests {

test "Ева", "Jeva"
test "Васiльева", "Vasiĺjeva"
test "Васiлёнак", "Vasilionak"
test "Ёрш", "Jorsh"
test "Вераб’ёў", "Vierabjow"
test "Салаўёва", "Salawjova"
test "Любоў", "Liubow"
test "В’юноў", "Vjunow"
test "Чарняк", "Charniak"
test "Лябецкая", "Liabietskaja" # in reference doc it's Liabetskaja CAMOBAP waiting confirmation from officials
test "Дар’я", "Darja"

}

stage {

# RULES
sub "\u2019\u0415", "Je" # Е
sub "\u2019\u0435", "je" # е
sub "\u2019\u0401", "Jo" # Ë
sub "\u2019\u0451", "jo" # ё
sub "\u2019\u042E", "Ju" # Ю
sub "\u2019\u044E", "ju" # ю
sub "\u2019\u042F", "Ja" # Я
sub "\u2019\u044F", "ja" # я

sub "\u0415", "Je", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # Е after vowels
sub "\u0435", "je", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # е after vowels
sub "\u0401", "Jo", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # Ё after vowels
sub "\u0451", "jo", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # ё after vowels
sub "\u042E", "Ju", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # Ю after vowels
sub "\u044E", "ju", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # ю after vowels
sub "\u042F", "Ja", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # Я after vowels
sub "\u044F", "ja", before: any("АаЕеЁёИиОоУуЭэЮюЯяЬьЎў") # я after vowels

# note[5]
sub "\u044C", "́", before: any("ЗзЛлНнСсЦц") # ь after consonants
sub "\u02B9", "́", before: any("ЗзЛлНнСсЦц") # Ь after consonants

# vowels initially
sub boundary + "\u0415", "Je" # Е
sub boundary + "\u0435", "je" # е
sub boundary + "\u0401", "Jo" # Ё
sub boundary + "\u0451", "jo" # ё
sub boundary + "\u042E", "Ju" # Ю
sub boundary + "\u044E", "ju" # ю
sub boundary + "\u042F", "Ja" # Я
sub boundary + "\u044F", "ja" # я

# CHARACTERS
parallel {

  sub "\u0410", "A" # А
  sub "\u0411", "B" # Б
  sub "\u0412", "V" # B
  sub "\u0413", "G" # Г
  sub "\u0414", "D" # Д
  sub "\u0415", "Ie" # Е or JE TODO add rule
  sub "\u0415", "IE", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Е or JE TODO add rule
  sub "\u0415", "IE", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Е or JE TODO add rule
  sub "\u0401", "Io" # Ё or JO TODO add rule
  sub "\u0401", "IO", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ё or JO TODO add rule
  sub "\u0401", "IO", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ё or JO TODO add rule

  sub "\u0416", "Zh" # Ж
  sub "\u0416", "ZH", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ж
  sub "\u0416", "ZH", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ж

  sub "\u0417", "Z" # З
  sub "\u0406", "I" # І
  sub "\u0419", "J" # Й
  sub "\u041A", "K" # К
  sub "\u041B", "L" # Л
  sub "\u041C", "M" # М
  sub "\u041D", "N" # Н
  sub "\u041E", "O" # О
  sub "\u041F", "P" # П
  sub "\u0420", "R" # Р
  sub "\u0421", "S" # С
  sub "\u0422", "T" # Т
  sub "\u0423", "U" # У
  sub "\U040E", "W" # Ў
  sub "\u0424", "F" # Ф
  sub "\u0425", "Kh" # Х
  sub "\u0425", "KH", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Х
  sub "\u0425", "KH", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Х

  sub "\u0426", "Ts" # Ц
  sub "\u0426", "TS", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ц
  sub "\u0426", "TS", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ц

  sub "\u0427", "Ch" # Ч
  sub "\u0427", "CH", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ч
  sub "\u0427", "CH", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ч

  sub "\u0428", "Sh" # Ш
  sub "\u0428", "SH", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ш
  sub "\u0428", "SH", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ш

  sub "\u0429", "Shch" # Щ
  sub "\u0429", "SHCH", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Щ
  sub "\u0429", "SHCH", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Щ

  sub "\u042B", "Y" # Ы
  sub "\u042D", "E" # Э
  sub "\u042E", "Iu" # Ю
  sub "\u042E", "IU", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ю
  sub "\u042E", "IU", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Ю

  sub "\u042F", "Ia" # Я
  sub "\u042F", "IA", after: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Я
  sub "\u042F", "IA", before: any("АБВГДЕЁЖЗІЙКЛМНОПРСТУU040EФХЦЧШЩЫЭЮЯ") # Я

  sub "\u0430", "a" # а
  sub "\u0431", "b" # б
  sub "\u0432", "v" # в
  sub "\u0433", "g" # г
  sub "\u0434", "d" # д
  sub "\u0435", "ie" # е
  sub "\u0451", "io" # ё
  sub "\u0436", "zh" # ж
  sub "\u0437", "z" # з
  sub "\u0456", "i" # і
  sub "\u0439", "j" # й
  sub "\u043A", "k" # к
  sub "\u043B", "l" # л
  sub "\u043C", "m" # м
  sub "\u043D", "n" # н
  sub "\u043E", "o" # о
  sub "\u043F", "p" # п
  sub "\u0440", "r" # р
  sub "\u0441", "s" # с
  sub "\u0442", "t" # т
  sub "\u0443", "u" # у
  sub "\u045E", "w" # ў
  sub "\u0444", "f" # ф
  sub "\u0445", "kh" # х
  sub "\u0446", "ts" # Ц
  sub "\u0447", "ch" # ч
  sub "\u0448", "sh" # ш
  sub "\u0449", "shch" # щ
  sub "\u044B", "y" # ы
  sub "\u044D", "e" # э
  sub "\u044E", "iu" # ю
  sub "\u044F", "ia" # я
}

# POSTRULES
sub "\u2019", "j"

compose

}