annotate lisp/international/ja-dic-cnv.el @ 94537:e158200330c2

(vc-rcs-state): Fix typos.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 02 May 2008 03:48:17 +0000
parents 1e3a407766b9
children 889bc336b89b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36681
diff changeset
1 ;;; ja-dic-cnv.el --- convert a Japanese dictionary (SKK-JISYO.L) to Emacs Lisp
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
2
74605
6ee41fdd69ff Update AIST copyright years.
Kenichi Handa <handa@m17n.org>
parents: 74544
diff changeset
3 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
79709
b6fdfff4ae81 Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78484
diff changeset
4 ;; 2005, 2006, 2007, 2008
62274
c36561fe0657 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 52401
diff changeset
5 ;; National Institute of Advanced Industrial Science and Technology (AIST)
c36561fe0657 Fix copyrights.
Kenichi Handa <handa@m17n.org>
parents: 52401
diff changeset
6 ;; Registration Number H14PRO021
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
7
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
8 ;; Keywords: mule, multilingual, Japanese
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
9
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
10 ;; This file is part of GNU Emacs.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
11
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
13 ;; it under the terms of the GNU General Public License as published by
78310
2daf9c28b3a4 Restore comma mistakenly removed in last change.
Glenn Morris <rgm@gnu.org>
parents: 78301
diff changeset
14 ;; the Free Software Foundation; either version 3, or (at your option)
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
15 ;; any later version.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
16
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
17 ;; GNU Emacs is distributed in the hope that it will be useful,
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
20 ;; GNU General Public License for more details.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
21
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64085
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62274
diff changeset
24 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18a818a2ee7c Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 62274
diff changeset
25 ;; Boston, MA 02110-1301, USA.
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
26
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
27 ;;; Commentary:
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
28
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
29 ;; SKK is a Japanese input method running on Mule created by Masahiko
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
30 ;; Sato <masahiko@sato.riec.tohoku.ac.jp>. Here we provide utilities
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
31 ;; to handle a dictionary distributed with SKK so that a different
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
32 ;; input method (e.g. quail-japanese) can utilize the dictionary.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
33
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
34 ;; The format of SKK dictionary is quite simple. Each line has the
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
35 ;; form "KANASTRING /CONV1/CONV2/.../" which means KANASTRING ($B2>L>J8(B
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
36 ;; $B;zNs(B) can be converted to one of CONVi. CONVi is a Kanji ($B4A;z(B)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
37 ;; and Kana ($B2>L>(B) mixed string.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
38 ;;
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
39 ;; KANASTRING may have a trailing ASCII letter for Okurigana ($BAw$j2>L>(B)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
40 ;; information. For instance, the trailing letter `k' means that one
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
41 ;; of the following Okurigana is allowed: $B$+$-$/$1$3(B. So, in that
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
42 ;; case, the string "KANASTRING$B$/(B" can be converted to one of "CONV1$B$/(B",
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
43 ;; CONV2$B$/(B, ...
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
44
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
45 ;;; Code:
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
46
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
47 ;; Name of a file to generate from SKK dictionary.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
48 (defvar ja-dic-filename "ja-dic.el")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
49
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
50 ;; To make a generated ja-dic.el smaller.
88406
934ee50a6eb3 (skkdic-get-kana-compact-codes): Call encode-char instead of
Kenichi Handa <handa@m17n.org>
parents: 38479
diff changeset
51 (define-coding-system 'iso-2022-7bit-short
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 "Like `iso-2022-7bit' but no ASCII designation before SPC."
88406
934ee50a6eb3 (skkdic-get-kana-compact-codes): Call encode-char instead of
Kenichi Handa <handa@m17n.org>
parents: 38479
diff changeset
53 :coding-type 'iso-2022
934ee50a6eb3 (skkdic-get-kana-compact-codes): Call encode-char instead of
Kenichi Handa <handa@m17n.org>
parents: 38479
diff changeset
54 :mnemonic ?J
934ee50a6eb3 (skkdic-get-kana-compact-codes): Call encode-char instead of
Kenichi Handa <handa@m17n.org>
parents: 38479
diff changeset
55 :charset-list 'iso-2022
934ee50a6eb3 (skkdic-get-kana-compact-codes): Call encode-char instead of
Kenichi Handa <handa@m17n.org>
parents: 38479
diff changeset
56 :designation [(ascii t) nil nil nil]
934ee50a6eb3 (skkdic-get-kana-compact-codes): Call encode-char instead of
Kenichi Handa <handa@m17n.org>
parents: 38479
diff changeset
57 :flags '(short 7-bit designation))
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 (defun skkdic-convert-okuri-ari (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
60 (message "Processing OKURI-ARI entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
61 (goto-char (point-min))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
62 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
63 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
64 (insert ";; Setting okuri-ari entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 "(skkdic-set-okuri-ari\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66 (while (not (eobp))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 (let ((from (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68 to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69 (end-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70 (setq to (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
72 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
73 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
74 (insert-buffer-substring skkbuf from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
75 (beginning-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
76 (insert "\"")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
77 (search-forward " ")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
78 (delete-char 1) ; delete the first '/'
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
79 (let ((p (point)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
80 (end-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
81 (delete-char -1) ; delete the last '/'
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
82 (subst-char-in-region p (point) ?/ ? 'noundo))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
83 (insert "\"\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
84
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
85 (forward-line 1)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
86 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
87 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
88 (insert ")\n\n")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
89
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
90 (defconst skkdic-postfix-list '(skkdic-postfix-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
91
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
92 (defconst skkdic-postfix-data
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
93 '(("$B$$$-(B" "$B9T(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
94 ("$B$,$+$j(B" "$B78(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
95 ("$B$,$/(B" "$B3X(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
96 ("$B$,$o(B" "$B@n(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
97 ("$B$7$c(B" "$B<R(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
98 ("$B$7$e$&(B" "$B=8(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
99 ("$B$7$g$&(B" "$B>^(B" "$B>k(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
100 ("$B$8$g$&(B" "$B>k(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
101 ("$B$;$s(B" "$B@~(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
102 ("$B$@$1(B" "$B3Y(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
103 ("$B$A$c$/(B" "$BCe(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
104 ("$B$F$s(B" "$BE9(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
105 ("$B$H$&$2(B" "$BF=(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
106 ("$B$I$*$j(B" "$BDL$j(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
107 ("$B$d$^(B" "$B;3(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
108 ("$B$P$7(B" "$B66(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
109 ("$B$O$D(B" "$BH/(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
110 ("$B$b$/(B" "$BL\(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
111 ("$B$f$-(B" "$B9T(B")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
112
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
113 (defun skkdic-convert-postfix (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
114 (message "Processing POSTFIX entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
115 (goto-char (point-min))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
116 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
117 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
118 (insert ";; Setting postfix entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
119 "(skkdic-set-postfix\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
120
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
121 ;; Initialize SKKDIC-POSTFIX-LIST by predefined data
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
122 ;; SKKDIC-POSTFIX-DATA.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
123 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
124 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
125 (let ((l skkdic-postfix-data)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
126 kana candidates entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
127 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
128 (setq kana (car (car l)) candidates (cdr (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
129 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
130 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
131 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
132 (setq entry (lookup-nested-alist (car candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
133 skkdic-postfix-list nil nil t))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
134 (if (consp (car entry))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
135 (setcar entry (cons kana (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
136 (set-nested-alist (car candidates) (list kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
137 skkdic-postfix-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
138 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
139 (insert "\"\n")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
140 (setq l (cdr l)))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
141
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
142 ;; Search postfix entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
143 (while (re-search-forward "^[#<>?]\\(\\(\\cH\\|$B!<(B\\)+\\) " nil t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
144 (let ((kana (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
145 str candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
146 (while (looking-at "/[#0-9 ]*\\([^/\n]*\\)/")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
147 (setq str (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
148 (if (not (member str candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
149 (setq candidates (cons str candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
150 (goto-char (match-end 1)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
151 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
152 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
153 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
154 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
155 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
156 (let ((entry (lookup-nested-alist (car candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
157 skkdic-postfix-list nil nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
158 (if (consp (car entry))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
159 (if (not (member kana (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
160 (setcar entry (cons kana (car entry))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
161 (set-nested-alist (car candidates) (list kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
162 skkdic-postfix-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
163 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
164 (insert "\"\n"))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
165 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
166 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
167 (insert ")\n\n")))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46671
diff changeset
168
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
169 (defconst skkdic-prefix-list '(skkdic-prefix-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
170
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
171 (defun skkdic-convert-prefix (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
172 (message "Processing PREFIX entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
173 (goto-char (point-min))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
174 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
175 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
176 (insert ";; Setting prefix entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
177 "(skkdic-set-prefix\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
178 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
179 (while (re-search-forward "^\\(\\(\\cH\\|$B!<(B\\)+\\)[<>?] " nil t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
180 (let ((kana (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
181 str candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
182 (while (looking-at "/\\([^/\n]+\\)/")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
183 (setq str (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
184 (if (not (member str candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
185 (setq candidates (cons str candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
186 (goto-char (match-end 1)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
187 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
188 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
189 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
190 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
191 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
192 (set-nested-alist (car candidates) kana skkdic-prefix-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
193 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
194 (insert "\"\n")))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
195 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
196 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
197 (insert ")\n\n")))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46671
diff changeset
198
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
199 ;; FROM and TO point the head and tail of "/J../J../.../".
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
200 (defun skkdic-get-candidate-list (from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
201 (let (candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
202 (goto-char from)
34626
6e98a6e86b7f (skkdic-get-candidate-list): Fix the regexp to search for candidates.
Kenichi Handa <handa@m17n.org>
parents: 34532
diff changeset
203 (while (re-search-forward "/[^/ \n]+" to t)
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
204 (setq candidates (cons (buffer-substring (1+ (match-beginning 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
205 (match-end 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
206 candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
207 candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
208
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
209 ;; Return entry for STR from nested alist ALIST.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
210 (defsubst skkdic-get-entry (str alist)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
211 (car (lookup-nested-alist str alist nil nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
212
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
213
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
214 (defconst skkdic-word-list '(skkdic-word-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
215
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
216 ;; Return t if substring of STR (between FROM and TO) can be broken up
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
217 ;; to chunks all of which can be derived from another entry in SKK
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
218 ;; dictionary. SKKBUF is the buffer where the original SKK dictionary
78484
edc666d07b2c Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents: 78310
diff changeset
219 ;; is visited, KANA is the current entry for STR. FIRST is t only if
edc666d07b2c Replace `iff' in doc-strings and comments.
Glenn Morris <rgm@gnu.org>
parents: 78310
diff changeset
220 ;; this is called at top level.
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
221
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
222 (defun skkdic-breakup-string (skkbuf kana str from to &optional first)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
223 (let ((len (- to from)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
224 (or (and (>= len 2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
225 (let ((min-idx (+ from 2))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
226 (idx (if first (1- to ) to))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
227 (found nil))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
228 (while (and (not found) (>= idx min-idx))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
229 (let ((kana2-list (skkdic-get-entry
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
230 (substring str from idx)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
231 skkdic-word-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
232 (if (or (and (consp kana2-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
233 (let ((kana-len (length kana))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
234 kana2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
235 (catch 'skkdic-tag
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
236 (while kana2-list
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
237 (setq kana2 (car kana2-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
238 (if (string-match kana2 kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
239 (throw 'skkdic-tag t))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
240 (setq kana2-list (cdr kana2-list)))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
241 (or (= idx to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
242 (skkdic-breakup-string skkbuf kana str
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
243 idx to)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
244 (and (stringp kana2-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
245 (string-match kana2-list kana)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
246 (setq found t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
247 (setq idx (1- idx)))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
248 found))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
249 (and first
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
250 (> len 2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
251 (let ((kana2 (skkdic-get-entry
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
252 (substring str from (1+ from))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
253 skkdic-prefix-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
254 (and (stringp kana2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
255 (eq (string-match kana2 kana) 0)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
256 (skkdic-breakup-string skkbuf kana str (1+ from) to))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
257 (and (not first)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
258 (>= len 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
259 (let ((kana2-list (skkdic-get-entry
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
260 (substring str from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
261 skkdic-postfix-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
262 (and (consp kana2-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
263 (let (kana2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
264 (catch 'skkdic-tag
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
265 (while kana2-list
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
266 (setq kana2 (car kana2-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
267 (if (string= kana2
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
268 (substring kana (- (length kana2))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
269 (throw 'skkdic-tag t))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
270 (setq kana2-list (cdr kana2-list)))))))))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
271
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
272 ;; Return list of candidates which excludes some from CANDIDATES.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
273 ;; Excluded candidates can be derived from another entry.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
274
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
275 (defun skkdic-reduced-candidates (skkbuf kana candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
276 (let (elt l)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
277 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
278 (setq elt (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
279 (if (or (= (length elt) 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
280 (and (string-match "^\\cj" elt)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
281 (not (skkdic-breakup-string skkbuf kana elt 0 (length elt)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
282 'first))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
283 (setq l (cons elt l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
284 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
285 (nreverse l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
286
51055
b3d9bd5b31b8 (skkdic-okuri-nasi-entries, skkdic-okuri-nasi-entries-count):
John Paul Wallington <jpw@pobox.com>
parents: 49598
diff changeset
287 (defvar skkdic-okuri-nasi-entries (list nil))
b3d9bd5b31b8 (skkdic-okuri-nasi-entries, skkdic-okuri-nasi-entries-count):
John Paul Wallington <jpw@pobox.com>
parents: 49598
diff changeset
288 (defvar skkdic-okuri-nasi-entries-count 0)
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
289
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
290 (defun skkdic-collect-okuri-nasi ()
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
291 (message "Collecting OKURI-NASI entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
292 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
293 (let ((prev-ratio 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
294 ratio)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
295 (while (re-search-forward "^\\(\\(\\cH\\|$B!<(B\\)+\\) \\(/\\cj.*\\)/$"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
296 nil t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
297 (let ((kana (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
298 (candidates (skkdic-get-candidate-list (match-beginning 3)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
299 (match-end 3))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
300 (setq skkdic-okuri-nasi-entries
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
301 (cons (cons kana candidates) skkdic-okuri-nasi-entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
302 skkdic-okuri-nasi-entries-count
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
303 (1+ skkdic-okuri-nasi-entries-count))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
304 (setq ratio (floor (/ (* (point) 100.0) (point-max))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
305 (if (/= ratio prev-ratio)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
306 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
307 (message "collected %2d%% %s ..." ratio kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
308 (setq prev-ratio ratio)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
309 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
310 (let ((entry (lookup-nested-alist (car candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
311 skkdic-word-list nil nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
312 (if (consp (car entry))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
313 (setcar entry (cons kana (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
314 (set-nested-alist (car candidates) (list kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
315 skkdic-word-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
316 (setq candidates (cdr candidates))))))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
317
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
318 (defun skkdic-convert-okuri-nasi (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
319 (message "Processing OKURI-NASI entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
320 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
321 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
322 (insert ";; Setting okuri-nasi entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
323 "(skkdic-set-okuri-nasi\n")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
324 (let ((l (nreverse skkdic-okuri-nasi-entries))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
325 (count 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
326 (prev-ratio 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
327 ratio)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
328 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
329 (let ((kana (car (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
330 (candidates (cdr (car l))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
331 (setq ratio (/ (* count 1000) skkdic-okuri-nasi-entries-count)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
332 count (1+ count))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
333 (if (/= prev-ratio (/ ratio 10))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
334 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
335 (message "processed %2d%% %s ..." (/ ratio 10) kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
336 (setq prev-ratio (/ ratio 10))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
337 (if (setq candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
338 (skkdic-reduced-candidates skkbuf kana candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
339 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
340 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
341 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
342 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
343 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
344 (insert "\"\n"))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
345 (setq l (cdr l))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
346 (insert ")\n\n")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
347
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
348 (defun skkdic-convert (filename &optional dirname)
73796
3da9d5d6d1dc (skkdic-convert): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 64085
diff changeset
349 "Generate Emacs Lisp file form Japanese dictionary file FILENAME.
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
350 The format of the dictionary file should be the same as SKK dictionaries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
351 Optional argument DIRNAME if specified is the directory name under which
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
352 the generated Emacs Lisp is saved.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
353 The name of generated file is specified by the variable `ja-dic-filename'."
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
354 (interactive "FSKK dictionary file: ")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
355 (message "Reading file \"%s\" ..." filename)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
356 (let* ((coding-system-for-read 'euc-japan)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
357 (skkbuf(find-file-noselect (expand-file-name filename)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
358 (buf (get-buffer-create "*skkdic-work*")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
359 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
360 ;; Setup and generate the header part of working buffer.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
361 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
362 (erase-buffer)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
363 (buffer-disable-undo)
46671
1c5996975536 (skkdic-convert): Add coding cookie.
Dave Love <fx@gnu.org>
parents: 38479
diff changeset
364 (insert ";;; ja-dic.el --- dictionary for Japanese input method"
75497
a96117afa52c (skkdic-convert): Add
Kenichi Handa <handa@m17n.org>
parents: 75395
diff changeset
365 " -*-coding: iso-2022-jp; byte-compile-disable-print-circle:t; -*-\n"
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
366 ";;\tGenerated by the command `skkdic-convert'\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
367 ";;\tDate: " (current-time-string) "\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
368 ";;\tOriginal SKK dictionary file: "
75395
05d001ce4826 (skkdic-convert): Insert a relative
Kenichi Handa <handa@m17n.org>
parents: 75364
diff changeset
369 (file-relative-name (expand-file-name filename) dirname)
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
370 "\n\n"
38479
758a6e658e72 Doc and coding conventions fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 38414
diff changeset
371 ";; This file is part of GNU Emacs.\n\n"
758a6e658e72 Doc and coding conventions fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 38414
diff changeset
372 ";;; Commentary:\n\n"
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
373 ";; Do byte-compile this file again after any modification.\n\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
374 ";;; Start of the header of the original SKK dictionary.\n\n")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
375 (set-buffer skkbuf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
376 (widen)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
377 (goto-char 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
378 (let (pos)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
379 (search-forward ";; okuri-ari")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
380 (forward-line 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
381 (setq pos (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
382 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
383 (insert-buffer-substring skkbuf 1 pos))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
384 (insert "\n"
31196
28b5eff78c33 (skkdic-convert): Insert (require 'ja-dic-cnv), not (require
Kenichi Handa <handa@m17n.org>
parents: 31164
diff changeset
385 ";;; Code:\n\n(eval-when-compile (require 'ja-dic-cnv))\n\n")
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
386
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
387 ;; Generate the body part of working buffer.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
388 (set-buffer skkbuf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
389 (let ((from (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
390 to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
391 ;; Convert okuri-ari entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
392 (search-forward ";; okuri-nasi")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
393 (beginning-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
394 (setq to (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
395 (narrow-to-region from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
396 (skkdic-convert-okuri-ari skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
397 (widen)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
398
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
399 ;; Convert okuri-nasi postfix entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
400 (goto-char to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
401 (forward-line 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
402 (setq from (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
403 (re-search-forward "^\\cH")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
404 (setq to (match-beginning 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
405 (narrow-to-region from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
406 (skkdic-convert-postfix skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
407 (widen)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
408
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
409 ;; Convert okuri-nasi prefix entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
410 (goto-char to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
411 (skkdic-convert-prefix skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
412
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46671
diff changeset
413 ;;
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
414 (skkdic-collect-okuri-nasi)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
415
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
416 ;; Convert okuri-nasi general entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
417 (skkdic-convert-okuri-nasi skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
418
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
419 ;; Postfix
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
420 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
421 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
422 (goto-char (point-max))
38479
758a6e658e72 Doc and coding conventions fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 38414
diff changeset
423 (insert ";;\n(provide 'ja-dic)\n\n;;; ja-dic.el ends here\n")))
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
424
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
425 ;; Save the working buffer.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
426 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
427 (set-visited-file-name (expand-file-name ja-dic-filename dirname) t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
428 (set-buffer-file-coding-system 'iso-2022-7bit-short)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
429 (save-buffer 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
430 (kill-buffer skkbuf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
431 (switch-to-buffer buf)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
432
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
433 (defun batch-skkdic-convert ()
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
434 "Run `skkdic-convert' on the files remaining on the command line.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
435 Use this from the command line, with `-batch';
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
436 it won't work in an interactive Emacs.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
437 For example, invoke:
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
438 % emacs -batch -l ja-dic-cnv -f batch-skkdic-convert SKK-JISYO.L
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
439 to generate \"ja-dic.el\" from SKK dictionary file \"SKK-JISYO.L\".
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
440 To get complete usage, invoke:
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
441 % emacs -batch -l ja-dic-cnv -f batch-skkdic-convert -h"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
442 (defvar command-line-args-left) ; Avoid compiler warning.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
443 (if (not noninteractive)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
444 (error "`batch-skkdic-convert' should be used only with -batch"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
445 (if (string= (car command-line-args-left) "-h")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
446 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
447 (message "To convert SKK-JISYO.L into skkdic.el:")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
448 (message " %% emacs -batch -l ja-dic-cnv -f batch-skkdic-convert SKK-JISYO.L")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
449 (message "To convert SKK-JISYO.L into DIR/ja-dic.el:")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
450 (message " %% emacs -batch -l ja-dic-cnv -f batch-skkdic-convert -dir DIR SKK-JISYO.L"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
451 (let (targetdir filename)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
452 (if (string= (car command-line-args-left) "-dir")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
453 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
454 (setq command-line-args-left (cdr command-line-args-left))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
455 (setq targetdir (expand-file-name (car command-line-args-left)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
456 (setq command-line-args-left (cdr command-line-args-left))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
457 (setq filename (expand-file-name (car command-line-args-left)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
458 (message "Converting %s to %s ..." filename ja-dic-filename)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
459 (message "It takes around 10 minutes even on Sun SS20.")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
460 (skkdic-convert filename targetdir)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
461 (message "Do byte-compile the created file by:")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
462 (message " %% emacs -batch -f batch-byte-compile %s" ja-dic-filename)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
463 ))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
464 (kill-emacs 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
465
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
466
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
467 ;; The following macros are expanded at byte-compiling time so that
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
468 ;; compiled code can be loaded quickly.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
469
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
470 (defun skkdic-get-kana-compact-codes (kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
471 (let* ((len (length kana))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
472 (vec (make-vector len 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
473 (i 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
474 ch)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
475 (while (< i len)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
476 (setq ch (aref kana i))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
477 (aset vec i
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
478 (if (< ch 128) ; CH is an ASCII letter for OKURIGANA,
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
479 (- ch) ; represented by a negative code.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
480 (if (= ch ?$B!<(B) ; `$B!<(B' is represented by 0.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
481 0
88406
934ee50a6eb3 (skkdic-get-kana-compact-codes): Call encode-char instead of
Kenichi Handa <handa@m17n.org>
parents: 38479
diff changeset
482 (- (logand (encode-char ch 'japanese-jisx0208) #xFF) 32))))
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
483 (setq i (1+ i)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
484 vec))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
485
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
486 (defun skkdic-extract-conversion-data (entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
487 (string-match "^\\cj+[a-z]* " entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
488 (let ((kana (substring entry (match-beginning 0) (1- (match-end 0))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
489 (i (match-end 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
490 candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
491 (while (string-match "[^ ]+" entry i)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
492 (setq candidates (cons (match-string 0 entry) candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
493 (setq i (match-end 0)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
494 (cons (skkdic-get-kana-compact-codes kana) candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
495
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
496 (defmacro skkdic-set-okuri-ari (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
497 `(defconst skkdic-okuri-ari
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
498 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
499 (map '(skkdic-okuri-ari))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
500 entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
501 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
502 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
503 (set-nested-alist (car entry) (cdr entry) map)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
504 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
505 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
506
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
507 (defmacro skkdic-set-postfix (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
508 `(defconst skkdic-postfix
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
509 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
510 (map '(nil))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
511 (longest 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
512 len entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
513 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
514 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
515 (setq len (length (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
516 (if (> len longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
517 (setq longest len))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
518 (let ((entry2 (lookup-nested-alist (car entry) map nil nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
519 (if (consp (car entry2))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
520 (let ((conversions (cdr entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
521 (while conversions
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
522 (if (not (member (car conversions) (car entry2)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
523 (setcar entry2 (cons (car conversions) (car entry2))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
524 (setq conversions (cdr conversions))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
525 (set-nested-alist (car entry) (cdr entry) map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
526 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
527 (setcar map longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
528 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
529
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
530 (defmacro skkdic-set-prefix (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
531 `(defconst skkdic-prefix
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
532 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
533 (map '(nil))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
534 (longest 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
535 len entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
536 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
537 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
538 (setq len (length (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
539 (if (> len longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
540 (setq longest len))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
541 (let ((entry2 (lookup-nested-alist (car entry) map len nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
542 (if (consp (car entry2))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
543 (let ((conversions (cdr entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
544 (while conversions
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
545 (if (not (member (car conversions) (car entry2)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
546 (setcar entry2 (cons (car conversions) (car entry2))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
547 (setq conversions (cdr conversions))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
548 (set-nested-alist (car entry) (cdr entry) map len)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
549 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
550 (setcar map longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
551 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
552
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
553 (defmacro skkdic-set-okuri-nasi (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
554 `(defconst skkdic-okuri-nasi
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
555 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
556 (map '(skdic-okuri-nasi))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
557 (count 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
558 entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
559 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
560 (setq count (1+ count))
34532
dad96251e889 (skkdic-set-okuri-nasi): Show
Kenichi Handa <handa@m17n.org>
parents: 31196
diff changeset
561 (if (= (% count 10000) 0)
87170
e50a2e215441 * erc-stamp.el (erc-echo-timestamp):
David Kastrup <dak@gnu.org>
parents: 78484
diff changeset
562 (message "%d entries" count))
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
563 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
564 (set-nested-alist (car entry) (cdr entry) map)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
565 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
566 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
567
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
568 (provide 'ja-dic-cnv)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
569
36681
8f93fc285ff3 Add coding: tag in Loval Vairables: section.
Kenichi Handa <handa@m17n.org>
parents: 34626
diff changeset
570 ;; Local Variables:
8f93fc285ff3 Add coding: tag in Loval Vairables: section.
Kenichi Handa <handa@m17n.org>
parents: 34626
diff changeset
571 ;; coding: iso-2022-7bit
8f93fc285ff3 Add coding: tag in Loval Vairables: section.
Kenichi Handa <handa@m17n.org>
parents: 34626
diff changeset
572 ;; End:
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36681
diff changeset
573
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91327
diff changeset
574 ;; arch-tag: dec06fb0-8118-45b1-80d7-dc360b6fd3b2
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36681
diff changeset
575 ;;; ja-dic-cnv.el ends here