1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-22 10:26:20 +00:00

Actually add leim/quail/persian.el.

This commit is contained in:
Mohsen BANAN 2011-05-16 14:51:10 +03:00 committed by Eli Zaretskii
parent d0ce9f8c0c
commit edfb8eb9ac

296
leim/quail/persian.el Normal file
View File

@ -0,0 +1,296 @@
;;; persian.el --- Quail package for inputting Persian/Farsi keyboard -*- coding: utf-8;-*-
;; Copyright (C) 2011 Free Software Foundation, Inc.
;; Author: Mohsen BANAN <libre@mohsen.banan.1.byname.net>
;; http://mohsen.banan.1.byname.net/contact
;; Keywords: multilingual, input method, Farsi, Persian, keyboard
;; This file is part of GNU Emacs.
;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; GNU Emacs 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 General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;; This is a Halaal Poly-Existential intended to remain perpetually Halaal.
;;; Commentary:
;;
;; This file contains a collection of input methods for
;; Persian languages (Farsi, Urdu, Pashto/Afghanic, ...)
;;
;; At this time, the following input methods are specified:
;;
;; - (farsi) Persian Keyboard based on Islamic Republic of Iran's ISIR-9147
;; - (farsi-translit) Intuitive transliteration keyboard layout for Persian
;;
;;; Code:
(require 'quail)
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; farsi
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; The keyboard mapping defined here is based on:
;;
;; Institute of Standards and Industrial Research of Iran
;; Information Technology Layout of Persian Letters and Symbols on Computer Keyboards
;; ISIRI 9147 -- 1st edition
;; http://www.isiri.org/UserStd/DownloadStd.aspx?id=9147
;;
;; Only layers 1 and 2 of ISIRI-9147 are applicable to emacs.
;;
;; This input method was built using the Farsi table in X Keyboard Configuration Data Base.
;;
;; 0) Selected gnome keyboard "USA"
;; 1) Created a list of all keys
;; 2) Selected gnome keyboard "Iran"
;; 3) For each key just press it and get the mapped persian character
;;
(quail-define-package
"farsi" "Farsi" " ف" nil "Farsi input method.
Based on ISIRI-9149 Layout of Persian Letters and Symbols on Computer Keyboards.
" nil t t t t nil nil nil nil nil t)
;; +----------------------------------------------------------------+
;; | ۱! | ۲٬ | ۳٫ | ۴﷼ | ۵٪ | ۶× | ۷، | ۸* | ۹) | ۰( | -ـ | =+ | `÷ |
;; +----------------------------------------------------------------+
;; | ضْ| صٌ| ثٍ| قً| فُ| غِ| عَ| هّ| خ] | ح[ | ج} | چ{ |
;; +------------------------------------------------------------+
;; | شؤ | سئ | یي | بإ | لأ | اآ | تة | ن» | م« | ک: | گ؛ | \| |
;; +-----------------------------------------------------------+
;; | ظك | طٓ| زژ | رٰ| ذB | دٔ| پء | و> | .< | /؟ |
;; +-------------------------------------------+
(quail-define-rules
("1" ?۱)
("2" )
("3" )
("4" )
("5" ?۵)
("6" )
("7" ?۷)
("8" )
("9" )
("0" ?۰)
("-" ?-)
("=" ?=)
;;("`" ?\)) ;; اتصال مجازى
("q" )
("w" )
("e" )
("r" )
("t" )
("y" )
("u" )
("i" ?ه)
("o" )
("p" )
("[" )
("]" )
("a" )
("s" )
("d" )
("f" )
("g" )
("h" ?ا)
("j" )
("k" )
("l" )
(";" )
("'" )
("\\" ?\\) ;; خط اريب وارو
("z" )
("x" )
("c" )
("v" )
("b" )
("n" )
("m" )
("," )
("." ?.)
("/" ?/)
("!" ?!)
("@" )
("#" ?٫)
("$" ?﷼)
("%" )
("^" ?×)
("&" )
("*" ?*)
("(" ?\))
(")" ?\()
("_" )
("+" ?+)
("~" )
("Q" ) ;; ساکن فارسى
("W" ) ;; دو پيش فارسى -- تنوين رفع
("E" ) ;; دو زير فارسى -- تنوين جر
("R" ) ;; دو زبر فارسى -- تنوين نصب
("T" ) ;; پيش فارسى -- ضمه
("Y" ) ;; زير فارسى -- کسره
("U" ) ;; زبر فارسى -- فتحه
("I" ) ;; تشديد فارسى
("O" ?\])
("P" ?\[)
("{" ?})
("}" ?{)
("A" )
("S" )
("D" )
("F" )
("G" )
("H" )
("J" )
("K" )
("L" )
(":" ?:)
("\"" )
("|" ?|)
("Z" )
("X" )
("C" )
("V" )
;; ("B" ?) ;; فاصلهً مجازى
("N" ) ;; همزه فارسى بالا
("M" ) ;; harf farsi hamzeh
("<" ?>)
(">" ?<)
("?" )
)
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; farsi-translit
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; This is a persian/farsi transliteration keyboard designed
;;; for people who:
;;; - Know how to write in farsi
;;; - Are comfortable with the qwerty keyboard
;;; - Are familiar with two letter phonetic mapping to persian characters
;;; (e.g.: gh, kh, ch, sh, zh, hh, lh)
;;;
;;; This translit keyboard is designed to be intuitive such that
;;; mapping are easy and natural to remember for a persian writer.
;;; For some persian characters there are multiple ways of inputing
;;; the same character.
;;;
;;; The letter 'h' is used for a number of two character mappings,
;;; this means that some character sequence inputs need to be repeated
;;; followed by a backspace followed by the 'h'.
;;; For example: سحر = 's' 's' '<bs>' 'h' 'h' 'r'
;;; In practice such sequences are rare.
;;;
(quail-define-package
"farsi-translit" "Farsi" "پ" t
"Intuitive transliteration keyboard layout for persian/farsi.
" nil t t t t nil nil nil nil nil t)
(quail-define-rules
("a" ?ا)
("A" ) ;; alef madde
("b" )
("p" )
("t" )
("c" )
("j" )
("ch" )
("hh" )
("kh" )
("d" )
("Z" )
("r" )
("z" )
("zh" )
("s" )
("sh" )
("S" )
("x" )
("T" )
("X" )
("w" )
("Q" )
("f" )
("q" )
("gh" )
("k" )
("K" ) ;; Arabic kaf
("g" )
("l" )
("lh" ?ﻻ)
("m" )
("n" )
("v" )
("V" )
("u" )
("H" ?ه)
("h" ?ه)
("th" ) ;; ta marbuteh
("yh" ) ;; he ye
("y" )
("i" )
("I" )
("1" ?۱)
("2" )
("3" )
("4" )
("5" ?۵)
("6" )
("7" ?۷)
("8" )
("9" )
("0" ?۰)
("F" )
("G" )
("~" ) ;; tashdid ;; تشديد فارسى
("`" )
("e" ) ;; zir زير فارسى -- فتحه
("E" ) ;; eizan ;; دو زير فارسى -- تنوين جر
("#" ) ;; ً tanvin nasb ;; دو زبر فارسى -- تنوين نصب
("@" ) ;; ساکن فارسى
("^" ) ;; zbar ;; زبر فارسى -- فتحه
("o" ) ;; peesh ;; پيش فارسى -- ضمه
("O" ) ;; دو پيش فارسى -- تنوين رفع
("?" ) ;; alamat soal
("&" ) ;; همزه فارسى بالا
("$" ) ;; hamzeh
("%" ) ;;
("*" ?×) ;;
(";" ) ;;
(",h" ) ;; farsi
(",h" ?,) ;; latin
("." ?.) ;;
("_" ) ;;
)
;;; persian.el ends here