For those who would like a more phonetic Hindi keyboard than is provided by the Phonetic, Itrans or Inscript keyboards in SCIM/M17n, I thought I'd share a couple of tweaks specific to Hindi input. I previously wrote a howto for Sanskrit input here, but obviously it's not ideal for Hindi. But based on the same setup, I've come up with two alternatives for Hindi. In both, the final virām or halant (्) is dropped by default from the ends of words. The first is for folks who still want a somewhat Sanskrit-like input for Hindi, i.e., (1) where you still type every consonant's inherent 'a' (अ) vowel within—but not at the end of—a word (e.g., करके = karake) and (2) the conjunct consonants combine automatically (e.g., प्रकाश = prakaash). The second alternative is for those who would like (1) every consonant's inherent 'a' (अ) vowel to be dropped by default (करके = karke) and (2) for conjunct consonants not to be combined automatically (here the 'w' or another dead key of your choice signals that a consonant should join with the following one, e.g., प्रकाश = wprakaash or wprkaash). I myself am not a fan of dead keys (like the 'w' in the second method), but I've included it for those who feel that not typing every 'a' within a word is worth typing a 'w' before every conjunct consonant. You of course can easily further tweak these setups to your liking, just be sure to avoid conflicts (which are not always obvious!). OK, for the setup:
- Install and set up ibus. Ubuntu has come a long way with preconfiguring the input method editor, ibus, for us. It is now ready to go practically out of the box. All you need to do is go to: System > Administration > Language Support, and in the Language Tab select ibus for your "Keyboard Input Method System"
- Then click the button Install / Remove Languages..., click Hindi and Apply Changes. Once ibus/m17n is installed, logout and log back in or reboot, and ibus should be up and running. There is now a great page for ibus documentation here, which should be your first stop if the above does not get ibus running (with a keyboard on your panel).
- Create a new input file.
- Create a new input method file:
Choose only one method of input below, select that text and copy it into your new hi-itransish.mim file and save:Code:sudo gedit /usr/share/m17n/hi-itransish.mim
- For those who prefer to type word-internal 'a' vowels and have conjunct consonants (e.g., क्ष ) combine automatically, copy and paste the text below, then save and exit:
For those who prefer not to type word-internal 'a' vowels, but use a dead key to form conjunct consonants, copy and paste the text below, then save and exit:Code:;; hi-itransish.mim -- Hindi 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 hi itransish) (description "Hindi 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" "घ्") ("G" "ङ्") ("c" "च्") ("ch" "छ्") ("j" "ज्") ("jh" "झ्") ("~n" "ञ्") (".t" "ट्") (".th" "ठ्") (".d" "ड्") (".dh" "ढ्") (".n" "ण्") ("t" "त्") ("th" "थ्") ("d" "द्") ("dh" "ध्") ("n" "न्") ("xn" "ऩ्") ("p" "प्") ("ph" "फ्") ("b" "ब्") ("bh" "भ्") ("m" "म्") ("y" "य्") ("r" "र्") ("xr" "ऱ्") ("l" "ल्") ("xl" "ळ्") ("v" "व्") ("sh" "श्") (".s" "ष्") ("s" "स्") ("h" "ह्") ("q" "क़्") ("xkh" "ख़्") ("xg" "ग़्") ("xj" "ज़्") ("z" "ज़्") ("x.d" "ड़्") ("x.dh" "ढ़्") ("f" "फ़्") ("xy" "य़्") ("k " "क ") ("kh " "ख ") ("g " "ग ") ("gh " "घ ") ("G " "ङ ") ("c " "च ") ("ch " "छ ") ("j " "ज ") ("jh " "झ ") ("~n " "ञ ") (".t " "ट ") (".th " "ठ ") (".d " "ड ") (".dh " "ढ ") (".n " "ण ") ("t " "त ") ("th " "थ ") ("d " "द ") ("dh " "ध ") ("n " "न ") ("xn " "ऩ ") ("p " "प ") ("ph " "फ ") ("b " "ब ") ("bh " "भ ") ("m " "म ") ("y " "य ") ("r " "र ") ("xr " "ऱ ") ("l " "ल ") ("xl " "ळ ") ("v " "व ") ("sh " "श ") (".s " "ष ") ("Sh" "ष्") ("s " "स ") ("h " "ह ") ("q " "क़ ") ("xkh " "ख़ ") ("xg " "ग़ ") ("xj " "ज़ ") ("z " "ज़ ") ("x.d " "ड़ ") ("x.dh " "ढ़ ") ("f " "फ़ ") ("xy " "य़ ") ("j~n " "ज्ञ ") ("GY" "ज्ञ्") ("GY " "ज्ञ ") ) (independent ("a" "अ") ("aa" "आ") ("A" "आ") ("i" "इ") ("ii" "ई") ("I" "ई") ("u" "उ") ("uu" "ऊ") ("U" "ऊ") (".r" "ऋ") ("RRi" "ऋ") ("R^i" "ऋ") ("LLi" "ऌ") ("L^i" "ऌ") (".l" "ऌ") ("^c" "ऍ") ("e^c" "ऍ") ("E" "ऎ") ("e" "ए") ("ai" "ऐ") ("o^c" "ऑ") ("O" "ऒ") ("o" "ओ") ("au" "औ") ("RRI" "ॠ") ("R^I" "ॠ") (".R" "ॠ") ("LLI" "ॡ") ("L^I" "ॡ") (".L" "ॡ") (".N" "ँ") (".m" "ं") ("M" "ं") ("H" "ः") (".a" "ऽ") (".`" "्") ("AUM" "ॐ") ("OM" "ॐ") (".." "।") (".," "॥") ("0" "०") ("1" "१") ("2" "२") ("3" "३") ("4" "४") ("5" "५") ("6" "६") ("7" "७") ("8" "८") ("9" "९") ("#" "्र") ("$" "र्") ("^" "त्र") ("*" "श्र") ("]" "़") ((S-\ ) "*") ((C-@) "*")) (dependent ("a" (delete @-) "") ("aa" (delete @-) "ा") ("A" (delete @-) "ा") ("i" (delete @-) "ि") ("ii" (delete @-) "ी") ("I" (delete @-) "ी") ("u" (delete @-) "ु") ("uu" (delete @-) "ू") ("U" (delete @-) "ू") ("RRi" (delete @-) "ृ") ("R^i" (delete @-) "ृ") (".r" (delete @-) "ृ") ("LLi" (delete @-) "ॢ") ("L^i" (delete @-) "ॢ") (".l" (delete @-) "ॢ") ("^c" (delete @-) "ॅ") ("e^c" (delete @-) "ॅ") ("E" (delete @-) "ॆ") ("e" (delete @-) "े") ("ai" (delete @-) "ै") ("o^c" (delete @-) "ॉ") ("O" (delete @-) "ॊ") ("o" (delete @-) "ो") ("au" (delete @-) "ौ") ("RRI" (delete @-) "ॄ") ("R^I" (delete @-) "ॄ") (".R" (delete @-) "ॄ") ("LLI" (delete @-) "ॣ") (".L" (delete @-) "ॣ") ("L^I" (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:Code:;; hi-itransish.mim -- Hindi 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 hi itransish) (description "Hindi 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" "घ") ("G" "ङ") ("c" "च") ("ch" "छ") ("j" "ज") ("jh" "झ") ("~n" "ञ") (".t" "ट") (".th" "ठ") (".d" "ड") (".dh" "ढ") (".n" "ण") ("t" "त") ("th" "थ") ("d" "द") ("dh" "ध") ("n" "न") ("xn" "ऩ") ("p" "प") ("ph" "फ") ("b" "ब") ("bh" "भ") ("m" "म") ("y" "य") ("r" "र") ("xr" "ऱ") ("l" "ल") ("xl" "ळ") ("v" "व") ("sh" "श") (".s" "ष") ("Sh" "ष") ("s" "स") ("h" "ह") ("q" "क़") ("xkh" "ख़") ("xg" "ग़") ("xj" "ज़") ("z" "ज़") ("x.d" "ड़") ("x.dh" "ढ़") ("f" "फ़") ("xy" "य़") ("j~n" "ज्ञ") ("GY" "ज्ञ") ("wk" "क्") ("wkh" "ख्") ("wg" "ग्") ("wgh" "घ्") ("wG" "ङ्") ("wc" "च्") ("wch" "छ्") ("wj" "ज्") ("wjh" "झ्") ("w~n" "ञ्") ("w.t" "ट्") ("w.th" "ठ्") ("w.d" "ड्") ("w.dh" "ढ्") ("w.n" "ण्") ("wt" "त्") ("wth" "थ्") ("wd" "द्") ("wdh" "ध्") ("wn" "न्") ("wxn" "ऩ्") ("wp" "प्") ("wph" "फ्") ("wb" "ब्") ("wbh" "भ्") ("wm" "म्") ("wy" "य्") ("wr" "र्") ("wxr" "ऱ्") ("wl" "ल्") ("wxl" "ळ्") ("wv" "व्") ("wsh" "श्") ("w.s" "ष्") ("wSh" "ष्") ("ws" "स्") ("wh" "ह्") ("wq" "क़्") ("wxkh" "ख़्") ("wxg" "ग़्") ("wxj" "ज़्") ("wz" "ज़्") ("wGY" "ज्ञ्") ("wx.d" "ड़्") ("wx.dh" "ढ़्") ("wf" "फ़्") ("wxy" "य़्")) (independent ("a" "अ") ("aa" "आ") ("A" "आ") ("i" "इ") ("ii" "ई") ("I" "ई") ("u" "उ") ("uu" "ऊ") ("U" "ऊ") (".r" "ऋ") ("RRi" "ऋ") ("R^i" "ऋ") (".l" "ऌ") ("^c" "ॅ") ("e^c" "ऍ") ("E" "ऎ") ("e" "ए") ("ai" "ऐ") ("o^c" "ऑ") ("O" "ऒ") ("o" "ओ") ("au" "औ") ("RRI" "ॠ") ("R^I" "ॠ") (".R" "ॠ") (".L" "ॡ") (".N" "ँ") (".m" "ं") ("M" "ं") ("H" "ः") (".a" "ऽ") (".`" "्") ("AUM" "ॐ") ("OM" "ॐ") (".." "।") (".," "॥") ("0" "०") ("1" "१") ("2" "२") ("3" "३") ("4" "४") ("5" "५") ("6" "६") ("7" "७") ("8" "८") ("9" "९") ("#" "्र") ("$" "र्") ("^" "त्र") ("*" "श्र") ("]" "़") ((S-\ ) "*") ((C-@) "*")) (dependent ("a" "") ("aa" "ा") ("A" "ा") ("i" "ि") ("ii" "ी") ("I" "ी") ("u" "ु") ("uu" "ू") ("U" "ू") ("RRi" "ृ") ("R^i" "ृ") (".r" "ृ") (".l" "ॢ") ("^c" "ॅ") ("E" "ॆ") ("e" "े") ("ai" "ै") ("o^c" "ॉ") ("O" "ॊ") ("o" "ो") ("au" "ौ") ("RRI" "ॄ") ("R^I" "ॄ") (".R" "ॄ") (".L" "ॣ")) (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:- Update the m17n database.
- Open the database file:
Code:sudo gedit /usr/share/m17n/mdb.dir- Replace the following code
withCode:(input-method * "*.mim") ;;; </ul>
Code:(input-method * "*.mim") (input-method t hi-itransish "hi-itransish.mim") ;;; </ul>- Save and exit the mdb.dir file.
- Hold back m17n-db. One neat trick is to hold back the m17n database package so it won't update and overwrite your edits (you'll be warned first before dist-upgrades). To do that, enter in a terminal:
and upgrades will bypass m17n, thus preserving your edits. If you opt not to hold that file, you'll just need to repeat the steps above after updates to m17n to show the m17n-db file your hi-itransish.mim file. For more information on holding and releasing packages, see here.Code:echo "m17n-db hold" | sudo dpkg --set-selections- Reboot for your changes to take effect and then configure ibus as necessary using "ibus Setup."
That's it, शाबाश! You should now have a relatively more phonetic Hindi keyboard at your disposal. Please do post feedback on this howto so I can correct / update the post and help troubleshoot any problems. I am a linux newb btw, so if there's anything I'm missing here, please feel free to point it out. Thanks.



Adv Reply




Bookmarks