;; te-itrans.mim -- Telugu input method with ITRANS method
;; Copyright (C) 2003, 2004, 2005, 2006, 2007
;;   National Institute of Advanced Industrial Science and Technology (AIST)
;;   Registration Number H15PRO112

;; This file is part of the m17n database; 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 te itrans)

(description "Telugu input method by ITRANS transliteration.
For the detail of ITRANS, see the page:
  <http://www.aczoom.com/itrans/>
")

(title "క")

(map
 (starter
  (".") ("~") ("#") ("$") ("^") ("*") ((S-\ )) ((C-@))
  ("0") ("1") ("2") ("3") ("4")
  ("5") ("6") ("7") ("8") ("9")
  ("A") ("C") ("D") ("E") ("G") ("H") ("I") ("J") ("K") ("L")
  ("M") ("N") ("O") ("R") ("S") ("T") ("U") ("Y")
  ("a") ("b") ("c") ("d") ("e") ("f") ("g") ("h") ("i")
  ("j") ("k") ("l") ("m") ("n") ("o") ("p") ("q") ("r")
  ("s") ("t") ("u") ("v") ("w") ("x") ("y") ("z")
  ((KP_1)) ((KP_2)) ((KP_3)) ((KP_4)) ((KP_5))
  ((KP_6)) ((KP_7)) ((KP_8)) ((KP_9)) ((KP_0)))

 (consonant
  ("k" "క్")
  ("kh" "ఖ్")
  ("g" "గ్")
  ("gh" "ఘ్")
  ("~N" "ఙ్")
  ("N^" "ఙ్")
  ("ch" "చ్")
  ("Ch" "ఛ్")
  ("chh" "ఛ్")
  ("j" "జ్")
  ("jh" "ఝ్")
  ("~n" "ఞ్")
  ("JN" "ఞ్")
  ("T" "ట్")
  ("Th" "ఠ్")
  ("D" "డ్")
  ("Dh" "ఢ్")
  ("N" "ణ్")
  ("t" "త్")
  ("th" "థ్")
  ("d" "ద్")
  ("dh" "ధ్")
  ("n" "న్")
  ("p" "ప్")
  ("ph" "ఫ్")
  ("b" "బ్")
  ("bh" "భ్")
  ("m" "మ్")
  ("y" "య్")
  ("r" "ర్")
  ("R" "ఱ్")
  ("rh" "ఱ్")				; not in ITRANS Telugu table
  ("l" "ల్")
  ("L" "ళ్")
  ("ld" "ళ్")				; not in ITRANS Telugu table
  ("v" "వ్")
  ("w" "వ్")
  ("sh" "శ్")
  ("Sh" "ష్")
  ("shh" "ష్")
  ("s" "స్")
  ("h" "హ్")
  ("GY" "జ్ఞ్")				; not in ITRANS Telugu table
  ("dny" "జ్ఞ్")			; not in ITRANS Telugu table
  ("x" "క్ష్"))

 (independent
  ("a" "అ")
  ("aa" "ఆ")
  ("A" "ఆ")
  ("i" "ఇ")
  ("ii" "ఈ")
  ("I" "ఈ")
  ("u" "ఉ")
  ("uu" "ఊ")
  ("U" "ఊ")
  ("RRi" "ఋ")
  ("R^i" "ఋ")
  ("LLi" "ఌ")
  ("L^i" "ఌ")
  ("e" "ఎ")
  ("E" "ఏ")
  ("ee" "ఏ")				; not in ITRANS Telugu table
  ("ai" "ఐ")
  ("o" "ఒ")
  ("O" "ఓ")
  ("oo" "ఓ")				; not in ITRANS Telugu table
  ("au" "ఔ")
  ("RRI" "ౠ")
  ("R^I" "ౠ")
  ("LLI" "ౡ")
  ("L^I" "ౡ")
  (".N" "ఁ")				; not in ITRANS Telugu table
  (".n" "ం")
  ("M" "ం")				; not in ITRANS Telugu table
  ("H" "ః")
  (".h" "్")				; not in ITRANS Telugu table
  ;; (".a" "ఽ")				; not in Unicode 4.1
  ("0" "౦")
  ("1" "౧")
  ("2" "౨")
  ("3" "౩")
  ("4" "౪")
  ("5" "౫")
  ("6" "౬")
  ("7" "౭")
  ("8" "౮")
  ("9" "౯")
  ("#" "్ర")				; not in ITRANS Telugu table
  ("$" "ర్")				; not in ITRANS Telugu table
  ("^" "త్ర")				; not in ITRANS Telugu table
  ("*" "శ్ర")				; not in ITRANS Telugu table
  ((KP_1) "౧")
  ((KP_2) "౨")
  ((KP_3) "౩")
  ((KP_4) "౪")
  ((KP_5) "౫")
  ((KP_6) "౬")
  ((KP_7) "౭")
  ((KP_8) "౮")
  ((KP_9) "౯")
  ((KP_0) "౦")
  ((S-\ ) "‌")				; not in ITRANS Telugu table
  ((C-@) "‍"))				; not in ITRANS Telugu table

 (dependent
  ("a" (delete @-) "")
  ("aa" (delete @-) "ా")
  ("A" (delete @-) "ా")
  ("i" (delete @-) "ి")
  ("ii" (delete @-) "ీ")
  ("I" (delete @-) "ీ")
  ("u" (delete @-) "ు")
  ("uu" (delete @-) "ూ")
  ("U" (delete @-) "ూ")
  ("RRi" (delete @-) "ృ")
  ("R^i" (delete @-) "ృ")
  ("RRI" (delete @-) "ౄ")
  ("R^I" (delete @-) "ౄ")
  ("e" (delete @-) "ె")
  ("E" (delete @-) "ే")
  ("ee" (delete @-) "ే")		; not in ITRANS Telugu table
  ("ai" (delete @-) "ై")
  ("o" (delete @-) "ొ")
  ("O" (delete @-) "ో")
  ("oo" (delete @-) "ో")		; not in ITRANS Telugu table
  ("au" (delete @-) "ౌ"))

 (return
  ((Return)))

 (backspace
  ((BackSpace) (undo))))

(state
 (init
  (starter (pushback 1) (shift intermediate)))

 (intermediate
  (consonant (shift second))
  (independent (shift init))
  (backspace)
  (return (shift init)))

 (second
  (consonant)
  (dependent (shift init))
  (backspace)
  (return (shift init))))

;; Local Variables:
;; coding: utf-8
;; mode: emacs-lisp
;; End:
