Mercurial > emacs
comparison lisp/language/devan-util.el @ 41551:12026034433c
(dev-glyph-glyph, dev-glyph-glyph-2)
(devanagari-compose-syllable-region):
Escape `"' in string literals.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 26 Nov 2001 11:50:01 +0000 |
parents | 2d7f7eb667ad |
children | e440e843e050 |
comparison
equal
deleted
inserted
replaced
41550:a55ea4046e6f | 41551:12026034433c |
---|---|
429 ;; glyph-to-glyph conversion table. | 429 ;; glyph-to-glyph conversion table. |
430 ;; it is supposed that glyphs are ordered in | 430 ;; it is supposed that glyphs are ordered in |
431 ;; [consonant/nukta] - [matra/halant] - [preceding-r] - [anuswar]. | 431 ;; [consonant/nukta] - [matra/halant] - [preceding-r] - [anuswar]. |
432 | 432 |
433 (defvar dev-glyph-glyph | 433 (defvar dev-glyph-glyph |
434 '(("\$,4"'(B\$,4"&(B" . "\$,4"((B") | 434 '(("\$,4\"'(B\$,4\"&(B" . "\$,4\"((B") |
435 ("\$,4"'(B\$,4"$(B" . "\$,4"((B") | 435 ("\$,4\"'(B\$,4\"$(B" . "\$,4\"((B") |
436 ("$,4"*(B\$,4"&(B" . "$,4"+(B") | 436 ("$,4\"*(B\$,4\"&(B" . "$,4\"+(B") |
437 ("$,4"*(B\$,4"'(B" . "$,4",(B") | 437 ("$,4\"*(B\$,4\"'(B" . "$,4\",(B") |
438 ("$,4"*(B\$,4"'(B\$,4"&(B" . "$,4"-(B") | 438 ("$,4\"*(B\$,4\"'(B\$,4\"&(B" . "$,4\"-(B") |
439 ("$,4"2(B\$,4"&(B" . "$,4"3(B") | 439 ("$,4\"2(B\$,4\"&(B" . "$,4\"3(B") |
440 ("$,4"2(B\$,4"'(B" . "$,4"4(B") | 440 ("$,4\"2(B\$,4\"'(B" . "$,4\"4(B") |
441 ("$,4"2(B\$,4"'(B\$,4"&(B" . "$,4"5(B") | 441 ("$,4\"2(B\$,4\"'(B\$,4\"&(B" . "$,4\"5(B") |
442 ("$,4"#(B\$,4"6(B" . "$,4"7(B") | 442 ("$,4\"#(B\$,4\"6(B" . "$,4\"7(B") |
443 ("$,4"%(B\$,4"6(B" . "$,4"8(B") | 443 ("$,4\"%(B\$,4\"6(B" . "$,4\"8(B") |
444 ;;("$,4"6(B" . "$,4"9(B") | 444 ;;("$,4\"6(B" . "$,4\"9(B") |
445 ("$,4"#(B\$,4":(B" . "$,4";(B") | 445 ("$,4\"#(B\$,4\":(B" . "$,4\";(B") |
446 ("$,4"%(B\$,4":(B" . "$,4"<(B") | 446 ("$,4\"%(B\$,4\":(B" . "$,4\"<(B") |
447 ;;("$,4":(B" . "$,4"=(B") | 447 ;;("$,4\":(B" . "$,4\"=(B") |
448 ("\$,4"@(B\$,4"&(B" . "\$,4"A(B") | 448 ("\$,4\"@(B\$,4\"&(B" . "\$,4\"A(B") |
449 ("\$,4"@(B\$,4"'(B" . "\$,4"B(B") | 449 ("\$,4\"@(B\$,4\"'(B" . "\$,4\"B(B") |
450 ("\$,4"@(B\$,4"'(B\$,4"&(B" . "\$,4"C(B") | 450 ("\$,4\"@(B\$,4\"'(B\$,4\"&(B" . "\$,4\"C(B") |
451 ("\$,4"D(B\$,4"&(B" . "\$,4"E(B") | 451 ("\$,4\"D(B\$,4\"&(B" . "\$,4\"E(B") |
452 ("\$,4"D(B\$,4"'(B" . "\$,4"F(B") | 452 ("\$,4\"D(B\$,4\"'(B" . "\$,4\"F(B") |
453 ("\$,4"D(B\$,4"'(B\$,4"&(B" . "\$,4"G(B") | 453 ("\$,4\"D(B\$,4\"'(B\$,4\"&(B" . "\$,4\"G(B") |
454 ("\$,4"H(B\$,4"&(B" . "\$,4"I(B") | 454 ("\$,4\"H(B\$,4\"&(B" . "\$,4\"I(B") |
455 ("\$,4"H(B\$,4"'(B" . "\$,4"J(B") | 455 ("\$,4\"H(B\$,4\"'(B" . "\$,4\"J(B") |
456 ("\$,4"H(B\$,4"'(B\$,4"&(B" . "\$,4"K(B") | 456 ("\$,4\"H(B\$,4\"'(B\$,4\"&(B" . "\$,4\"K(B") |
457 ("\$,4"L(B\$,4"&(B" . "\$,4"M(B") | 457 ("\$,4\"L(B\$,4\"&(B" . "\$,4\"M(B") |
458 ("\$,4"L(B\$,4"'(B" . "\$,4"N(B") | 458 ("\$,4\"L(B\$,4\"'(B" . "\$,4\"N(B") |
459 ("\$,4"L(B\$,4"'(B\$,4"&(B" . "\$,4"O(B") | 459 ("\$,4\"L(B\$,4\"'(B\$,4\"&(B" . "\$,4\"O(B") |
460 )) | 460 )) |
461 (defvar dev-glyph-glyph-hash | 461 (defvar dev-glyph-glyph-hash |
462 (let* ((hash (makehash 'equal))) | 462 (let* ((hash (makehash 'equal))) |
463 (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) | 463 (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) |
464 dev-glyph-glyph) | 464 dev-glyph-glyph) |
467 (regexp-of-hashtbl-keys dev-glyph-glyph-hash)) | 467 (regexp-of-hashtbl-keys dev-glyph-glyph-hash)) |
468 | 468 |
469 | 469 |
470 ;; yet another glyph-to-glyph conversions. | 470 ;; yet another glyph-to-glyph conversions. |
471 (defvar dev-glyph-glyph-2 | 471 (defvar dev-glyph-glyph-2 |
472 '(("$,4"*(B" . "$,4".(B") | 472 '(("$,4\"*(B" . "$,4\".(B") |
473 ("$,4"+(B" . "$,4"/(B") | 473 ("$,4\"+(B" . "$,4\"/(B") |
474 ("$,4",(B" . "$,4"0(B") | 474 ("$,4\",(B" . "$,4\"0(B") |
475 ("$,4"-(B" . "$,4"1(B"))) | 475 ("$,4\"-(B" . "$,4\"1(B"))) |
476 (defvar dev-glyph-glyph-2-hash | 476 (defvar dev-glyph-glyph-2-hash |
477 (let* ((hash (makehash 'equal))) | 477 (let* ((hash (makehash 'equal))) |
478 (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) | 478 (mapc (function (lambda (x) (puthash (car x) (cdr x) hash))) |
479 dev-glyph-glyph-2) | 479 dev-glyph-glyph-2) |
480 hash)) | 480 hash)) |
585 (setq cons-num (1+ cons-num)))) | 585 (setq cons-num (1+ cons-num)))) |
586 ;; preceding-r must be attached before the anuswar if exists. | 586 ;; preceding-r must be attached before the anuswar if exists. |
587 (if preceding-r | 587 (if preceding-r |
588 (if last-modifier | 588 (if last-modifier |
589 (setq glyph-str (concat (substring glyph-str 0 -1) | 589 (setq glyph-str (concat (substring glyph-str 0 -1) |
590 "$,4"'(B" (substring glyph-str -1))) | 590 "$,4\"'(B" (substring glyph-str -1))) |
591 (setq glyph-str (concat glyph-str "$,4"'(B")))) | 591 (setq glyph-str (concat glyph-str "$,4\"'(B")))) |
592 (if last-halant (setq glyph-str (concat glyph-str "$,4""(B"))) | 592 (if last-halant (setq glyph-str (concat glyph-str "$,4\"\"(B"))) |
593 ;;; *** glyph-to-glyph conversion *** | 593 ;;; *** glyph-to-glyph conversion *** |
594 (when (string-match dev-glyph-glyph-regexp glyph-str) | 594 (when (string-match dev-glyph-glyph-regexp glyph-str) |
595 (setq glyph-str | 595 (setq glyph-str |
596 (replace-match (gethash (match-string 0 glyph-str) | 596 (replace-match (gethash (match-string 0 glyph-str) |
597 dev-glyph-glyph-hash) | 597 dev-glyph-glyph-hash) |
601 (setq glyph-str | 601 (setq glyph-str |
602 (replace-match (gethash (match-string 0 glyph-str) | 602 (replace-match (gethash (match-string 0 glyph-str) |
603 dev-glyph-glyph-2-hash) | 603 dev-glyph-glyph-2-hash) |
604 nil t glyph-str)))) | 604 nil t glyph-str)))) |
605 ;;; *** glyph reordering *** | 605 ;;; *** glyph reordering *** |
606 (while (setq split-pos (string-match "$,4""(B\\|.$" glyph-str)) | 606 (while (setq split-pos (string-match "$,4\"\"(B\\|.$" glyph-str)) |
607 (setq glyph-block (substring glyph-str 0 (1+ split-pos))) | 607 (setq glyph-block (substring glyph-str 0 (1+ split-pos))) |
608 (setq glyph-str (substring glyph-str (1+ split-pos))) | 608 (setq glyph-str (substring glyph-str (1+ split-pos))) |
609 (setq | 609 (setq |
610 glyph-block | 610 glyph-block |
611 (if (string-match dev-glyph-right-modifier-regexp glyph-block) | 611 (if (string-match dev-glyph-right-modifier-regexp glyph-block) |