;; sa-iast.mim -- Input method for Romanized Sanskrit/Pali using the ITRANS/ISO 15919 scheme.
;; Copyright (C) 2011  William Giddings <wjgiddings@googlemail.com>

;; This file is part of the m17n contrib; a sub-part of the m17n
;; library.

;; The m17n library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation; either version 2.1 of
;; the License, or (at your option) any later version.

;; The m17n library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; Lesser General Public License for more details.

;; You should have received a copy of the GNU Lesser General Public
;; License along with the m17n library; if not, write to the Free
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

(input-method sa IAST )

(description "Romanized Sanskrit input method with IAST/ISO 15919 convention.
The table is based on 
  <http://en.wikipedia.org/wiki/International_Alphabet_of_Sanskrit_Transliteration>
")

(title "ISO 15919")

(map
 (trans
  ("aa" "ā")
  ("AA" "Ā")
  ("^a" "â")
  ("^A" "Â")
  ("ii" "ī")
  ("II" "Ī")
  ("uu" "ū")
  ("UU" "Ū")
  (".r" "ṛ")
  (".R" "Ṛ")
  (".rr" "ṝ")
  (".RR" "Ṝ")
  (".l" "ḷ")
  (".L" "Ḷ")
  (".ll" "ḹ")
  (".LL" "Ḹ")
  (".M" "Ṃ")
  (".m" "ṃ")
  (".h" "ḥ")
  (".H" "Ḥ")
  (";n" "ṅ")
  (";N" "Ṅ")
  ("~n" "ñ")
  ("~N" "Ñ")
  (".t" "ṭ")
  (".T" "Ṭ")
  (".d" "ḍ")
  (".D" "Ḍ")
  (".n" "ṇ")
  (".N" "Ṇ")
  (".z" "ẓ")
  (".Z" "Ẓ")
  (";s" "ś")
  (";S" "Ś")
  (".s" "ṣ")
  (".S" "Ṣ")
  ("ee" "ē")
  ("EE" "Ē")
  ("oo" "ō")
  ("OO" "Ō")
  (";m" "ṁ")
  (",r" "r̥")
  (",R" "R̥")
  (",rr" "r̥̄")
  (",RR" "R̥̄")
  (",l" "l̥")
  (",L" "L̥")
  (",ll" "l̥̄")
  (",LL" "L̥̄")
  ("_h" "ẖ")
  ("_H" "H̱")
  ("_k" "ḵ")
  ("_K" "Ḵ")
  ("_kh" "k͟h")
  ("_KH" "K͟H")
  ("_l" "ḻ")
  ("_L" "Ḻ")
  ("_n" "ṉ")
  ("_N" "Ṉ")
  ("_r" "ṟ")
  ("_R" "Ṟ")
  ("_s" "s̱")
  ("_S" "S̱")
  ("_t" "ṯ")
  ("_T" "Ṯ")
  ("_z" "ẕ")
  ("_Z" "Ẕ")
  (";y" "ẏ")
  (";Y" "Ẏ")
  (";z" "ż")
  (";Z" "Ż")
  (".g" "ġ")
  (".G" "Ġ")
  ("~l" "l̐")
  ("~m" "m̐")
  (",h" "h̤")
  (",H" "H̤")
  (",s" "s̤")
  (",S" "S̤")
  (",t" "t̤")
  (",T" "T̤")
  ("^c" "ĉ")
  ("^C" "Ĉ")
  ("^e" "ê")
  ("^E" "Ê")
  ("^h" "ḫ")
  ("^H" "Ḫ")
  ("^j" "ĵ")
  ("^J" "Ĵ")
  ("^m" "m̆")
  ("^M" "M̆")
  ("^n" "n̆")
  ("^N" "N̆")
  ("^o" "ô")
  ("^O" "Ô")
  ("^r" "r̆")
  ("^R" "R̆")
  ("^u" "ŭ")
  ("^U" "Ŭ")
  ("^z" "ž")
  ("^Z" "Ž")
  ))

(state
 (init
  (trans)))
