Transliteration in Emacs


This is a combination of company (completion framework UI) and quail (Unicode input method) in Emacs.
indian-dev-itrans-v5-hash defines a mapping between ASCII symbols (indian-itrans-v5-table) and target language Unicode symbols (indian-dev-base-table). It is defined as 

(defvar indian-dev-itrans-v5-hash
  (indian-make-hash indian-dev-base-table
              indian-itrans-v5-table))

Quick Test

(require 'ind-util)
(setq company-i18n-input-hash indian-dev-itrans-v5-hash)
(setq company-backends '(company-i18n))
(company-i18n 'trans "aa")   ;; Gives "आ"
 


Code: company-i18n

Config:

(add-to-list 'company-backends 'company-i18n)

;; Use appropriate hash for other languages. See files in emacs/lisp/language directory 

(require 'ind-util)

;; Hindi

(setq company-i18n-input-hash indian-dev-itrans-v5-hash)

;; Tamil

(setq company-i18n-input-hash indian-tml-itrans-v5-hash)

;; Kannada

(setq company-i18n-input-hash indian-knd-itrans-v5-hash)

;; Bengali

(setq company-i18n-input-hash indian-bng-itrans-v5-hash)

;; Gujarati

(setq company-i18n-input-hash indian-gjr-itrans-v5-hash)









Comments

Popular posts from this blog

GNU Emacs as a Comic Book Reader

Data Visualization with GNU Emacs

Mozilla Readability in GNU Emacs