;; Copyright (C) 2003, 2004, 2005, 2006
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112
-;; Copyright 2005, 2006 Suraj N. Kurapati <skurapat@ucsc.edu>
+;; Copyright 2005, 2006, 2010 Suraj N. Kurapati <sunaku@gmail.com>
;; Copyright 2006 Chaitanya Kamisetty <chaitanya@atc.tcs.co.in>
;; Boston, MA 02110-1301, USA.
-
(input-method te rts)
(description "Input method for Telugu script with RTS method.
For the detail of RTS, see the page:
- <http://groups.google.com/groups?selm=Bv0A9M.27B%40rice.edu&output=gplain>.
-
-This input method is based upon the Telugu Rice Transliteration
-Standard (RTS) specification and its Rice Inverse
-Transliterator (RIT) supplement.
-
-The original RTS specification was written by Ananda Kishore and
-Rama Rao Kanneganti in 1992 and can presently be accessed in the
-\"soc.culture.indian.telugu\" newsgroup archives (see
-<http://groups.google.com/groups?selm=Bv0A9M.27B\%40rice.edu&output=gplain>).
-
-The RIT supplement adds alternative combinations for
-transliteration but, in general, does not distract from the
-original specification (see
-<http://www.teluguworld.org/RIT/rit3.0/manual.html>). Whenever a
-supplemental combination conflicts with the original RTS, the RTS
-version has precedence and the supplemental combination is
-disregarded (such as 'ea' from RIT 3.0).
-
-Finally, this input method deviates slightly from the RTS in the
-following ways:
-
- (1) The combinations \"\@n\", \"\@2\", \"~c\", and \"~j\"
- yield \"�\" because their corresponding glyphs do not
- yet exist in Telugu's Unicode chart.
-
- (2) If it appears at the end of a word, the combination
- \"m\" yields \"ం\". The user can type \"m&\" to
- bypass this behavior and force \"m\" to yield \"మ్\".
+ <http://groups.google.com/groups?selm=Bv0A9M.27B@rice.edu>.
+
+This input method is based on the Telugu Rice Transliteration Standard (RTS)
+specification[1] and its Rice Inverse Transliterator (RIT) supplement[2].
+
+The original RTS specification was written by Ananda Kishore and Rama Rao
+Kanneganti in 1992 and can presently be accessed in the archives[1] of the
+'soc.culture.indian.telugu' USENET newsgroup.
+
+The RIT supplement[2] enriches RTS with alternative combinations. However,
+in cases where RIT and RTS define conflicting mappings for the same
+combination, such as 'ea', only the RTS mapping is honored.
+
+Finally, this input method deviates from the RTS in the following ways:
+
+* The combination '\@n' yields '�' because its corresponding glyph does not
+ yet exist in the Telugu unicode chart.
+
+* The combination 'm' yields 'ం' if it appears at the end of a word. The
+ user can type 'm&' to bypass this behavior and force 'm' to yield 'మ్'.
+
+* The sunna prevention operator '&' can be used to force a more literal
+ transliteration of consonant compounds such as 'jn' by writing 'j&n'.
+
+[1]: http://groups.google.com/groups?selm=Bv0A9M.27B@rice.edu
+[2]: http://www.teluguworld.org/RIT/rit3.0/manual.html
")
(title "క")
(map
(starter
- ((S-\ )) ((C-@)) ; m17n stuff
+ ((S-\ )) ((C-@))
("a") ("b") ("c") ("d") ("e") ("f") ("g") ("h") ("i") ("j")
("k") ("l") ("m") ("n") ("o") ("p") ("r") ("s") ("t") ("u")
("0") ("1") ("2") ("3") ("4") ("5") ("6") ("7") ("8") ("9")
- ("@") ("|") ("~")
-
- ("#") ("_")
+ ("@") ("|") ("~") ("#")
)
-
-
- ; these consonants undergo automatic sunna generation
(consonant
- ; row 1
+ ;-------------------------------------------------------------------------
+ ; row 1 - క ఖ గ ఘ ఙ
+ ;-------------------------------------------------------------------------
+
("k" "క్")
("kh" "ఖ్")
("Gh" "ఘ్")
("GH" "ఘ్")
+ ("~m" "ఙ్")
+
+ ;-------------------------------------------------------------------------
+ ; row 2 - చ ఛ జ ఝ ఞ
+ ;-------------------------------------------------------------------------
- ; row 2
("c" "చ్")
("ch" "చ్")
("cH" "చ్")
-
- ("~c" "�") ; త్స (tsa) allophone of చ (cha)
+
+ ("~c" "ౘ")
("C" "ఛ్")
("Ch" "ఛ్")
("CH" "ఛ్")
- ("c'" "ఛ్") ; from RIT 2.0, 3.0
+ ("c'" "ఛ్") ; from RIT 2.0, 3.0
("j" "జ్")
- ("z" "జ్") ; from RIT 3.0
+ ("z" "జ్") ; from RIT 3.0
- ("~j" "�") ; డ్జ (dza) allophone of జ (ja)
+ ("~j" "ౙ")
("jh" "ఝ్")
("jH" "ఝ్")
("Jh" "ఝ్")
("JH" "ఝ్")
+ ("~n" "ఞ్")
+
+ ;-------------------------------------------------------------------------
+ ; row 3 - ట ఠ డ ఢ ణ
+ ;-------------------------------------------------------------------------
- ; row 3
("T" "ట్")
("t'" "ట్")
("dh'" "ఢ్")
("dH'" "ఢ్")
+ ("N" "ణ్")
+ ("nh" "ణ్")
+ ("nH" "ణ్")
+ ("n'" "ణ్") ; from RIT 2.0, 3.0
+
+ ;-------------------------------------------------------------------------
+ ; row 4 - త థ ద ధ న
+ ;-------------------------------------------------------------------------
- ; row 4
("t" "త్")
("th" "థ్")
("dh" "ధ్")
("dH" "ధ్")
+ ;-------------------------------------------------------------------------
+ ; row 5 - ప ఫ బ భ మ
+ ;-------------------------------------------------------------------------
- ; row 5
("p" "ప్")
("f" "ఫ్")
("Bh" "భ్")
("BH" "భ్")
+ ;-------------------------------------------------------------------------
+ ; row 6 - య ర ల వ శ ష స హ ళ క్ష ఱ
+ ;-------------------------------------------------------------------------
+
+ ; ("y" "య్") is defined below in consonant-without-sunna
+
+ ; ("r" "ర్") is defined below in consonant-without-sunna
- ; row 6
("l" "ల్")
("v" "వ్")
- ("V" "వ్") ; from RIT 3.0
+ ("V" "వ్") ; from RIT 3.0
("w" "వ్")
- ("W" "వ్") ; from RIT 3.0
+ ("W" "వ్") ; from RIT 3.0
("S" "శ్")
- ("s'" "శ్") ; from RIT 2.0, 3.0
+ ("s'" "శ్") ; from RIT 2.0, 3.0
+
+ ("sh" "ష్")
+ ("sH" "ష్")
+ ("Sh" "ష్") ; from RIT 3.0
+ ("SH" "ష్") ; from RIT 3.0
("s" "స్")
+ ("h" "హ్")
+ ("H" "హ్")
+
+ ("L" "ళ్")
+ ("lh" "ళ్")
+ ("lH" "ళ్")
+ ("Lh" "ళ్")
+ ("LH" "ళ్")
+ ("l'" "ళ్") ; from RIT 2.0, 3.0
("x" "క్ష్")
("ksh" "క్ష్")
("ksH" "క్ష్")
- ("ks" "క్స్") ; workaround for inputting "క్స్"
-
+ ("ks" "క్స్") ; disambiguation for this input method's 1-character lookahead
- ; misc. compounds
- ("dd'" "డ్డ్") ; from RIT 3.0
- ("dd" "ద్ద్")
+ ("~r" "ఱ్")
+ ("r''" "ఱ్") ; from RIT 2.0, 3.0
- ("tt'" "ట్ట్") ; from RIT 3.0
- ("tt" "త్త్")
+ ;---------------------------------------------------------------------------
+ ; compounds
+ ;---------------------------------------------------------------------------
("jn" "జ్ఞ్")
- )
-
+ ("j&n" "జ్న్") ; apply sunna prevention operator to produce literal compound
+ ("dd'" "డ్డ్") ; from RIT 3.0
+ ("dd" "ద్ద్") ; disambiguation for this input method's 1-character lookahead
- ; these consonants do NOT undergo automatic sunna generation
- (consonant2
- ("~m" "ఙ్")
+ ("tt'" "ట్ట్") ; from RIT 3.0
+ ("tt" "త్త్") ; disambiguation for this input method's 1-character lookahead
+ )
- ("~n" "ఞ్")
+ (consonant-without-sunna
- ("N" "ణ్")
- ("nh" "ణ్")
- ("nH" "ణ్")
- ("n'" "ణ్") ; from RIT 2.0, 3.0
+ ; Quotation from "sunna generation" section of RIT 3.0 specification:
+ ;
+ ; when 'n' or 'm' is followed by a consonant except 'r' or 'y' RIT
+ ; assumes it to be a sunna
+ ;
+ ("r" "ర్")
+ ("y" "య్")
+ ; Quotation from "sunna generation" section of RIT 3.0 specification:
+ ;
+ ; You can prevent a sunna generation by writing 'n&' or 'm&'.
+ ;
("n&" "న్")
-
("m&" "మ్")
-
- ("y" "య్")
-
- ("r" "ర్")
-
- ("sh" "ష్")
- ("sH" "ష్")
- ("Sh" "ష్") ; from RIT 3.0
- ("SH" "ష్") ; from RIT 3.0
-
- ("h" "హ్")
- ("H" "హ్")
-
- ("L" "ళ్")
- ("lh" "ళ్")
- ("lH" "ళ్")
- ("Lh" "ళ్")
- ("LH" "ళ్")
- ("l'" "ళ్") ; from RIT 2.0, 3.0
-
- ("~r" "ఱ్")
- ("r''" "ఱ్") ; from RIT 2.0, 3.0
)
-
-
- ; these consonants are converted into sunna by the automatic sunna generation logic, if they appear inside a word
(sunna-inside-word
("n" "న్")
-
("m" "మ్")
)
-
-
- ; these sequences are converted into sunna by the automatic sunna generation logic, if they appear at the end of a word
(sunna-endof-word
- ((m Tab) "ం ")
- ((m Return) "ం")
+ ;-------------------------------------------------------------------------
+ ; whitespace
+ ;-------------------------------------------------------------------------
- ; the sequences below, using punctuation marks to denote the end of a word, are generated by the following shell command. keys in [1] the (starter) block, [2] the (independent) block, and [3] those which begin with the 'm' key are intentionally excluded from this command to ensure that they are transliterated normally.
- ; for ch in ' ' '!' '\"' '#' '$' '%' "'" '(' ')' '*' '+' ',' '-' '.' '/' '\\' ':' ';' '<' '=' '>' '?' '[' ']' '_' '`' '{' '}'; do echo " (\"m${ch}\" \"ం${ch}\")"; done # exclude '^' '&' '|' '@' '~'
("m " "ం ")
+ ((m Tab) "ం\t")
+ ((m Return) "ం\n")
+
+ ;-------------------------------------------------------------------------
+ ; punctuation
+ ;-------------------------------------------------------------------------
+ ;
+ ; The sequences below are generated by this Bourne shell script:
+ ;
+ ; for ch in '!' '\"' '#' '$' '%' "'" '(' ')' '*' '+' ',' '-' '.' \
+ ; '/' '\\' ':' ';' '<' '=' '>' '?' '[' ']' '_' '`' '{' '}'
+ ; do echo " (\"m${ch}\" \"ం${ch}\")"; done
+ ;
+ ; Sequences ending with '^' '&' '|' '@' '~' are omitted from the above
+ ; loop because those punctuation marks already serve a purpose in this
+ ; input method.
+ ;
("m!" "ం!")
("m\"" "ం\"")
("m#" "ం#")
("m}" "ం}")
)
-
-
(independent
+ ((S-\ ) "")
+ ((C-@) "")
+
+ ;-------------------------------------------------------------------------
+ ; vowels
+ ;-------------------------------------------------------------------------
- ; అచ్చులు (vowels)
("a" "అ")
("aa" "ఆ")
("a'" "ఆ")
- ("A" "ఆ") ; from RIT 2.0, 3.0
+ ("A" "ఆ") ; from RIT 2.0, 3.0
("i" "ఇ")
("ii" "ఈ")
("ia" "ఈ")
("i'" "ఈ")
- ("I" "ఈ") ; from RIT 2.0, 3.0
+ ("I" "ఈ") ; from RIT 2.0, 3.0
("u" "ఉ")
("u'" "ఊ")
("R" "ఋ")
- ("r'" "ఋ") ; from RIT 2.0
+ ("r'" "ఋ") ; from RIT 2.0
("Ru" "ౠ")
- ("r'u" "ౠ") ; from RIT 2.0
+ ("r'u" "ౠ") ; from RIT 2.0
- ("~l" "ఌ")
+ ("~l" "ౢ")
- ("~L" "ౡ")
+ ("~L" "ౣ")
("e" "ఎ")
("e'" "ఏ")
("ai" "ఐ")
- ("ei" "ఐ") ; from RIT 3.0
+ ("ei" "ఐ") ; from RIT 3.0
("o" "ఒ")
("au" "ఔ")
("ou" "ఔ")
- ("ow" "ఔ") ; from RIT 3.0
+ ("ow" "ఔ") ; from RIT 3.0
+
+ ; This combination is defined in the "internal representation" section of
+ ; RTS. It was widely used in early RTS implementations which lacked the
+ ; automatic sunna generation capability and has thus became the defacto
+ ; way of producing a sunna manually.
+ ("M" "ం")
+
+ ("@M" "ఁ")
+ ("@m" "ఁ") ; from RIT 3.0
+
+ ("@h" "ః")
+ ("@n" "�")
+ ("@N" "�") ; from RIT 3.0
+
+ ("@2" "ఽ")
+
+ ;-------------------------------------------------------------------------
+ ; digits
+ ;-------------------------------------------------------------------------
- ; అంకెలు (numbers)
("0" "౦")
("1" "౧")
("2" "౨")
("8" "౮")
("9" "౯")
-
+ ;-------------------------------------------------------------------------
; punctuation
- ("|" "।") ; from RIT 3.0
- ("||" "॥") ; from Yudit
-
-
- ; additional modifiers
- ("M" "ం") ; from "internal representation" section of RTS. This combination has been included because it is very widely used in RTS implementations which do not support automatic sunna generation and thus has become the defacto way of manually producing sunna.
-
- ("@M" "ఁ") ; అర్ధసున్న (ardhasunna), చంద్ర బిందు (chandra bindu)
- ("@m" "ఁ") ; from RIT 3.0
-
- ("@h" "ః") ; విసర్గ (visarga)
- ("@H" "ః")
-
- ("@n" "�") ; నకర పొల్లు (nakara-pollu), నకర విరమ (nakara-virama)
- ("@N" "�") ; from RIT 3.0
-
- ("@2" "�") ; అవగ్రహ (avagraha)
+ ;-------------------------------------------------------------------------
- ("^" "్") ; పొల్లు (pollu), విరమ (virama), halant
-
- ("_" "") ; ignored according to RTS
-
-
- ; m17n stuff
- ((S-\ ) "")
- ((C-@) "")
+ ; The characters at the right-hand-side of these mappings are borrowed
+ ; from the Devanagiri unicode chart because they do not yet exist in the
+ ; Telugu unicode chart.
+ ("|" "।") ; from RIT 3.0
+ ("||" "॥") ; from Yudit
)
+ (dependent
+ ("^" (delete @-) "్")
+ ;-------------------------------------------------------------------------
+ ; vowels
+ ;-------------------------------------------------------------------------
- (dependent
("a" (delete @-) "")
("aa" (delete @-) "ా")
("a'" (delete @-) "ా")
- ("A" (delete @-) "ా") ; from RIT 3.0
+ ("A" (delete @-) "ా") ; from RIT 3.0
("i" (delete @-) "ి")
("ii" (delete @-) "ీ")
("ia" (delete @-) "ీ")
("i'" (delete @-) "ీ")
- ("I" (delete @-) "ీ") ; from RIT 3.0
+ ("I" (delete @-) "ీ") ; from RIT 3.0
("u" (delete @-) "ు")
("u'" (delete @-) "ూ")
("R" (delete @-) "ృ")
- ("r'" (delete @-) "ృ") ; from RIT 2.0
+ ("r'" (delete @-) "ృ") ; from RIT 2.0
("Ru" (delete @-) "ౄ")
- ("r'u" (delete @-) "ౄ") ; from RIT 2.0
+ ("r'u" (delete @-) "ౄ") ; from RIT 2.0
- ("~l" (delete @-) "")
+ ("~l" (delete @-) "ౢ")
- ("~L" (delete @-) "")
+ ("~L" (delete @-) "ౣ")
("e" (delete @-) "ె")
("e'" (delete @-) "ే")
("ai" (delete @-) "ై")
- ("ei" (delete @-) "ై") ; from RIT 3.0
+ ("ei" (delete @-) "ై") ; from RIT 3.0
("o" (delete @-) "ొ")
("au" (delete @-) "ౌ")
("ou" (delete @-) "ౌ")
- ("ow" (delete @-) "ౌ") ; from RIT 3.0
-
-
- ; additional modifiers
- ("^" (delete @-) "్") ; పొల్లు (pollu), విరమ (virama), halant
+ ("ow" (delete @-) "ౌ") ; from RIT 3.0
)
-(single_hash
+ (single_hash
("#" "")
)
("###" "#")
)
- (invariant
- ("a" "a" ) ("b" "b" ) ("c" "c" ) ("d" "d" ) ("e" "e") ("f" "f") ("g" "g") ("h" "h") ("i" "i") ("j" "j")
- ("k" "k" ) ("l" "l" ) ("m" "m" ) ("n" "n" ) ("o" "o" ) ("p" "p" ) ("q" "q") ("r" "r" ) ("s" "s" ) ("t" "t" ) ("u" "u" )
- ("v" "v" ) ("w" "w" ) ("x" "x" ) ("y" "y" ) ("z" "z" )
+ (invariant
+ ("a" "a") ("b" "b") ("c" "c") ("d" "d") ("e" "e") ("f" "f") ("g" "g")
+ ("h" "h") ("i" "i") ("j" "j") ("k" "k") ("l" "l") ("m" "m") ("n" "n")
+ ("o" "o") ("p" "p") ("q" "q") ("r" "r") ("s" "s") ("t" "t") ("u" "u")
+ ("v" "v") ("w" "w") ("x" "x") ("y" "y") ("z" "z")
- ("A" "A" ) ("B" "B" ) ("C" "C" ) ("D" "D" ) ("E" "E" ) ("F" "F") ("G" "G" ) ("H" "H" ) ("I" "I" ) ("J" "J" ) ("K" "K" )
- ("L" "L" ) ("M" "M" ) ("N" "N" ) ("O" "O" ) ("P" "P" ) ("Q" "Q") ("R" "R" ) ("S" "S" ) ("T" "T" ) ("U" "U" ) ("V" "V" )
- ("W" "W" ) ("X" "X" ) ("Y" "Y" ) ("Z" "Z" )
+ ("A" "A") ("B" "B") ("C" "C") ("D" "D") ("E" "E") ("F" "F") ("G" "G")
+ ("H" "H") ("I" "I") ("J" "J") ("K" "K") ("L" "L") ("M" "M") ("N" "N")
+ ("O" "O") ("P" "P") ("Q" "Q") ("R" "R") ("S" "S") ("T" "T") ("U" "U")
+ ("V" "V") ("W" "W") ("X" "X") ("Y" "Y") ("Z" "Z")
- ("0" "0" ) ("1" "1" ) ("2" "2" ) ("3" "3" ) ("4" "4" ) ("5" "5" ) ("6" "6" ) ("7" "7" ) ("8" "8" ) ("9" "9" )
+ ("0" "0") ("1" "1") ("2" "2") ("3" "3") ("4" "4") ("5" "5") ("6" "6")
+ ("7" "7") ("8" "8") ("9" "9")
- ("~" "~") ("`" "`") ("!" "!") ("@" "@" ) ("$" "$") ("%" "%") ("^" "^") ("&" "&") ("*" "*") ("(" "(") (")" ")") ("_" "_")
- ("-" "-") ("+" "+") ("=" "=") ("{" "{") ("[" "[") ("}" "}") ("]" "]") ("|" "|" ) ("\\" "\\") (":" ":") (";" ";")
- ("\"" "\"") ("\'" "\'") ("<" "<") ("," ",") (">" ">") ("." ".") ("?" "?") ("/" "/")
+ ("~" "~") ("`" "`") ("!" "!") ("@" "@") ("$" "$") ("%" "%") ("^" "^")
+ ("&" "&") ("*" "*") ("(" "(") (")" ")") ("_" "_") ("-" "-") ("+" "+")
+ ("=" "=") ("{" "{") ("[" "[") ("}" "}") ("]" "]") ("|" "|" ) ("\\" "\\")
+ (":" ":") (";" ";") ("\"" "\"") ("\'" "\'") ("<" "<") ("," ",") (">" ">")
+ ("." ".") ("?" "?") ("/" "/")
(" " " ") ((Tab) ("\t")) ((BackSpace) (undo)) ((Return) ("\n"))
- )
+ )
- ; m17n stuff
(return
((Return)))
((BackSpace) (undo)))
)
-
-
-; state machine for transliteration
(state
(init
(starter (pushback 1) (shift intermediate))
(intermediate
(consonant (shift second))
- (consonant2 (shift second))
+ (consonant-without-sunna (shift second))
(sunna-inside-word (shift second-sunna-inside-word))
(sunna-endof-word (shift init))
(independent (shift init))
(second
(consonant)
- (consonant2)
+ (consonant-without-sunna)
(sunna-inside-word (shift second-sunna-inside-word))
(sunna-endof-word (shift init))
(dependent (shift init))
(second-sunna-inside-word
(t (mark p))
(consonant (move p) (delete @-) (delete @-) "ం" (move @>) (shift second))
- (consonant2 (shift second))
+ (consonant-without-sunna (shift second))
(sunna-inside-word)
(sunna-endof-word (shift init))
(dependent (shift init))