comparison lisp/language/indian.el @ 17300:01d528c5dd18

Handle more Devanagari characters correctly.
author Kenichi Handa <handa@m17n.org>
date Sat, 05 Apr 1997 02:40:11 +0000
parents 70194012fb3a
children f438ebf1c679
comparison
equal deleted inserted replaced
17299:1d2c8b8a2875 17300:01d528c5dd18
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details. 19 ;; GNU General Public License for more details.
20 20
21 ;; You should have received a copy of the GNU General Public License 21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the 22 ;; along with GNU Emacs; see the file COPYING. If not, write to
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 ;; Boston, MA 02111-1307, USA.
25 24
26 ;;; Commentary: 25 ;;; Commentary:
27 26
28 ;; History: 27 ;; History:
29 ;; 1996.10.18 written by KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp> 28 ;; 1996.10.18 written by KAWABATA, Taichi <kawabata@is.s.u-tokyo.ac.jp>
266 ;; 265 ;;
267 266
268 (defvar itrans-indian-regexp 267 (defvar itrans-indian-regexp
269 (let ((vowel "[(5$(B-(52(B]") 268 (let ((vowel "[(5$(B-(52(B]")
270 (consonant "[(53(B-(5X(B]") 269 (consonant "[(53(B-(5X(B]")
271 (vowel-sign "[(5Z(B-(5g(B]") 270 (matra "[(5Z(B-(5g(B]")
272 (misc "[(5q(B-(5z(B]") 271 (misc "[(5q(B-(5z(B]")
273 (lpre "\\(") (rpre "\\)") (orre "\\|")) 272 (lpre "\\(") (rpre "\\)") (orre "\\|"))
274 nil)) ; not yet prepared. 273 (concat misc orre
275 274 lpre consonant matra "?" rpre orre
275 vowel)))
276 276
277 ;; 277 ;;
278 ;; IS13194 - ITRANS conversion table for string matching above regexp. 278 ;; IS13194 - ITRANS conversion table for string matching above regexp.
279 ;; 279 ;;
280 280
322 322
323 ;; 323 ;;
324 ;; Utility program to convert from IS 13194 to ITRANS in specified region. 324 ;; Utility program to convert from IS 13194 to ITRANS in specified region.
325 ;; 325 ;;
326 326
327 ;;;;;; not yet prepared. 327 (defun indian-encode-itrans-region (from to)
328 328 "Convert indian region to ITRANS mnemonics."
329 (interactive "r")
330 (save-restriction
331 (narrow-to-region from to)
332 (goto-char (point-min))
333 (while (re-search-forward itrans-indian-regexp nil t)
334 (let* ((indian (buffer-substring (match-beginning 0) (match-end 0)))
335 (ch (car (rassoc indian indian-itrans-alist))))
336 (if ch
337 (progn
338 (delete-region (match-beginning 0) (match-end 0))
339 (insert ch)))))
340 (goto-char (point-min))))
341
329 ;;; indian.el ends here 342 ;;; indian.el ends here