;; mr-modi-itrans.mim -- Marathi modi input method by ITRANS and Harvard-Kyoto transliteration systems. ;; Copyright (C) 2023 Vishvas Vasuki ;; 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 General Public License ;; along with this program. If not, see (input-method mr modi-itrans) (description "Marathi modi input method by ITRANS and Harvard-Kyoto transliteration systems. You can use all the standard ITRANS key sequences plus key sequences such as the below. nk->๐‘˜’๐‘˜ฟ๐‘˜Ž๐‘˜ฟ, nkh->๐‘˜’๐‘˜ฟ๐‘˜๐‘˜ฟ, ng->๐‘˜’๐‘˜ฟ๐‘˜๐‘˜ฟ, ngh->๐‘˜’๐‘˜ฟ๐‘˜‘๐‘˜ฟ nch->๐‘˜—๐‘˜ฟ๐‘˜“๐‘˜ฟ, nCh->๐‘˜—๐‘˜ฟ๐‘˜”๐‘˜ฟ, nc->๐‘˜—๐‘˜ฟ๐‘˜“๐‘˜ฟ, nC->๐‘˜—๐‘˜ฟ๐‘˜”๐‘˜ฟ, nchh->๐‘˜—๐‘˜ฟ๐‘˜”๐‘˜ฟ, nj->๐‘˜—๐‘˜ฟ๐‘˜•๐‘˜ฟ, njh->๐‘˜—๐‘˜ฟ๐‘˜–๐‘˜ฟ, nT->๐‘˜œ๐‘˜ฟ๐‘˜˜๐‘˜ฟ, nTh->๐‘˜œ๐‘˜ฟ๐‘˜™๐‘˜ฟ, nD->๐‘˜œ๐‘˜ฟ๐‘˜š๐‘˜ฟ, nDh->๐‘˜œ๐‘˜ฟ๐‘˜›๐‘˜ฟ c->๐‘˜“๐‘˜ฟ, C->๐‘˜”๐‘˜ฟ, z->๐‘˜ซ๐‘˜ฟ, S->๐‘˜ฌ๐‘˜ฟ, jn->๐‘˜•๐‘˜ฟ๐‘˜—๐‘˜ฟ, R->๐‘˜จ๐‘˜ฒ In addition, for convenience, when a consonant + halant sequence is followed by non Modi letter, the last halant is removed. For instance, 'k SPC'->'๐‘˜Ž ', 'k..'->'๐‘˜Ž๐‘™'. The motivation behind additions made to the basic ITRANS scheme is described in https://sanskrit-coders.github.io/input/optitrans/, along with a tabulated comparison with several other transliteration schemes. Also, see: http://en.wikipedia.org/wiki/Devanagari_transliteration.") (title "๐‘˜ฆ๐‘˜ป") (variable (trim-last-halant (_"If this variable is 1 (the default), the last Halant in a syllable is removed if it is followed by non Modi letter. For instance, typing \"har..\" produces \"๐‘˜ฎ๐‘˜จ๐‘™\", not \"๐‘˜ฎ๐‘˜จ๐‘˜ฟ๐‘™\".") 1 0 1)) (map (starter (".") ("~") ("#") ("$") ("*") ("]") ((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" "๐‘˜๐‘˜ฟ") ("K" "๐‘˜๐‘˜ฟ") ("g" "๐‘˜๐‘˜ฟ") ("gh" "๐‘˜‘๐‘˜ฟ") ("G" "๐‘˜‘๐‘˜ฟ") (".k" "๐‘˜Ž๐‘˜ฟ ") ("q" "๐‘˜Ž๐‘˜ฟ") (".kh" "๐‘˜๐‘˜ฟ") (".K" "๐‘˜๐‘˜ฟ") (".g" "๐‘˜๐‘˜ฟ") ("nk" "๐‘˜’๐‘˜ฟ๐‘˜Ž๐‘˜ฟ") ("nx" "๐‘˜’๐‘˜ฟ๐‘˜Ž๐‘˜ฟ๐‘˜ฌ๐‘˜ฟ") ("nkh" "๐‘˜’๐‘˜ฟ๐‘˜๐‘˜ฟ") ("nK" "๐‘˜’๐‘˜ฟ๐‘˜๐‘˜ฟ") ("ng" "๐‘˜’๐‘˜ฟ๐‘˜๐‘˜ฟ") ("ngh" "๐‘˜’๐‘˜ฟ๐‘˜‘๐‘˜ฟ") ("nG" "๐‘˜’๐‘˜ฟ๐‘˜‘๐‘˜ฟ") ("~N" "๐‘˜’๐‘˜ฟ") ("N^" "๐‘˜’๐‘˜ฟ") ("ch" "๐‘˜“๐‘˜ฟ") ("Ch" "๐‘˜”๐‘˜ฟ") ; not in ITRANS Devanagari table ("c" "๐‘˜“๐‘˜ฟ") ("C" "๐‘˜”๐‘˜ฟ") ; not in ITRANS Devanagari table ("chh" "๐‘˜”๐‘˜ฟ") ("j" "๐‘˜•๐‘˜ฟ") ("jh" "๐‘˜–๐‘˜ฟ") ("J" "๐‘˜–๐‘˜ฟ") ("nch" "๐‘˜—๐‘˜ฟ๐‘˜“๐‘˜ฟ") ("nCh" "๐‘˜—๐‘˜ฟ๐‘˜”๐‘˜ฟ") ; not in ITRANS Devanagari table ("nc" "๐‘˜—๐‘˜ฟ๐‘˜“๐‘˜ฟ") ("nC" "๐‘˜—๐‘˜ฟ๐‘˜”๐‘˜ฟ") ; not in ITRANS Devanagari table ("nchh" "๐‘˜—๐‘˜ฟ๐‘˜”๐‘˜ฟ") ("nj" "๐‘˜—๐‘˜ฟ๐‘˜•๐‘˜ฟ") ("njh" "๐‘˜—๐‘˜ฟ๐‘˜–๐‘˜ฟ") ("nJ" "๐‘˜—๐‘˜ฟ๐‘˜–๐‘˜ฟ") ("~n" "๐‘˜—๐‘˜ฟ") ("JN" "๐‘˜—๐‘˜ฟ") ("T" "๐‘˜˜๐‘˜ฟ") ("Th" "๐‘˜™๐‘˜ฟ") ("D" "๐‘˜š๐‘˜ฟ") ("Dh" "๐‘˜›๐‘˜ฟ") (".D" "๐‘˜š๐‘˜ฟ") (".Dh" "๐‘˜›๐‘˜ฟ") ("nT" "๐‘˜œ๐‘˜ฟ๐‘˜˜๐‘˜ฟ") ("nTh" "๐‘˜œ๐‘˜ฟ๐‘˜™๐‘˜ฟ") ("nD" "๐‘˜œ๐‘˜ฟ๐‘˜š๐‘˜ฟ") ("nDh" "๐‘˜œ๐‘˜ฟ๐‘˜›๐‘˜ฟ") ("N" "๐‘˜œ๐‘˜ฟ") ("t" "๐‘˜๐‘˜ฟ") ("th" "๐‘˜ž๐‘˜ฟ") ("d" "๐‘˜Ÿ๐‘˜ฟ") ("dh" "๐‘˜ ๐‘˜ฟ") ("n" "๐‘˜ก๐‘˜ฟ") (":n" "๐‘˜ก๐‘˜ฟ") ; not in ITRANS Devanagari table ("p" "๐‘˜ข๐‘˜ฟ") ("ph" "๐‘˜ฃ๐‘˜ฟ") ("P" "๐‘˜ฃ๐‘˜ฟ") (".ph" "๐‘˜ฃ๐‘˜ฟ") ("f" "๐‘˜ฃ๐‘˜ฟ") ("b" "๐‘˜ค๐‘˜ฟ") ("bh" "๐‘˜ฅ๐‘˜ฟ") ("B" "๐‘˜ฅ๐‘˜ฟ") ("m" "๐‘˜ฆ๐‘˜ฟ") ("y" "๐‘˜ง๐‘˜ฟ") ("Y" "๐‘˜ง๐‘˜ฟ") ; not in ITRANS Devanagari table ("yh" "๐‘˜ง๐‘˜ฟ") ; not in ITRANS Devanagari table (".y" "๐‘˜ง๐‘˜ฟ") ("r" "๐‘˜จ๐‘˜ฟ") ("l" "๐‘˜ฉ๐‘˜ฟ") ("L" "๐‘˜ฏ๐‘˜ฟ") ("ld" "๐‘˜ฏ๐‘˜ฟ") ("v" "๐‘˜ช๐‘˜ฟ") ("w" "๐‘˜ช๐‘˜ฟ") ("sh" "๐‘˜ซ๐‘˜ฟ") ("z" "๐‘˜•๐‘˜ฟ") (".j" "๐‘˜•๐‘˜ฟ") ; ("z" "๐‘˜ซ๐‘˜ฟ") ("S" "๐‘˜ฌ๐‘˜ฟ") ("Sh" "๐‘˜ฌ๐‘˜ฟ") ("shh" "๐‘˜ฌ๐‘˜ฟ") ("s" "๐‘˜ญ๐‘˜ฟ") ("h" "๐‘˜ฎ๐‘˜ฟ") ("jn" "๐‘˜•๐‘˜ฟ๐‘˜—๐‘˜ฟ") ("j~n" "๐‘˜•๐‘˜ฟ๐‘˜—๐‘˜ฟ") ("jn" "๐‘˜•๐‘˜ฟ๐‘˜—๐‘˜ฟ") ("GY" "๐‘˜•๐‘˜ฟ๐‘˜—๐‘˜ฟ") ("dny" "๐‘˜•๐‘˜ฟ๐‘˜—๐‘˜ฟ") ; not in ITRANS Devanagari table ("x" "๐‘˜Ž๐‘˜ฟ๐‘˜ฌ๐‘˜ฟ") ("ks" "๐‘˜Ž๐‘˜ฟ๐‘˜ญ๐‘˜ฟ") ("ksh" "๐‘˜Ž๐‘˜ฟ๐‘˜ฌ๐‘˜ฟ") ("gH" ๐‘˜๐‘˜ฟ) ("jH" ๐‘˜•๐‘˜ฟ) ("DH" "๐‘˜š๐‘˜ฟ") ("bH" "๐‘˜ค๐‘˜ฟ")) (independent ("a" "๐‘˜€") ("aa" "๐‘˜") ("A" "๐‘˜") ("i" "๐‘˜ƒ") ("ii" "๐‘˜ƒ") ("I" "๐‘˜ƒ") ("u" "๐‘˜„") ("uu" "๐‘˜„") ("U" "๐‘˜„") ("R" "๐‘˜จ๐‘˜ฒ") ("RRi" "๐‘˜จ๐‘˜ฒ") ("R^i" "๐‘˜จ๐‘˜ฒ") ("LLi" "๐‘˜ฉ๐‘˜ฒ") ; not in ITRANS Devanagari table ("L^i" "๐‘˜ฉ๐‘˜ฒ") ; not in ITRANS Devanagari table (".c" "๐‘˜€๐‘™€") ; not in ITRANS Devanagari table ("ea" "๐‘˜€๐‘™€") ; not in ITRANS Devanagari table ("ee" (set CANDRA-E-O 0) "๐‘˜Š") ; not in ITRANS Devanagari table ("E" "๐‘˜Š") ; not in ITRANS Devanagari table ("e" (set CANDRA-E-O ?๐‘˜€๐‘™€) "๐‘˜Š") ("ai" "๐‘˜‹") ("oo" (set CANDRA-E-O 0) "๐‘˜Œ") ; not in ITRANS Devanagari table ("O" "๐‘˜Œ") ; not in ITRANS Devanagari table ("o" (set CANDRA-E-O ?๐‘˜) "๐‘˜Œ") ("oa" "๐‘˜") ("au" "๐‘˜") ("RRI" "๐‘˜จ๐‘˜ฒ") ; not in ITRANS Devanagari table ("RR" "๐‘˜จ๐‘˜ฒ") ; not in ITRANS Devanagari table ("R^I" "๐‘˜จ๐‘˜ฒ") ; not in ITRANS Devanagari table ("LLI" "๐‘˜ฉ๐‘˜ฒ") ; not in ITRANS Devanagari table ("L^I" "๐‘˜ฉ๐‘˜ฒ") ; not in ITRANS Devanagari table (".N" "๐‘˜ฝ") (".n" "๐‘˜ฝ") ("M" "๐‘˜ฝ") ("H" "๐‘˜พ") ("kH" "แณต") ("pH" "แณถ") (".a" "เคฝ") (".h" "๐‘˜ฟ") ("AUM" "๐‘˜Œ๐‘˜ฝ") ("OM" "๐‘˜Œ๐‘˜ฝ")) (digit ("0" "๐‘™") ("1" "๐‘™‘") ("2" "๐‘™’") ("3" "๐‘™“") ("4" "๐‘™”") ("5" "๐‘™•") ("6" "๐‘™–") ("7" "๐‘™—") ("8" "๐‘™˜") ("9" "๐‘™™") ((KP_0) "๐‘™") ((KP_1) "๐‘™‘") ((KP_2) "๐‘™’") ((KP_3) "๐‘™“") ((KP_4) "๐‘™”") ((KP_5) "๐‘™•") ((KP_6) "๐‘™–") ((KP_7) "๐‘™—") ((KP_8) "๐‘™˜") ((KP_9) "๐‘™™")) (dependent ("a" (delete @-) "") ("aa" (delete @-) "๐‘˜ฐ") ("A" (delete @-) "๐‘˜ฐ") ("i" (delete @-) "๐‘˜ฒ") ("ii" (delete @-) "๐‘˜ฒ") ("I" (delete @-) "๐‘˜ฒ") ("u" (delete @-) "๐‘˜ณ") ("uu" (delete @-) "๐‘˜ณ") ("U" (delete @-) "๐‘˜ณ") ("R" (delete @-) "๐‘˜ฟ๐‘˜จ๐‘˜ฒ") ("RRi" (delete @-) "๐‘˜ฟ๐‘˜จ๐‘˜ฒ") ("R^i" (delete @-) "๐‘˜ฟ๐‘˜จ๐‘˜ฒ") ("LLi" (delete @-) "๐‘˜ฟ๐‘˜ฉ๐‘˜ฒ") ; not in ITRANS Devanagari table ("L^i" (delete @-) "๐‘˜ฟ๐‘˜ฉ๐‘˜ฒ") ; not in ITRANS Devanagari table (".c" (delete @-) "๐‘™€") ; not in ITRANS Devanagari table ("ea" (delete @-) "๐‘™€") ; not in ITRANS Devanagari table ("ee" (delete @-) (set CANDRA-E-O 0) "๐‘˜น") ; not in ITRANS Devanagari table ("E" (delete @-) "๐‘˜น") ; not in ITRANS Devanagari table ("e" (delete @-) (set CANDRA-E-O ?๐‘™€) "๐‘˜น") ("ai" (delete @-) "๐‘˜บ") ("oo" (delete @-) (set CANDRA-E-O 0) "๐‘˜ป") ; not in ITRANS Devanagari table ("O" (delete @-) "๐‘˜ป") ; not in ITRANS Devanagari table ("o" (delete @-) (set CANDRA-E-O ?๐‘˜ฐ) "๐‘˜ป") ("oa" "๐‘˜ฐ") ("au" (delete @-) "๐‘˜ผ") ("RR" (delete @-) "๐‘˜ฟ๐‘˜จ๐‘˜ฒ") ; not in ITRANS Devanagari table ("RRI" (delete @-) "๐‘˜ฟ๐‘˜จ๐‘˜ฒ") ; not in ITRANS Devanagari table ("R^I" (delete @-) "๐‘˜ฟ๐‘˜จ๐‘˜ฒ") ; not in ITRANS Devanagari table ("LLI" (delete @-) "๐‘˜ฟ๐‘˜ฉ๐‘˜ฒ") ; not in ITRANS Devanagari table ("L^I" (delete @-) "๐‘˜ฟ๐‘˜ฉ๐‘˜ฒ")) ; not in ITRANS Devanagari table (dot ("." (set DOT 1) ".")) (eo-dot-c (".c" (delete @-) (insert CANDRA-E-O))) (danda (".." "๐‘™") ; not in ITRANS Devanagari table (".," "๐‘™‚") ; not in ITRANS Devanagari table (". " "๐‘™" (pushback 1)) ((?. Return) "๐‘™" (pushback 1)) ((?. Tab) "๐‘™" (pushback 1)) (".(" "๐‘™" (pushback 1)) (".)" "๐‘™" (pushback 1)) (".[" "๐‘™" (pushback 1)) (".]" "๐‘™" (pushback 1)) (".{" "๐‘™" (pushback 1)) (".}" "๐‘™" (pushback 1)) (".'" "๐‘™" (pushback 1)) (".\"" "๐‘™" (pushback 1))) (commit-key ((S-C-Return))) (backspace ((BackSpace) (undo)))) (state (init (starter (pushback 1) (shift intermediate))) (intermediate ;; CANDRA-E-O is set to the character CANDRA E or CANDRA O when "e" ;; or "o" is typed, and in that case, if ".c" is typed, the ;; character set to CANDRA-E-O is inserted. (t (set CANDRA-E-O 0)) ;; LAST-HALANT-POS is set to the position after a consonat + HALANT ;; sequence. If the following key is for non-letter, that HALANT ;; character is removed. (consonant (mark LAST-HALANT-POS) (shift second)) (independent (cond (CANDRA-E-O (shift after-eo)) (1 (shift init)))) (digit (shift init)) (danda (shift init)) (backspace) (commit-key (shift init))) (second ;; CANDRA-E-O is set to the character CANDRA E or CANDRA O when "e" ;; or "o" is typed, and in that case, if ".c" is typed, the ;; character set to CANDRA-E-O is inserted. (t (set CANDRA-E-O 0)) (consonant (mark LAST-HALANT-POS)) (dependent (cond (CANDRA-E-O (shift after-eo)) (1 (shift init)))) (danda (cond (trim-last-halant (move LAST-HALANT-POS) (delete @-) (move @>))) (shift init)) (backspace) (commit-key (shift init)) (nil (cond (trim-last-halant (move LAST-HALANT-POS) (delete @-) (move @>))) (shift init))) (after-eo (t (set DOT 0)) (dot) (eo-dot-c (shift init)) (danda (shift init)) (commit-key (shift init)) (nil (cond (DOT (delete @-) (pushback 1))) (shift init)))) ;; Local Variables: ;; coding: utf-8 ;; mode: emacs-lisp ;; End: