metadata {

authority_id: bgnpcgn
id: 1972
language: iso-639-2:div
source_script: Thaa
destination_script: Latn
name: Romanization of Maldivian (1972)
url: https://libraries.ucsd.edu/bib/fed/USBGN_romanization.pdf
creation_date: 1972
description: ROMANIZATION SYSTEM FOR MALDIVIAN BGN/PCGN 1972 System
notes:
  - Maldivian writing is read from right to left.
  - In the vowel and Diacritical Mark columns x represents any Maldivian consonant character. A Roman vowel letter follows the Romanized Maldivian consonant
  - Alifu(އ) is romanized [’], except when brearing a vowel ,marker, in which case it is not represented in Romanization.
  - Nūnu(ނ) appearing immediately before bā, dālu, d̦aviyani, or gāfu, and not braring a vowel marker or sukunu, is romanised [ň];otherwise [n].
  - Where sīnu is followed by hā, or nūnu by yā, a raised dot or slash may be employed in order to differentiate these form shaviyani and nyaviyani respectively

}

tests {

test "އިރުގައި", "’iruga’i"
test "ޒިޔާރަތްފުށި", "ziyāratfushi"
test "ރައްކާތެރިކުރުމާއި", "ra’kāterikurumā’i"
test "ޝަހީދުންގެ ދުވަސް", "shahīdunge duvas"
test "ކިހިނެހް", "kihineh"
test "ކޮން ނަމެއް ކިޔަނީ", "kon name’ kiyanī"
test "ބައްއަޖޖެވުރި ހެނދުނެހް", "ba’’ajjevuri heňduneh"
test "މެނދުރެހް", "meňdureh"
test "ހަވީރެހް", "havīreh"
test "ސހ", "s·h"
test "ނޔ", "n·y"

}

stage {

# RULES
# rule 3
sub "\u0787", "’", not_after: "=" + any("\u07a6\u07a7\u07a8\u07a9\u07aa\u07ab\u07ac\u07ad\u07ae\u07af\u07B0")
# rule 4
sub "\u0782", "ň", after: any("\u0784\u078b\u0791\u078e")

# rule 5
sub "\u0790", "s·", after: any("\u0780") #raised dot unicode U+2E33
sub "\u0782", "n·", after: any("\u0794") #raised dot unicode U+2E33

# CHARACTERS
parallel {
  # Vowels
  sub "ަ", "a"
  sub "ާ", "ā"
  sub "ެ", "e"
  sub "ޭ", "ē"
  sub "ި", "i"
  sub "ީ", "ī"
  sub "ު", "u"
  sub "ޫ", "ū"
  sub "ޮ", "o"
  sub "ޯ", "ō"
  sub "ް", "" # omitted

  sub "ހ", "h"
  sub "ށ", "sh"
  sub "ނ", "n"
  sub "ރ", "r"
  sub "ބ", "b"
  sub "ޅ", "l̦"
  sub "ކ", "k"
  sub "އ", ""
  sub "ވ", "v"
  sub "މ", "m"
  sub "ފ", "f"
  sub "ދ", "d"
  sub "ތ", "t"
  sub "ލ", "l"
  sub "ގ", "g"
  sub "ޏ", "ny"
  sub "ސ", "s"
  sub "ޝ", "sh"
  sub "ޑ", "d̦"
  sub "ޒ", "z"
  sub "ޓ", "ț"
  sub "ޔ", "y"
  sub "ޕ", "p"
  sub "ޖ", "j"
  sub "ޗ", "ch"
}

compose

}