| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
(eval-and-compile |
|---|
| 43 |
|
|---|
| 44 |
(defun indian-regexp-of-hashtbl-keys (hashtbl) |
|---|
| 45 |
"Returns the regular expression of hashtable keys." |
|---|
| 46 |
(let (keys) |
|---|
| 47 |
(maphash (lambda (key val) (push key keys)) hashtbl) |
|---|
| 48 |
(regexp-opt keys))) |
|---|
| 49 |
|
|---|
| 50 |
(defvar indian-dev-base-table |
|---|
| 51 |
'( |
|---|
| 52 |
( |
|---|
| 53 |
(?$,15E(B nil) (?$,15F(B ?$,15~(B) (?$,15G(B ?$,15(B) (?$,15H(B ?$,16 (B) (?$,15I(B ?$,16!(B) (?$,15J(B ?$,16"(B) |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
$,15\6-5^(B" "$,15U6-5w(B") |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
$,16-5p(B" "$,15p6-(B" "$,15d6-5p(B" "$,15v6-5p(B" "$,15|(B"))) |
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
$,18<8m8>(B" nil) |
|---|
| 90 |
|
|---|
| 91 |
(B nil nil ?$,18m(B nil nil) |
|---|
| 92 |
( |
|---|
| 93 |
?$,19&(B ?$,19'(B ?$,19((B ?$,19)(B ?$,19*(B ?$,19+(B ?$,19,(B ?$,19-(B ?$,19.(B ?$,19/(B) |
|---|
| 94 |
( |
|---|
| 95 |
"$,18m8P(B" "$,18P8m(B" "$,18D8m8P(B" "$,18V8m8P(B" "$,18\(B"))) |
|---|
| 96 |
|
|---|
| 97 |
(defvar indian-gjr-base-table |
|---|
| 98 |
'( |
|---|
| 99 |
( |
|---|
| 100 |
(?$,19E(B nil) (?$,19F(B ?$,19~(B) (?$,19G(B ?$,19(B) (?$,19H(B ?$,1: (B) (?$,19I(B ?$,1:!(B) (?$,19J(B ?$,1:"(B) |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
$,19\:-9^(B" "$,19U:-9w(B") |
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
$,1:-9p(B" "$,19p:-(B" "$,19d:-9p(B" "$,19v:-9p(B" "$,19|(B"))) |
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
(B ?$,1 |
|---|
| 130 |
?$,1 |
|---|
| 131 |
?$,1 |
|---|
| 132 |
?$,1 |
|---|
| 133 |
?$,1 |
|---|
| 134 |
nil nil nil nil ?$,1 |
|---|
| 135 |
"$,1:|;M:~(B" "$,1:u;M;7(B") |
|---|
| 136 |
( |
|---|
| 137 |
?$,1:a(B ?$,1:b(B ?$,1:c(B ?$,1 |
|---|
| 138 |
( |
|---|
| 139 |
?$,1 |
|---|
| 140 |
( |
|---|
| 141 |
"$,1;M;0(B" "$,1;0;M(B" "$,1;$;M;0(B" "$,1;6;M;0(B" "$,1;<(B"))) |
|---|
| 142 |
|
|---|
| 143 |
(defvar indian-bng-base-table |
|---|
| 144 |
'( |
|---|
| 145 |
( |
|---|
| 146 |
(?$,16e(B nil) (?$,16f(B ?$,17>(B) (?$,16g(B ?$,17?(B) (?$,16h(B ?$,17@(B) (?$,16i(B ?$,17A(B) (?$,16j(B ?$,17B(B) |
|---|
| 147 |
(?$,16k(B ?$,17C(B) (?$,16l(B ?$,17b(B) nil nil (?$,16o(B ?$,17G(B) (?$,16p(B ?$,17H(B) |
|---|
| 148 |
nil nil (?$,16s(B ?$,17K(B) (?$,16t(B ?$,17L(B) (?$,17`(B ?$,17D(B) (?$,17a(B ?$,17c(B)) |
|---|
| 149 |
( |
|---|
| 150 |
?$,16u(B ?$,16v(B ?$,16w(B ?$,16x(B ?$,16y(B |
|---|
| 151 |
?$,16z(B ?$,16{(B ?$,16|(B ?$,16}(B ?$,16~(B |
|---|
| 152 |
?$,16(B ?$,17 (B ?$,17!(B ?$,17"(B ?$,17#(B ;; CEREBRALS |
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
$,16|7M6~(B" "$,16u7M77(B") |
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
$,17M70(B" "$,1707M(B" "$,17$7M70(B" "$,1767M70(B" "$,17<(B"))) |
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
(B ?$,17#(B |
|---|
| 176 |
?$,17$(B ?$,17%(B ?$,17&(B ?$,17'(B ?$,17((B nil |
|---|
| 177 |
?$,17*(B ?$,17+(B ?$,17,(B ?$,17-(B ?$,17.(B |
|---|
| 178 |
?$,17/(B ?$,17p(B nil ?$,172(B nil nil ?$,17q(B |
|---|
| 179 |
?$,176(B ?$,177(B ?$,178(B ?$,179(B |
|---|
| 180 |
nil nil nil nil ?$,17\(B ?$,17](B nil ?$,17_(B |
|---|
| 181 |
"$,16|7M6~(B" "$,16u7M77(B") |
|---|
| 182 |
( |
|---|
| 183 |
?$,16a(B ?$,16b(B ?$,16c(B nil ?$,17M(B nil nil) |
|---|
| 184 |
( |
|---|
| 185 |
?$,17f(B ?$,17g(B ?$,17h(B ?$,17i(B ?$,17j(B ?$,17k(B ?$,17l(B ?$,17m(B ?$,17n(B ?$,17o(B) |
|---|
| 186 |
( |
|---|
| 187 |
"$,17M7p(B" "$,17p7M(B" "$,17$7M7p(B" "$,1767M7p(B" "$,17<(B"))) |
|---|
| 188 |
|
|---|
| 189 |
(defvar indian-tlg-base-table |
|---|
| 190 |
'( |
|---|
| 191 |
( |
|---|
| 192 |
(?$,1=E(B nil) (?$,1=F(B ?$,1=~(B) (?$,1=G(B ?$,1=(B) (?$,1=H(B ?$,1> (B) (?$,1=I(B ?$,1>!(B) (?$,1=J(B ?$,1>"(B) |
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
$,1=\>-=^(B" "$,1=U>-=w(B") |
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
$,1>-=p(B" "$,1=p>-(B" "$,1=d>-=p(B" "$,1=v>-=p(B" nil))) |
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
(B ?$,1?#(B |
|---|
| 222 |
?$,1?$(B ?$,1?%(B ?$,1?&(B ?$,1?'(B ?$,1?((B nil |
|---|
| 223 |
?$,1?*(B ?$,1?+(B ?$,1?,(B ?$,1?-(B ?$,1?.(B |
|---|
| 224 |
?$,1?/(B ?$,1?0(B ?$,1?1(B ?$,1?2(B ?$,1?3(B nil ?$,1?5(B |
|---|
| 225 |
?$,1?6(B ?$,1?7(B ?$,1?8(B ?$,1?9(B |
|---|
| 226 |
nil nil nil nil nil nil ?$,1?^(B nil |
|---|
| 227 |
"$,1>|?M>~(B" "$,1>u?M?7(B") |
|---|
| 228 |
( |
|---|
| 229 |
nil ?$,1>b(B ?$,1>c(B nil ?$,1?M(B nil nil) |
|---|
| 230 |
( |
|---|
| 231 |
?$,1?f(B ?$,1?g(B ?$,1?h(B ?$,1?i(B ?$,1?j(B ?$,1?k(B ?$,1?l(B ?$,1?m(B ?$,1?n(B ?$,1?o(B) |
|---|
| 232 |
( |
|---|
| 233 |
"$,1?M?0(B" "$,1?0?M(B" "$,1?$?M?0(B" "$,1?6?M?0(B" nil))) |
|---|
| 234 |
|
|---|
| 235 |
(defvar indian-mlm-base-table |
|---|
| 236 |
'( |
|---|
| 237 |
( |
|---|
| 238 |
(?$,1@%(B nil) (?$,1@&(B ?$,1@^(B) (?$,1@'(B ?$,1@_(B) (?$,1@((B ?$,1@`(B) (?$,1@)(B ?$,1@a(B) (?$,1@*(B ?$,1@b(B) |
|---|
| 239 |
(?$,1@+(B ?$,1@c(B) (?$,1@,(B nil) nil (?$,1@/(B ?$,1@g(B) (?$,1@.(B ?$,1@f(B) (?$,1@0(B ?$,1@h(B) |
|---|
| 240 |
nil (?$,1@3(B ?$,1@k(B) (?$,1@2(B ?$,1@j(B) (?$,1@4(B ?$,1@l(B) nil nil) |
|---|
| 241 |
( |
|---|
| 242 |
?$,1@5(B ?$,1@6(B ?$,1@7(B ?$,1@8(B ?$,1@9(B |
|---|
| 243 |
?$,1@:(B ?$,1@ |
|---|
| 244 |
?$,1@?(B ?$,1@@(B ?$,1@A(B ?$,1@B(B ?$,1@C(B |
|---|
| 245 |
?$,1@D(B ?$,1@E(B ?$,1@F(B ?$,1@G(B ?$,1@H(B nil |
|---|
| 246 |
?$,1@J(B ?$,1@K(B ?$,1@L(B ?$,1@M(B ?$,1@N(B |
|---|
| 247 |
?$,1@O(B ?$,1@P(B ?$,1@Q(B ?$,1@R(B ?$,1@S(B ?$,1@T(B ?$,1@U(B |
|---|
| 248 |
?$,1@V(B ?$,1@W(B ?$,1@X(B ?$,1@Y(B |
|---|
| 249 |
nil nil nil nil nil nil nil nil |
|---|
| 250 |
"$,1@<@m@>(B" "$,1@5@m@W(B") |
|---|
| 251 |
( |
|---|
| 252 |
nil ?$,1@"(B ?$,1@#(B nil ?$,1@m(B nil nil) |
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 |
|
|---|
| 256 |
$,1@m@P(B" "$,1@P@m(B" "$,1@D@m@P(B" "$,1@V@m@P(B" nil))) |
|---|
| 257 |
|
|---|
| 258 |
|
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
|
|---|
| 267 |
|
|---|
| 268 |
|
|---|
| 269 |
|
|---|
| 270 |
|
|---|
| 271 |
|
|---|
| 272 |
|
|---|
| 273 |
$,1<<<m<>(B" "$,1<5<m<W(B") |
|---|
| 274 |
|
|---|
| 275 |
(B ?$,1<#(B nil ?$,1<m(B nil nil) |
|---|
| 276 |
( |
|---|
| 277 |
nil ?$,1='(B ?$,1=((B ?$,1=)(B ?$,1=*(B ?$,1=+(B ?$,1=,(B ?$,1=-(B ?$,1=.(B ?$,1=/(B) |
|---|
| 278 |
( |
|---|
| 279 |
"$,1<m<P(B" "$,1<P<m(B" "$,1<D<m<P(B" nil nil))) |
|---|
| 280 |
|
|---|
| 281 |
(defvar indian-base-table-to-language-alist |
|---|
| 282 |
'((indian-dev-base-table . "Devanagari") |
|---|
| 283 |
(indian-pnj-base-table . "Punjabi") |
|---|
| 284 |
(indian-ori-base-table . "Oriya") |
|---|
| 285 |
(indian-bng-base-table . "Bengali") |
|---|
| 286 |
(indian-asm-base-table . "Assamese") |
|---|
| 287 |
(indian-tlg-base-table . "Telugu") |
|---|
| 288 |
(indian-knd-base-table . "Kannada") |
|---|
| 289 |
(indian-mlm-base-table . "Malayalam") |
|---|
| 290 |
(indian-tml-base-table . "Tamil"))) |
|---|
| 291 |
|
|---|
| 292 |
(defvar indian-itrans-v5-table |
|---|
| 293 |
'( |
|---|
| 294 |
( |
|---|
| 295 |
"a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U") |
|---|
| 296 |
("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai" |
|---|
| 297 |
"o.c" "O" "o" "au" ("RRI" "R^I") ("LLI" "L^I")) |
|---|
| 298 |
( |
|---|
| 299 |
"k" "kh" "g" "gh" ("~N" "N^") |
|---|
| 300 |
"ch" ("Ch" "chh") "j" "jh" ("~n" "JN") |
|---|
| 301 |
"T" "Th" "D" "Dh" "N" |
|---|
| 302 |
"t" "th" "d" "dh" "n" "nh" |
|---|
| 303 |
"p" "ph" "b" "bh" "m" |
|---|
| 304 |
"y" "r" "rh" "l" ("L" "ld") nil ("v" "w") |
|---|
| 305 |
"sh" ("Sh" "shh") "s" "h" |
|---|
| 306 |
"q" "K" "G" ("J" "z") ".D" ".Dh" "f" ("Y" "yh") |
|---|
| 307 |
("GY" "dny") "x") |
|---|
| 308 |
( |
|---|
| 309 |
".N" (".n" "M") "H" ".a" ".h" ("AUM" "OM") ".."))) |
|---|
| 310 |
|
|---|
| 311 |
(defvar indian-kyoto-harvard-table |
|---|
| 312 |
'( |
|---|
| 313 |
( |
|---|
| 314 |
"a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu") |
|---|
| 315 |
"R" ("L" "lR") nil nil "e" "ai" |
|---|
| 316 |
nil nil "o" "au" ("q" "RR" "Q") ("E" "LL" "lRR")) |
|---|
| 317 |
( |
|---|
| 318 |
"k" "kh" "g" "gh" "G" |
|---|
| 319 |
"c" "ch" "j" "jh" "J" |
|---|
| 320 |
"T" "Th" "D" "Dh" "N" |
|---|
| 321 |
"t" "th" "d" "dh" "n" nil |
|---|
| 322 |
"p" "ph" "b" "bh" "m" |
|---|
| 323 |
"y" "r" nil "l" "L" nil "v" |
|---|
| 324 |
("z" "Z") "S" "s" "h" |
|---|
| 325 |
nil nil nil nil nil nil nil nil |
|---|
| 326 |
nil nil) |
|---|
| 327 |
( |
|---|
| 328 |
nil "M" "H" "'" nil "." nil))) |
|---|
| 329 |
|
|---|
| 330 |
(defvar indian-harvard-table |
|---|
| 331 |
'( |
|---|
| 332 |
( |
|---|
| 333 |
"a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu") |
|---|
| 334 |
"R" ("L" "lR") nil nil "e" "ai" |
|---|
| 335 |
nil nil "o" "au" ("RR" "q" "Q") ("LL" "E" "lRR")) |
|---|
| 336 |
( |
|---|
| 337 |
"k" "kh" "g" "gh" "G" |
|---|
| 338 |
"c" "ch" "j" "jh" "J" |
|---|
| 339 |
"T" "Th" "D" "Dh" "N" |
|---|
| 340 |
"t" "th" "d" "dh" "n" nil |
|---|
| 341 |
"p" "ph" "b" "bh" "m" |
|---|
| 342 |
"y" "r" nil "l" "L" nil "v" |
|---|
| 343 |
("z" "Z") "S" "s" "h" |
|---|
| 344 |
nil nil nil nil nil nil nil nil |
|---|
| 345 |
nil nil) |
|---|
| 346 |
( |
|---|
| 347 |
nil "M" "H" "'" nil "." nil))) |
|---|
| 348 |
|
|---|
| 349 |
(defvar indian-tokyo-table |
|---|
| 350 |
'( |
|---|
| 351 |
( |
|---|
| 352 |
"a" ("A" "aa") "i" ("I" "ii") "u" ("U" "uu") |
|---|
| 353 |
"R" ("L" "lR") nil nil "e" "ai" |
|---|
| 354 |
nil nil "o" "au" ("Q" "RR" "q") ("E" "LL" "lRR")) |
|---|
| 355 |
( |
|---|
| 356 |
"k" "kh" "g" "gh" "G" |
|---|
| 357 |
"c" "ch" "j" "jh" "J" |
|---|
| 358 |
"T" "Th" "D" "Dh" "N" |
|---|
| 359 |
"t" "th" "d" "dh" "n" nil |
|---|
| 360 |
"p" "ph" "b" "bh" "m" |
|---|
| 361 |
"y" "r" nil "l" "L" nil "v" |
|---|
| 362 |
("Z" "z") "S" "s" "h" |
|---|
| 363 |
nil nil nil nil nil nil nil nil |
|---|
| 364 |
nil nil) |
|---|
| 365 |
( |
|---|
| 366 |
nil "M" "H" "'" nil "." nil))) |
|---|
| 367 |
|
|---|
| 368 |
(defvar indian-aiba-table |
|---|
| 369 |
'( |
|---|
| 370 |
( |
|---|
| 371 |
"a" "aa" "i" "ii" "u" "uu" |
|---|
| 372 |
".r" ".l" nil nil "e" "ai" |
|---|
| 373 |
nil nil "o" "au" "~r" "~l") |
|---|
| 374 |
( |
|---|
| 375 |
"k" "kh" "g" "gh" "^n" |
|---|
| 376 |
"c" "ch" "j" "jh" "~n" |
|---|
| 377 |
".t" ".th" ".d" ".dh" ".n" |
|---|
| 378 |
"t" "th" "d" "dh" "n" nil |
|---|
| 379 |
"p" "ph" "b" "bh" "m" |
|---|
| 380 |
"y" "r" nil "l" nil nil "v" |
|---|
| 381 |
"^s" ".s" "s" "h" |
|---|
| 382 |
nil nil nil nil nil nil nil nil |
|---|
| 383 |
nil nil) |
|---|
| 384 |
( |
|---|
| 385 |
nil ".m" ".h" "'" nil "." nil))) |
|---|
| 386 |
|
|---|
| 387 |
(defun mapthread (function seq1 &rest seqrest) |
|---|
| 388 |
"Apply FUNCTION to each element of SEQ1 and return result list. |
|---|
| 389 |
If there are several SEQRESTs, FUNCTION is called with that many |
|---|
| 390 |
arguments, with all possible combinations of these multiple SEQUENCES. |
|---|
| 391 |
Thus, if SEQ1 contains 3 elements and SEQ2 contains 5 elements, then |
|---|
| 392 |
FUNCTION will be called 15 times." |
|---|
| 393 |
(if seqrest |
|---|
| 394 |
(mapcar |
|---|
| 395 |
(lambda (x) |
|---|
| 396 |
(apply |
|---|
| 397 |
'mapthread |
|---|
| 398 |
`(lambda (&rest y) (apply ',function x y)) |
|---|
| 399 |
seqrest)) |
|---|
| 400 |
seq1) |
|---|
| 401 |
(mapcar function seq1))) |
|---|
| 402 |
|
|---|
| 403 |
(defun indian--puthash-char (char trans-char hashtbls) |
|---|
| 404 |
(let ((encode-hash (car hashtbls)) |
|---|
| 405 |
(decode-hash (cdr hashtbls)) |
|---|
| 406 |
) |
|---|
| 407 |
|
|---|
| 408 |
|
|---|
| 409 |
(when (and char trans-char) |
|---|
| 410 |
(if (stringp trans-char) (setq trans-char (list trans-char))) |
|---|
| 411 |
(if (char-valid-p char) (setq char (char-to-string char))) |
|---|
| 412 |
(puthash char (car trans-char) encode-hash) |
|---|
| 413 |
(dolist (trans trans-char) |
|---|
| 414 |
(puthash trans char decode-hash))))) |
|---|
| 415 |
|
|---|
| 416 |
(defun indian--map (f l1 l2) |
|---|
| 417 |
(while l1 |
|---|
| 418 |
(funcall f (pop l1) (pop l2)))) |
|---|
| 419 |
|
|---|
| 420 |
(defun indian--puthash-v (v trans-v hashtbls) |
|---|
| 421 |
(indian--map |
|---|
| 422 |
(lambda (v trans-v) |
|---|
| 423 |
(indian--puthash-char (car v) trans-v hashtbls)) |
|---|
| 424 |
v trans-v)) |
|---|
| 425 |
|
|---|
| 426 |
(defun indian--puthash-c (c trans-c halant hashtbls) |
|---|
| 427 |
(indian--map |
|---|
| 428 |
(lambda (c trans-c) |
|---|
| 429 |
(if (char-valid-p c) (setq c (char-to-string c))) |
|---|
| 430 |
(indian--puthash-char (concat c halant) trans-c hashtbls)) |
|---|
| 431 |
c trans-c)) |
|---|
| 432 |
|
|---|
| 433 |
(defun indian--puthash-m (m trans-m hashtbls) |
|---|
| 434 |
(indian--map |
|---|
| 435 |
(lambda (m trans-m) |
|---|
| 436 |
(indian--puthash-char m trans-m hashtbls)) |
|---|
| 437 |
m trans-m)) |
|---|
| 438 |
|
|---|
| 439 |
(defun indian--puthash-cv (c trans-c v trans-v hashtbls) |
|---|
| 440 |
(indian--map |
|---|
| 441 |
(lambda (c trans-c) |
|---|
| 442 |
(indian--map |
|---|
| 443 |
(lambda (v trans-v) |
|---|
| 444 |
(when (and c trans-c v trans-v) |
|---|
| 445 |
(if (char-valid-p c) (setq c (char-to-string c))) |
|---|
| 446 |
(setq v (if (char-valid-p (cadr v)) (char-to-string (cadr v)) "")) |
|---|
| 447 |
(if (stringp trans-c) (setq trans-c (list trans-c))) |
|---|
| 448 |
(if (stringp trans-v) (setq trans-v (list trans-v))) |
|---|
| 449 |
(indian--puthash-char |
|---|
| 450 |
(concat c v) |
|---|
| 451 |
(apply 'append |
|---|
| 452 |
(mapthread 'concat trans-c trans-v)) |
|---|
| 453 |
hashtbls))) |
|---|
| 454 |
v trans-v)) |
|---|
| 455 |
c trans-c)) |
|---|
| 456 |
|
|---|
| 457 |
(defun indian-make-hash (table trans-table) |
|---|
| 458 |
"Indian Transliteration Hash for decode/encode" |
|---|
| 459 |
(let* ((encode-hash (make-hash-table :test 'equal)) |
|---|
| 460 |
(decode-hash (make-hash-table :test 'equal)) |
|---|
| 461 |
(hashtbls (cons encode-hash decode-hash)) |
|---|
| 462 |
(vowels (elt table 0)) |
|---|
| 463 |
(consonants (elt table 1)) |
|---|
| 464 |
(misc (elt table 2)) |
|---|
| 465 |
(digits (elt table 3)) |
|---|
| 466 |
(halant (char-to-string (elt misc 4))) |
|---|
| 467 |
(trans-vowels (elt trans-table 0)) |
|---|
| 468 |
(trans-consonants (elt trans-table 1)) |
|---|
| 469 |
(trans-misc (elt trans-table 2)) |
|---|
| 470 |
(trans-digits '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9"))) |
|---|
| 471 |
(indian--puthash-v vowels trans-vowels hashtbls) |
|---|
| 472 |
(indian--puthash-c consonants trans-consonants halant hashtbls) |
|---|
| 473 |
(indian--puthash-cv consonants trans-consonants |
|---|
| 474 |
vowels trans-vowels hashtbls) |
|---|
| 475 |
(indian--puthash-m misc trans-misc hashtbls) |
|---|
| 476 |
(indian--puthash-m digits trans-digits hashtbls) |
|---|
| 477 |
hashtbls)) |
|---|
| 478 |
|
|---|
| 479 |
(defvar indian-dev-itrans-v5-hash |
|---|
| 480 |
(indian-make-hash indian-dev-base-table |
|---|
| 481 |
indian-itrans-v5-table)) |
|---|
| 482 |
(defvar indian-dev-kyoto-harvard-hash |
|---|
| 483 |
(indian-make-hash indian-dev-base-table |
|---|
| 484 |
indian-kyoto-harvard-table)) |
|---|
| 485 |
(defvar indian-dev-aiba-hash |
|---|
| 486 |
(indian-make-hash indian-dev-base-table |
|---|
| 487 |
indian-aiba-table)) |
|---|
| 488 |
|
|---|
| 489 |
(defvar indian-pnj-itrans-v5-hash |
|---|
| 490 |
(indian-make-hash indian-pnj-base-table |
|---|
| 491 |
indian-itrans-v5-table)) |
|---|
| 492 |
|
|---|
| 493 |
(defvar indian-gjr-itrans-v5-hash |
|---|
| 494 |
(indian-make-hash indian-gjr-base-table |
|---|
| 495 |
indian-itrans-v5-table)) |
|---|
| 496 |
|
|---|
| 497 |
(defvar indian-ori-itrans-v5-hash |
|---|
| 498 |
(indian-make-hash indian-ori-base-table |
|---|
| 499 |
indian-itrans-v5-table)) |
|---|
| 500 |
|
|---|
| 501 |
(defvar indian-bng-itrans-v5-hash |
|---|
| 502 |
(indian-make-hash indian-bng-base-table |
|---|
| 503 |
indian-itrans-v5-table)) |
|---|
| 504 |
|
|---|
| 505 |
(defvar indian-asm-itrans-v5-hash |
|---|
| 506 |
(indian-make-hash indian-asm-base-table |
|---|
| 507 |
indian-itrans-v5-table)) |
|---|
| 508 |
|
|---|
| 509 |
(defvar indian-tlg-itrans-v5-hash |
|---|
| 510 |
(indian-make-hash indian-tlg-base-table |
|---|
| 511 |
indian-itrans-v5-table)) |
|---|
| 512 |
|
|---|
| 513 |
(defvar indian-knd-itrans-v5-hash |
|---|
| 514 |
(indian-make-hash indian-knd-base-table |
|---|
| 515 |
indian-itrans-v5-table)) |
|---|
| 516 |
|
|---|
| 517 |
(defvar indian-mlm-itrans-v5-hash |
|---|
| 518 |
(indian-make-hash indian-mlm-base-table |
|---|
| 519 |
indian-itrans-v5-table)) |
|---|
| 520 |
|
|---|
| 521 |
(defvar indian-tml-itrans-v5-hash |
|---|
| 522 |
(indian-make-hash indian-tml-base-table |
|---|
| 523 |
indian-itrans-v5-table)) |
|---|
| 524 |
) |
|---|
| 525 |
|
|---|
| 526 |
(defmacro indian-translate-region (from to hashtable encode-p) |
|---|
| 527 |
`(save-excursion |
|---|
| 528 |
(save-restriction |
|---|
| 529 |
(let ((regexp ,(indian-regexp-of-hashtbl-keys |
|---|
| 530 |
(if encode-p (car (eval hashtable)) |
|---|
| 531 |
(cdr (eval hashtable)))))) |
|---|
| 532 |
(narrow-to-region from to) |
|---|
| 533 |
(goto-char (point-min)) |
|---|
| 534 |
(while (re-search-forward regexp nil t) |
|---|
| 535 |
(let ((matchstr (gethash (match-string 0) |
|---|
| 536 |
(if ,encode-p |
|---|
| 537 |
(car ,hashtable) |
|---|
| 538 |
(cdr ,hashtable))))) |
|---|
| 539 |
(if matchstr (replace-match matchstr)))))))) |
|---|
| 540 |
|
|---|
| 541 |
|
|---|
| 542 |
|
|---|
| 543 |
(defun indian-dev-itrans-v5-encode-region (from to) |
|---|
| 544 |
(interactive "r") |
|---|
| 545 |
(indian-translate-region |
|---|
| 546 |
from to indian-dev-itrans-v5-hash t)) |
|---|
| 547 |
|
|---|
| 548 |
(defun indian-dev-itrans-v5-decode-region (from to) |
|---|
| 549 |
(interactive "r") |
|---|
| 550 |
(indian-translate-region |
|---|
| 551 |
from to indian-dev-itrans-v5-hash nil)) |
|---|
| 552 |
|
|---|
| 553 |
(defun indian-dev-kyoto-harvard-encode-region (from to) |
|---|
| 554 |
(interactive "r") |
|---|
| 555 |
(indian-translate-region |
|---|
| 556 |
from to indian-dev-kyoto-harvard-hash t)) |
|---|
| 557 |
|
|---|
| 558 |
(defun indian-dev-kyoto-harvard-decode-region (from to) |
|---|
| 559 |
(interactive "r") |
|---|
| 560 |
(indian-translate-region |
|---|
| 561 |
from to indian-dev-kyoto-harvard-hash nil)) |
|---|
| 562 |
|
|---|
| 563 |
(defun indian-dev-aiba-encode-region (from to) |
|---|
| 564 |
(interactive "r") |
|---|
| 565 |
(indian-translate-region |
|---|
| 566 |
from to indian-dev-aiba-hash t)) |
|---|
| 567 |
|
|---|
| 568 |
(defun indian-dev-aiba-decode-region (from to) |
|---|
| 569 |
(interactive "r") |
|---|
| 570 |
(indian-translate-region |
|---|
| 571 |
from to indian-dev-aiba-hash nil)) |
|---|
| 572 |
|
|---|
| 573 |
|
|---|
| 574 |
|
|---|
| 575 |
|
|---|
| 576 |
|
|---|
| 577 |
|
|---|
| 578 |
|
|---|
| 579 |
|
|---|
| 580 |
(defvar ucs-devanagari-to-is13194-alist |
|---|
| 581 |
'( |
|---|
| 582 |
(?\x0900 . "[U+0900]") |
|---|
| 583 |
(?\x0901 . "(5!(B") |
|---|
| 584 |
(?\x0902 . "(5"(B") |
|---|
| 585 |
(?\x0903 . "(5#(B") |
|---|
| 586 |
(?\x0904 . "[U+0904]") |
|---|
| 587 |
(?\x0905 . "(5$(B") |
|---|
| 588 |
(?\x0906 . "(5%(B") |
|---|
| 589 |
(?\x0907 . "(5&(B") |
|---|
| 590 |
(?\x0908 . "(5'(B") |
|---|
| 591 |
(?\x0909 . "(5((B") |
|---|
| 592 |
(?\x090a . "(5)(B") |
|---|
| 593 |
(?\x090b . "(5*(B") |
|---|
| 594 |
(?\x090c . "(5&i(B") |
|---|
| 595 |
(?\x090d . "(5.(B") |
|---|
| 596 |
(?\x090e . "(5+(B") |
|---|
| 597 |
(?\x090f . "(5,(B") |
|---|
| 598 |
(?\x0910 . "(5-(B") |
|---|
| 599 |
(?\x0911 . "(52(B") |
|---|
| 600 |
(?\x0912 . "(5/(B") |
|---|
| 601 |
(?\x0913 . "(50(B") |
|---|
| 602 |
(?\x0914 . "(51(B") |
|---|
| 603 |
(?\x0915 . "(53(B") |
|---|
| 604 |
(?\x0916 . "(54(B") |
|---|
| 605 |
(?\x0917 . "(55(B") |
|---|
| 606 |
(?\x0918 . "(56(B") |
|---|
| 607 |
(?\x0919 . "(57(B") |
|---|
| 608 |
(?\x091a . "(58(B") |
|---|
| 609 |
(?\x091b . "(59(B") |
|---|
| 610 |
(?\x091c . "(5:(B") |
|---|
| 611 |
(?\x091d . "(5 |
|---|
| 612 |
(?\x091e . "(5<(B") |
|---|
| 613 |
(?\x091f . "(5=(B") |
|---|
| 614 |
(?\x0920 . "(5>(B") |
|---|
| 615 |
(?\x0921 . "(5?(B") |
|---|
| 616 |
(?\x0922 . "(5@(B") |
|---|
| 617 |
(?\x0923 . "(5A(B") |
|---|
| 618 |
(?\x0924 . "(5B(B") |
|---|
| 619 |
(?\x0925 . "(5C(B") |
|---|
| 620 |
(?\x0926 . "(5D(B") |
|---|
| 621 |
(?\x0927 . "(5E(B") |
|---|
| 622 |
(?\x0928 . "(5F(B") |
|---|
| 623 |
(?\x0929 . "(5G(B") |
|---|
| 624 |
(?\x092a . "(5H(B") |
|---|
| 625 |
(?\x092b . "(5I(B") |
|---|
| 626 |
(?\x092c . "(5J(B") |
|---|
| 627 |
(?\x092d . "(5K(B") |
|---|
| 628 |
(?\x092e . "(5L(B") |
|---|
| 629 |
(?\x092f . "(5M(B") |
|---|
| 630 |
(?\x0930 . "(5O(B") |
|---|
| 631 |
(?\x0931 . "(5P(B") |
|---|
| 632 |
(?\x0932 . "(5Q(B") |
|---|
| 633 |
(?\x0933 . "(5R(B") |
|---|
| 634 |
(?\x0934 . "(5S(B") |
|---|
| 635 |
(?\x0935 . "(5T(B") |
|---|
| 636 |
(?\x0936 . "(5U(B") |
|---|
| 637 |
(?\x0937 . "(5V(B") |
|---|
| 638 |
(?\x0938 . "(5W(B") |
|---|
| 639 |
(?\x0939 . "(5X(B") |
|---|
| 640 |
(?\x093a . "[U+093a]") |
|---|
| 641 |
(?\x093b . "[U+093b]") |
|---|
| 642 |
(?\x093c . "(5i(B") |
|---|
| 643 |
(?\x093d . "(5ji(B") |
|---|
| 644 |
(?\x093e . "(5Z(B") |
|---|
| 645 |
(?\x093f . "(5[(B") |
|---|
| 646 |
&nb |
|---|