emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/language/ind-util.el


From: Juanma Barranquero
Subject: [Emacs-diffs] Changes to emacs/lisp/language/ind-util.el
Date: Tue, 04 Feb 2003 08:11:51 -0500

Index: emacs/lisp/language/ind-util.el
diff -c emacs/lisp/language/ind-util.el:1.6 emacs/lisp/language/ind-util.el:1.7
*** emacs/lisp/language/ind-util.el:1.6 Sun Jul  7 17:00:54 2002
--- emacs/lisp/language/ind-util.el     Tue Feb  4 08:11:50 2003
***************
*** 44,50 ****
    "Returns the regular expression of hashtable keys."
    (let ((max-specpdl-size 1000))
      (regexp-opt
!      (sort 
        (let (dummy)
        (maphash (function (lambda (key val) (setq dummy (cons key dummy))))
                 hashtbl)
--- 44,50 ----
    "Returns the regular expression of hashtable keys."
    (let ((max-specpdl-size 1000))
      (regexp-opt
!      (sort
        (let (dummy)
        (maphash (function (lambda (key val) (setq dummy (cons key dummy))))
                 hashtbl)
***************
*** 59,73 ****
       (?$,15Q(B ?$,16)(B) (?$,15R(B ?$,16*(B) (?$,15S(B ?$,16+(B) 
(?$,15T(B ?$,16,(B) (?$,address@hidden(B ?$,16B(B) (?$,16A(B 
?$,16C(B))
      (;; CONSONANTS (currently 42, including special cases)
       ?$,15U(B ?$,15V(B ?$,15W(B ?$,15X(B ?$,15Y(B                  
;; GUTTRULS
!      ?$,15Z(B ?$,15[(B ?$,15\(B ?$,15](B ?$,15^(B                  
;; PALATALS  
!      ?$,15_(B ?$,15`(B ?$,15a(B ?$,15b(B ?$,15c(B                  
;; CEREBRALS 
!      ?$,15d(B ?$,15e(B ?$,15f(B ?$,15g(B ?$,15h(B ?$,15i(B        
      ;; DENTALS   
!      ?$,15j(B ?$,15k(B ?$,15l(B ?$,15m(B ?$,15n(B                  
;; LABIALS   
       ?$,15o(B ?$,15p(B ?$,15q(B ?$,15r(B ?$,15s(B ?$,15t(B 
?$,15u(B          ;; SEMIVOWELS
!      ?$,15v(B ?$,15w(B ?$,15x(B ?$,15y(B                    ;; 
SIBILANTS 
!      ?$,168(B ?$,169(B ?$,16:(B ?$,16;(B ?$,16<(B ?$,16=(B 
?$,16>(B ?$,16?(B      ;; NUKTAS    
       "$,15\6-5^(B" "$,15U6-5w(B")
!     (;; Misc Symbols (7)  
       ?$,15A(B ?$,15B(B ?$,15C(B ?$,15}(B ?$,16-(B ?$,160(B 
?$,16D(B)
      (;; Digits (10)
       ?$,16F(B ?$,16G(B ?$,16H(B ?$,16I(B ?$,16J(B ?$,16K(B 
?$,16L(B ?$,16M(B ?$,16N(B ?$,16O(B)
--- 59,73 ----
       (?$,15Q(B ?$,16)(B) (?$,15R(B ?$,16*(B) (?$,15S(B ?$,16+(B) 
(?$,15T(B ?$,16,(B) (?$,address@hidden(B ?$,16B(B) (?$,16A(B 
?$,16C(B))
      (;; CONSONANTS (currently 42, including special cases)
       ?$,15U(B ?$,15V(B ?$,15W(B ?$,15X(B ?$,15Y(B                  
;; GUTTRULS
!      ?$,15Z(B ?$,15[(B ?$,15\(B ?$,15](B ?$,15^(B                  
;; PALATALS
!      ?$,15_(B ?$,15`(B ?$,15a(B ?$,15b(B ?$,15c(B                  
;; CEREBRALS
!      ?$,15d(B ?$,15e(B ?$,15f(B ?$,15g(B ?$,15h(B ?$,15i(B        
      ;; DENTALS
!      ?$,15j(B ?$,15k(B ?$,15l(B ?$,15m(B ?$,15n(B                  
;; LABIALS
       ?$,15o(B ?$,15p(B ?$,15q(B ?$,15r(B ?$,15s(B ?$,15t(B 
?$,15u(B          ;; SEMIVOWELS
!      ?$,15v(B ?$,15w(B ?$,15x(B ?$,15y(B                    ;; 
SIBILANTS
!      ?$,168(B ?$,169(B ?$,16:(B ?$,16;(B ?$,16<(B ?$,16=(B 
?$,16>(B ?$,16?(B      ;; NUKTAS
       "$,15\6-5^(B" "$,15U6-5w(B")
!     (;; Misc Symbols (7)
       ?$,15A(B ?$,15B(B ?$,15C(B ?$,15}(B ?$,16-(B ?$,160(B 
?$,16D(B)
      (;; Digits (10)
       ?$,16F(B ?$,16G(B ?$,16H(B ?$,16I(B ?$,16J(B ?$,16K(B 
?$,16L(B ?$,16M(B ?$,16N(B ?$,16O(B)
***************
*** 85,91 ****
  
  (defvar indian-base-table-to-language-alist
    '((indian-dev-base-table . "Devanagari")
!     (indian-pnj-base-table . "Punjabi")    
      (indian-ori-base-table . "Oriya")
      (indian-bng-base-table . "Bengali")
      (indian-asm-base-table . "Assamese")
--- 85,91 ----
  
  (defvar indian-base-table-to-language-alist
    '((indian-dev-base-table . "Devanagari")
!     (indian-pnj-base-table . "Punjabi")
      (indian-ori-base-table . "Oriya")
      (indian-bng-base-table . "Bengali")
      (indian-asm-base-table . "Assamese")
***************
*** 100,110 ****
       "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U")
       ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") nil "e" "ai"
       "o.c"  nil   "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") nil  ("v" "w")
       "sh" ("Sh" "shh") "s" "h"
--- 100,110 ----
       "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U")
       ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") nil "e" "ai"
       "o.c"  nil   "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") nil  ("v" "w")
       "sh" ("Sh" "shh") "s" "h"
***************
*** 196,205 ****
  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)
--- 196,205 ----
  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)
***************
*** 225,231 ****
      (funcall f (pop l1) (pop l2))))
  
  (defun indian--puthash-v (v trans-v hashtbls)
!   (indian--map 
     (lambda (v trans-v)
       (indian--puthash-char (car v) trans-v hashtbls))
     v trans-v))
--- 225,231 ----
      (funcall f (pop l1) (pop l2))))
  
  (defun indian--puthash-v (v trans-v hashtbls)
!   (indian--map
     (lambda (v trans-v)
       (indian--puthash-char (car v) trans-v hashtbls))
     v trans-v))
***************
*** 253,259 ****
          (setq v (if (char-valid-p (cadr v)) (char-to-string (cadr v)) ""))
          (if (stringp trans-c) (setq trans-c (list trans-c)))
          (if (stringp trans-v) (setq trans-v (list trans-v)))
!         (indian--puthash-char 
           (concat c v)
           (apply 'append
                  (mapthread 'concat trans-c trans-v))
--- 253,259 ----
          (setq v (if (char-valid-p (cadr v)) (char-to-string (cadr v)) ""))
          (if (stringp trans-c) (setq trans-c (list trans-c)))
          (if (stringp trans-v) (setq trans-v (list trans-v)))
!         (indian--puthash-char
           (concat c v)
           (apply 'append
                  (mapthread 'concat trans-c trans-v))
***************
*** 277,283 ****
         (trans-digits  '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")))
      (indian--puthash-v vowels trans-vowels hashtbls)
      (indian--puthash-c consonants trans-consonants halant hashtbls)
!     (indian--puthash-cv consonants trans-consonants 
                              vowels trans-vowels hashtbls)
      (indian--puthash-m misc trans-misc hashtbls)
      (indian--puthash-m digits trans-digits hashtbls)
--- 277,283 ----
         (trans-digits  '("0" "1" "2" "3" "4" "5" "6" "7" "8" "9")))
      (indian--puthash-v vowels trans-vowels hashtbls)
      (indian--puthash-c consonants trans-consonants halant hashtbls)
!     (indian--puthash-cv consonants trans-consonants
                              vowels trans-vowels hashtbls)
      (indian--puthash-m misc trans-misc hashtbls)
      (indian--puthash-m digits trans-digits hashtbls)
***************
*** 298,310 ****
  (defmacro indian-translate-region (from to hashtable encode-p)
    `(save-excursion
       (save-restriction
!        (let ((regexp ,(indian-regexp-of-hashtbl-keys 
!                      (if encode-p (car (eval hashtable)) 
                         (cdr (eval hashtable))))))
         (narrow-to-region from to)
         (goto-char (point-min))
         (while (re-search-forward regexp nil t)
!          (let ((matchstr (gethash (match-string 0) 
                                    (if ,encode-p
                                        (car ,hashtable)
                                      (cdr ,hashtable)))))
--- 298,310 ----
  (defmacro indian-translate-region (from to hashtable encode-p)
    `(save-excursion
       (save-restriction
!        (let ((regexp ,(indian-regexp-of-hashtbl-keys
!                      (if encode-p (car (eval hashtable))
                         (cdr (eval hashtable))))))
         (narrow-to-region from to)
         (goto-char (point-min))
         (while (re-search-forward regexp nil t)
!          (let ((matchstr (gethash (match-string 0)
                                    (if ,encode-p
                                        (car ,hashtable)
                                      (cdr ,hashtable)))))
***************
*** 314,320 ****
  
  (defun indian-dev-itrans-v5-encode-region (from to)
    (interactive "r")
!   (indian-translate-region 
     from to indian-dev-itrans-v5-hash t))
  
  (defun indian-dev-itrans-v5-decode-region (from to)
--- 314,320 ----
  
  (defun indian-dev-itrans-v5-encode-region (from to)
    (interactive "r")
!   (indian-translate-region
     from to indian-dev-itrans-v5-hash t))
  
  (defun indian-dev-itrans-v5-decode-region (from to)
***************
*** 324,330 ****
  
  (defun indian-dev-kyoto-harvard-encode-region (from to)
    (interactive "r")
!   (indian-translate-region 
     from to indian-dev-kyoto-harvard-hash t))
  
  (defun indian-dev-kyoto-harvard-decode-region (from to)
--- 324,330 ----
  
  (defun indian-dev-kyoto-harvard-encode-region (from to)
    (interactive "r")
!   (indian-translate-region
     from to indian-dev-kyoto-harvard-hash t))
  
  (defun indian-dev-kyoto-harvard-decode-region (from to)
***************
*** 334,340 ****
  
  (defun indian-dev-aiba-encode-region (from to)
    (interactive "r")
!   (indian-translate-region 
     from to indian-dev-aiba-hash t))
  
  (defun indian-dev-aiba-decode-region (from to)
--- 334,340 ----
  
  (defun indian-dev-aiba-encode-region (from to)
    (interactive "r")
!   (indian-translate-region
     from to indian-dev-aiba-hash t))
  
  (defun indian-dev-aiba-decode-region (from to)
***************
*** 525,542 ****
  (defvar is13194-to-ucs-malayalam-hashtbl nil)
  (defvar is13194-to-ucs-malayalam-regexp nil)
  
! (mapc 
!  (function (lambda (script) 
!    (let ((hashtable (intern (concat "is13194-to-ucs-" 
                                      (symbol-name script) "-hashtbl" )))
           (regexp    (intern (concat "is13194-to-ucs-"
                                      (symbol-name script) "-regexp"))))
       (set hashtable (make-hash-table :test 'equal :size 128))
       (mapc
        (function (lambda (x)
!         (put-char-code-property (decode-char 'ucs (car x)) 
                                  'script script)
!         (put-char-code-property (decode-char 'ucs (car x)) 
                                  'iscii (cdr x))
          (puthash (cdr x) (char-to-string (decode-char 'ucs (car x)))
                   (eval hashtable))))
--- 525,542 ----
  (defvar is13194-to-ucs-malayalam-hashtbl nil)
  (defvar is13194-to-ucs-malayalam-regexp nil)
  
! (mapc
!  (function (lambda (script)
!    (let ((hashtable (intern (concat "is13194-to-ucs-"
                                      (symbol-name script) "-hashtbl" )))
           (regexp    (intern (concat "is13194-to-ucs-"
                                      (symbol-name script) "-regexp"))))
       (set hashtable (make-hash-table :test 'equal :size 128))
       (mapc
        (function (lambda (x)
!         (put-char-code-property (decode-char 'ucs (car x))
                                  'script script)
!         (put-char-code-property (decode-char 'ucs (car x))
                                  'iscii (cdr x))
          (puthash (cdr x) (char-to-string (decode-char 'ucs (car x)))
                   (eval hashtable))))
***************
*** 553,559 ****
    "Regexp that matches to conversion")
  
  (defun ucs-to-iscii-region (from to)
!   "Converts the indian UCS characters in the region to ISCII.  
  Returns new end position."
    (interactive "r")
    ;; only Devanagari is supported now.
--- 553,559 ----
    "Regexp that matches to conversion")
  
  (defun ucs-to-iscii-region (from to)
!   "Converts the indian UCS characters in the region to ISCII.
  Returns new end position."
    (interactive "r")
    ;; only Devanagari is supported now.
***************
*** 563,575 ****
        (goto-char (point-min))
        (let* ((current-repertory is13194-default-repartory))
          (while (re-search-forward ucs-to-is13194-regexp nil t)
!           (replace-match 
             (get-char-code-property (string-to-char (match-string 0))
                                     'iscii))))
        (point-max))))
  
  (defun iscii-to-ucs-region (from to)
!   "Converts the ISCII characters in the region to UCS.  
  Returns new end position."
    (interactive "r")
    ;; only Devanagari is supported now.
--- 563,575 ----
        (goto-char (point-min))
        (let* ((current-repertory is13194-default-repartory))
          (while (re-search-forward ucs-to-is13194-regexp nil t)
!           (replace-match
             (get-char-code-property (string-to-char (match-string 0))
                                     'iscii))))
        (point-max))))
  
  (defun iscii-to-ucs-region (from to)
!   "Converts the ISCII characters in the region to UCS.
  Returns new end position."
    (interactive "r")
    ;; only Devanagari is supported now.
***************
*** 579,591 ****
        (goto-char (point-min))
        (let* ((current-repertory is13194-default-repartory)
               (current-hashtable
!               (intern (concat "is13194-to-ucs-" 
                                (symbol-name current-repertory) "-hashtbl")))
               (current-regexp
!               (intern (concat "is13194-to-ucs-" 
                                (symbol-name current-repertory) "-regexp"))))
          (while (re-search-forward (eval current-regexp) nil t)
!           (replace-match 
             (gethash (match-string 0) (eval current-hashtable) ""))))
        (point-max))))
  
--- 579,591 ----
        (goto-char (point-min))
        (let* ((current-repertory is13194-default-repartory)
               (current-hashtable
!               (intern (concat "is13194-to-ucs-"
                                (symbol-name current-repertory) "-hashtbl")))
               (current-regexp
!               (intern (concat "is13194-to-ucs-"
                                (symbol-name current-repertory) "-regexp"))))
          (while (re-search-forward (eval current-regexp) nil t)
!           (replace-match
             (gethash (match-string 0) (eval current-hashtable) ""))))
        (point-max))))
  
***************
*** 603,609 ****
  
  ;;;###autoload
  (defun indian-compose-string (string)
!   (with-temp-buffer 
      (insert string)
      (indian-compose-region (point-min) (point-max))
      (buffer-string)))
--- 603,609 ----
  
  ;;;###autoload
  (defun indian-compose-string (string)
!   (with-temp-buffer
      (insert string)
      (indian-compose-region (point-min) (point-max))
      (buffer-string)))
***************
*** 1029,1035 ****
        (error "Invalid indian-glyph char: %d" char))
      (setq code (+ (* (- (nth 1 split) 32) 96) (nth 2 split) -32))
      (cons (% code 256) (aref indian-script-table (/ code 256)))))
!     
  (provide 'ind-util)
!  
  ;;; ind-util.el ends here
--- 1029,1035 ----
        (error "Invalid indian-glyph char: %d" char))
      (setq code (+ (* (- (nth 1 split) 32) 96) (nth 2 split) -32))
      (cons (% code 256) (aref indian-script-table (/ code 256)))))
! 
  (provide 'ind-util)
! 
  ;;; ind-util.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]