;;; ind-util.el --- Transliteration and Misc. Tools for Indian Languages -*- coding: iso-2022-7bit; -*-
-;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2001-2012 Free Software Foundation, Inc.
;; Maintainer: KAWABATA, Taichi <kawabata@m17n.org>
;; Keywords: multilingual, Indian, Devanagari
(;; Misc Symbols
nil ?\e$,1<"\e(B ?\e$,1<#\e(B nil ?\e$,1<m\e(B nil nil)
(;; Digits
- nil ?\e$,1='\e(B ?\e$,1=(\e(B ?\e$,1=)\e(B ?\e$,1=*\e(B ?\e$,1=+\e(B ?\e$,1=,\e(B ?\e$,1=-\e(B ?\e$,1=.\e(B ?\e$,1=/\e(B)
+ ?\e$,1=&\e(B ?\e$,1='\e(B ?\e$,1=(\e(B ?\e$,1=)\e(B ?\e$,1=*\e(B ?\e$,1=+\e(B ?\e$,1=,\e(B ?\e$,1=-\e(B ?\e$,1=.\e(B ?\e$,1=/\e(B)
(;; Inscript-extra (4) (#, $, ^, *, ])
"\e$,1<m<P\e(B" "\e$,1<P<m\e(B" "\e$,1<D<m<P\e(B" nil nil)))
(;; misc -- 7
".N" (".n" "M") "H" ".a" ".h" ("AUM" "OM") "..")))
+(defvar indian-itrans-v5-table-for-tamil
+ '(;; for encode/decode
+ (;; vowels -- 18
+ "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U")
+ ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai"
+ "o.c" "O" "o" "au" ("RRI" "R^I") ("LLI" "L^I"))
+ (;; consonants -- 40
+ "k" "kh" "g" "gh" ("~N" "N^")
+ "ch" ("Ch" "chh") "j" "jh" ("~n" "JN")
+ "T" "Th" "D" "Dh" "N"
+ "t" "th" "d" "dh" "n" "nh"
+ "p" "ph" "b" "bh" "m"
+ "y" "r" "rh" "l" ("L" "ld") ("J" "z") ("v" "w")
+ "sh" ("Sh" "shh") "s" "h"
+ "q" "K" "G" nil ".D" ".Dh" "f" ("Y" "yh")
+ ("GY" "dny") "x")
+ (;; misc -- 7
+ ".N" (".n" "M") "H" ".a" ".h" ("AUM" "OM") "..")))
+
(defvar indian-kyoto-harvard-table
'(;; for encode/decode
(;; vowel
(;; misc
nil ".m" ".h" "'" nil "." nil)))
-(defun mapthread (function seq1 &rest seqrest)
- "Apply FUNCTION to each element of SEQ1 and return result list.
-If there are several SEQRESTs, FUNCTION is called with that many
-arguments, with all possible combinations of these multiple SEQUENCES.
-Thus, if SEQ1 contains 3 elements and SEQ2 contains 5 elements, then
-FUNCTION will be called 15 times."
- (if seqrest
- (mapcar
- (lambda (x)
- (apply
- 'mapthread
- `(lambda (&rest y) (apply ',function x y))
- seqrest))
- seq1)
- (mapcar function seq1)))
+(defun combinatorial (head &rest tail)
+ (if tail
+ (apply 'append
+ (mapcar (lambda (y) (mapcar (lambda (x) (cons x y)) head))
+ (apply 'combinatorial tail)))
+ (mapcar 'list head)))
(defun indian--puthash-char (char trans-char hashtbls)
(let ((encode-hash (car hashtbls)) ;; char -> trans
(if (stringp trans-v) (setq trans-v (list trans-v)))
(indian--puthash-char
(concat c v)
- (apply 'append
- (mapthread 'concat trans-c trans-v))
+ (mapcar (lambda (x) (apply 'concat x))
+ (combinatorial trans-c trans-v))
hashtbls)))
v trans-v))
c trans-c))
(defvar indian-tml-itrans-v5-hash
(indian-make-hash indian-tml-base-table
- indian-itrans-v5-table))
+ indian-itrans-v5-table-for-tamil))
)
(defmacro indian-translate-region (from to hashtable encode-p)
(provide 'ind-util)
-;; arch-tag: 59aacd71-46c2-4cb3-bb26-e12bbad55545
;;; ind-util.el ends here