annotate lisp/international/ja-dic-cnv.el @ 87264:864814308855

*** empty log message ***
author Glenn Morris <rgm@gnu.org>
date Tue, 11 Dec 2007 08:28:49 +0000
parents e50a2e215441
children 107ccd98fa12 2fcaae6177a5
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,
75364
a0b90c38e931 Add 2007 to copyright.
Glenn Morris <rgm@gnu.org>
parents: 74605
diff changeset
4 ;; 2005, 2006, 2007
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.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
51 (make-coding-system
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
52 'iso-2022-7bit-short
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
53 2 ?J
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
54 "Like `iso-2022-7bit' but no ASCII designation before SPC."
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
55 '(ascii nil nil nil t t nil t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
56 '((safe-charsets . t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
57
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
58 (defun skkdic-convert-okuri-ari (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
59 (message "Processing OKURI-ARI entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
60 (goto-char (point-min))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
61 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
62 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
63 (insert ";; Setting okuri-ari entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
64 "(skkdic-set-okuri-ari\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
65 (while (not (eobp))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
66 (let ((from (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
67 to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
68 (end-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
69 (setq to (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
70
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
71 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
72 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
73 (insert-buffer-substring skkbuf from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
74 (beginning-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
75 (insert "\"")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
76 (search-forward " ")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
77 (delete-char 1) ; delete the first '/'
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
78 (let ((p (point)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
79 (end-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
80 (delete-char -1) ; delete the last '/'
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
81 (subst-char-in-region p (point) ?/ ? 'noundo))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
82 (insert "\"\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
83
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
84 (forward-line 1)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
85 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
86 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
87 (insert ")\n\n")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
88
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
89 (defconst skkdic-postfix-list '(skkdic-postfix-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
90
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
91 (defconst skkdic-postfix-data
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
92 '(("$B$$$-(B" "$B9T(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
93 ("$B$,$+$j(B" "$B78(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
94 ("$B$,$/(B" "$B3X(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
95 ("$B$,$o(B" "$B@n(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
96 ("$B$7$c(B" "$B<R(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
97 ("$B$7$e$&(B" "$B=8(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
98 ("$B$7$g$&(B" "$B>^(B" "$B>k(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
99 ("$B$8$g$&(B" "$B>k(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
100 ("$B$;$s(B" "$B@~(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
101 ("$B$@$1(B" "$B3Y(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
102 ("$B$A$c$/(B" "$BCe(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
103 ("$B$F$s(B" "$BE9(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
104 ("$B$H$&$2(B" "$BF=(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
105 ("$B$I$*$j(B" "$BDL$j(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
106 ("$B$d$^(B" "$B;3(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
107 ("$B$P$7(B" "$B66(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
108 ("$B$O$D(B" "$BH/(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
109 ("$B$b$/(B" "$BL\(B")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
110 ("$B$f$-(B" "$B9T(B")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
111
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
112 (defun skkdic-convert-postfix (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
113 (message "Processing POSTFIX entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
114 (goto-char (point-min))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
115 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
116 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
117 (insert ";; Setting postfix entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
118 "(skkdic-set-postfix\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
119
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
120 ;; Initialize SKKDIC-POSTFIX-LIST by predefined data
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
121 ;; SKKDIC-POSTFIX-DATA.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
122 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
123 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
124 (let ((l skkdic-postfix-data)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
125 kana candidates entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
126 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
127 (setq kana (car (car l)) candidates (cdr (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
128 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
129 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
130 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
131 (setq entry (lookup-nested-alist (car candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
132 skkdic-postfix-list nil nil t))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
133 (if (consp (car entry))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
134 (setcar entry (cons kana (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
135 (set-nested-alist (car candidates) (list kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
136 skkdic-postfix-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
137 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
138 (insert "\"\n")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
139 (setq l (cdr l)))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
140
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
141 ;; Search postfix entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
142 (while (re-search-forward "^[#<>?]\\(\\(\\cH\\|$B!<(B\\)+\\) " nil t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
143 (let ((kana (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
144 str candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
145 (while (looking-at "/[#0-9 ]*\\([^/\n]*\\)/")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
146 (setq str (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
147 (if (not (member str candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
148 (setq candidates (cons str candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
149 (goto-char (match-end 1)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
150 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
151 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
152 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
153 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
154 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
155 (let ((entry (lookup-nested-alist (car candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
156 skkdic-postfix-list nil nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
157 (if (consp (car entry))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
158 (if (not (member kana (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
159 (setcar entry (cons kana (car entry))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
160 (set-nested-alist (car candidates) (list kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
161 skkdic-postfix-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
162 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
163 (insert "\"\n"))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
164 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
165 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
166 (insert ")\n\n")))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46671
diff changeset
167
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
168 (defconst skkdic-prefix-list '(skkdic-prefix-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
169
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
170 (defun skkdic-convert-prefix (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
171 (message "Processing PREFIX entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
172 (goto-char (point-min))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
173 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
174 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
175 (insert ";; Setting prefix entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
176 "(skkdic-set-prefix\n"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
177 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
178 (while (re-search-forward "^\\(\\(\\cH\\|$B!<(B\\)+\\)[<>?] " nil t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
179 (let ((kana (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
180 str candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
181 (while (looking-at "/\\([^/\n]+\\)/")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
182 (setq str (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
183 (if (not (member str candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
184 (setq candidates (cons str candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
185 (goto-char (match-end 1)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
186 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
187 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
188 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
189 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
190 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
191 (set-nested-alist (car candidates) kana skkdic-prefix-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
192 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
193 (insert "\"\n")))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
194 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
195 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
196 (insert ")\n\n")))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46671
diff changeset
197
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
198 ;; 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
199 (defun skkdic-get-candidate-list (from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
200 (let (candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
201 (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
202 (while (re-search-forward "/[^/ \n]+" to t)
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
203 (setq candidates (cons (buffer-substring (1+ (match-beginning 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
204 (match-end 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
205 candidates)))
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
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
208 ;; Return entry for STR from nested alist ALIST.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
209 (defsubst skkdic-get-entry (str alist)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
210 (car (lookup-nested-alist str alist nil nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
211
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 (defconst skkdic-word-list '(skkdic-word-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
214
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
215 ;; 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
216 ;; 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
217 ;; 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
218 ;; 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
219 ;; this is called at top level.
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
220
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
221 (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
222 (let ((len (- to from)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
223 (or (and (>= len 2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
224 (let ((min-idx (+ from 2))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
225 (idx (if first (1- to ) to))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
226 (found nil))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
227 (while (and (not found) (>= idx min-idx))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
228 (let ((kana2-list (skkdic-get-entry
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
229 (substring str from idx)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
230 skkdic-word-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
231 (if (or (and (consp kana2-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
232 (let ((kana-len (length kana))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
233 kana2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
234 (catch 'skkdic-tag
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
235 (while kana2-list
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
236 (setq kana2 (car kana2-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
237 (if (string-match kana2 kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
238 (throw 'skkdic-tag t))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
239 (setq kana2-list (cdr kana2-list)))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
240 (or (= idx to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
241 (skkdic-breakup-string skkbuf kana str
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
242 idx to)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
243 (and (stringp kana2-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
244 (string-match kana2-list kana)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
245 (setq found t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
246 (setq idx (1- idx)))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
247 found))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
248 (and first
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
249 (> len 2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
250 (let ((kana2 (skkdic-get-entry
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
251 (substring str from (1+ from))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
252 skkdic-prefix-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
253 (and (stringp kana2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
254 (eq (string-match kana2 kana) 0)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
255 (skkdic-breakup-string skkbuf kana str (1+ from) to))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
256 (and (not first)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
257 (>= len 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
258 (let ((kana2-list (skkdic-get-entry
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
259 (substring str from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
260 skkdic-postfix-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
261 (and (consp kana2-list)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
262 (let (kana2)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
263 (catch 'skkdic-tag
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
264 (while kana2-list
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
265 (setq kana2 (car kana2-list))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
266 (if (string= kana2
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
267 (substring kana (- (length kana2))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
268 (throw 'skkdic-tag t))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
269 (setq kana2-list (cdr kana2-list)))))))))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
270
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
271 ;; Return list of candidates which excludes some from CANDIDATES.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
272 ;; Excluded candidates can be derived from another entry.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
273
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
274 (defun skkdic-reduced-candidates (skkbuf kana candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
275 (let (elt l)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
276 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
277 (setq elt (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
278 (if (or (= (length elt) 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
279 (and (string-match "^\\cj" elt)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
280 (not (skkdic-breakup-string skkbuf kana elt 0 (length elt)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
281 'first))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
282 (setq l (cons elt l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
283 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
284 (nreverse l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
285
51055
b3d9bd5b31b8 (skkdic-okuri-nasi-entries, skkdic-okuri-nasi-entries-count):
John Paul Wallington <jpw@pobox.com>
parents: 49598
diff changeset
286 (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
287 (defvar skkdic-okuri-nasi-entries-count 0)
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
288
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
289 (defun skkdic-collect-okuri-nasi ()
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
290 (message "Collecting OKURI-NASI entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
291 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
292 (let ((prev-ratio 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
293 ratio)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
294 (while (re-search-forward "^\\(\\(\\cH\\|$B!<(B\\)+\\) \\(/\\cj.*\\)/$"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
295 nil t)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
296 (let ((kana (match-string 1))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
297 (candidates (skkdic-get-candidate-list (match-beginning 3)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
298 (match-end 3))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
299 (setq skkdic-okuri-nasi-entries
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
300 (cons (cons kana candidates) skkdic-okuri-nasi-entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
301 skkdic-okuri-nasi-entries-count
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
302 (1+ skkdic-okuri-nasi-entries-count))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
303 (setq ratio (floor (/ (* (point) 100.0) (point-max))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
304 (if (/= ratio prev-ratio)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
305 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
306 (message "collected %2d%% %s ..." ratio kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
307 (setq prev-ratio ratio)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
308 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
309 (let ((entry (lookup-nested-alist (car candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
310 skkdic-word-list nil nil t)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
311 (if (consp (car entry))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
312 (setcar entry (cons kana (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
313 (set-nested-alist (car candidates) (list kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
314 skkdic-word-list)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
315 (setq candidates (cdr candidates))))))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
316
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
317 (defun skkdic-convert-okuri-nasi (skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
318 (message "Processing OKURI-NASI entries ...")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
319 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
320 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
321 (insert ";; Setting okuri-nasi entries.\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
322 "(skkdic-set-okuri-nasi\n")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
323 (let ((l (nreverse skkdic-okuri-nasi-entries))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
324 (count 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
325 (prev-ratio 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
326 ratio)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
327 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
328 (let ((kana (car (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
329 (candidates (cdr (car l))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
330 (setq ratio (/ (* count 1000) skkdic-okuri-nasi-entries-count)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
331 count (1+ count))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
332 (if (/= prev-ratio (/ ratio 10))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
333 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
334 (message "processed %2d%% %s ..." (/ ratio 10) kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
335 (setq prev-ratio (/ ratio 10))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
336 (if (setq candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
337 (skkdic-reduced-candidates skkbuf kana candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
338 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
339 (insert "\"" kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
340 (while candidates
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
341 (insert " " (car candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
342 (setq candidates (cdr candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
343 (insert "\"\n"))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
344 (setq l (cdr l))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
345 (insert ")\n\n")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
346
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
347 (defun skkdic-convert (filename &optional dirname)
73796
3da9d5d6d1dc (skkdic-convert): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 64085
diff changeset
348 "Generate Emacs Lisp file form Japanese dictionary file FILENAME.
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
349 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
350 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
351 the generated Emacs Lisp is saved.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
352 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
353 (interactive "FSKK dictionary file: ")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
354 (message "Reading file \"%s\" ..." filename)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
355 (let* ((coding-system-for-read 'euc-japan)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
356 (skkbuf(find-file-noselect (expand-file-name filename)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
357 (buf (get-buffer-create "*skkdic-work*")))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
358 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
359 ;; Setup and generate the header part of working buffer.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
360 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
361 (erase-buffer)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
362 (buffer-disable-undo)
46671
1c5996975536 (skkdic-convert): Add coding cookie.
Dave Love <fx@gnu.org>
parents: 38479
diff changeset
363 (insert ";;; ja-dic.el --- dictionary for Japanese input method"
75497
a96117afa52c (skkdic-convert): Add
Kenichi Handa <handa@m17n.org>
parents: 75395
diff changeset
364 " -*-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
365 ";;\tGenerated by the command `skkdic-convert'\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
366 ";;\tDate: " (current-time-string) "\n"
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
367 ";;\tOriginal SKK dictionary file: "
75395
05d001ce4826 (skkdic-convert): Insert a relative
Kenichi Handa <handa@m17n.org>
parents: 75364
diff changeset
368 (file-relative-name (expand-file-name filename) dirname)
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
369 "\n\n"
38479
758a6e658e72 Doc and coding conventions fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 38414
diff changeset
370 ";; 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
371 ";;; Commentary:\n\n"
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
372 ";; 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
373 ";;; 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
374 (set-buffer skkbuf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
375 (widen)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
376 (goto-char 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
377 (let (pos)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
378 (search-forward ";; okuri-ari")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
379 (forward-line 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
380 (setq pos (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
381 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
382 (insert-buffer-substring skkbuf 1 pos))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
383 (insert "\n"
31196
28b5eff78c33 (skkdic-convert): Insert (require 'ja-dic-cnv), not (require
Kenichi Handa <handa@m17n.org>
parents: 31164
diff changeset
384 ";;; 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
385
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
386 ;; Generate the body part of working buffer.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
387 (set-buffer skkbuf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
388 (let ((from (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
389 to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
390 ;; Convert okuri-ari entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
391 (search-forward ";; okuri-nasi")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
392 (beginning-of-line)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
393 (setq to (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
394 (narrow-to-region from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
395 (skkdic-convert-okuri-ari skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
396 (widen)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
397
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
398 ;; Convert okuri-nasi postfix entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
399 (goto-char to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
400 (forward-line 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
401 (setq from (point))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
402 (re-search-forward "^\\cH")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
403 (setq to (match-beginning 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
404 (narrow-to-region from to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
405 (skkdic-convert-postfix skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
406 (widen)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
407
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
408 ;; Convert okuri-nasi prefix entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
409 (goto-char to)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
410 (skkdic-convert-prefix skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
411
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46671
diff changeset
412 ;;
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
413 (skkdic-collect-okuri-nasi)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
414
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
415 ;; Convert okuri-nasi general entries.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
416 (skkdic-convert-okuri-nasi skkbuf buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
417
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
418 ;; Postfix
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
419 (save-excursion
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
420 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
421 (goto-char (point-max))
38479
758a6e658e72 Doc and coding conventions fixes.
Pavel Janík <Pavel@Janik.cz>
parents: 38414
diff changeset
422 (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
423
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
424 ;; Save the working buffer.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
425 (set-buffer buf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
426 (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
427 (set-buffer-file-coding-system 'iso-2022-7bit-short)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
428 (save-buffer 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
429 (kill-buffer skkbuf)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
430 (switch-to-buffer buf)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
431
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
432 (defun batch-skkdic-convert ()
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
433 "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
434 Use this from the command line, with `-batch';
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
435 it won't work in an interactive Emacs.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
436 For example, invoke:
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
437 % 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
438 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
439 To get complete usage, invoke:
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
440 % 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
441 (defvar command-line-args-left) ; Avoid compiler warning.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
442 (if (not noninteractive)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
443 (error "`batch-skkdic-convert' should be used only with -batch"))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
444 (if (string= (car command-line-args-left) "-h")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
445 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
446 (message "To convert SKK-JISYO.L into skkdic.el:")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
447 (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
448 (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
449 (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
450 (let (targetdir filename)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
451 (if (string= (car command-line-args-left) "-dir")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
452 (progn
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
453 (setq command-line-args-left (cdr command-line-args-left))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
454 (setq targetdir (expand-file-name (car command-line-args-left)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
455 (setq command-line-args-left (cdr command-line-args-left))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
456 (setq filename (expand-file-name (car command-line-args-left)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
457 (message "Converting %s to %s ..." filename ja-dic-filename)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
458 (message "It takes around 10 minutes even on Sun SS20.")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
459 (skkdic-convert filename targetdir)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
460 (message "Do byte-compile the created file by:")
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
461 (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
462 ))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
463 (kill-emacs 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
464
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 ;; 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
467 ;; compiled code can be loaded quickly.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
468
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
469 (defun skkdic-get-kana-compact-codes (kana)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
470 (let* ((len (length kana))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
471 (vec (make-vector len 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
472 (i 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
473 ch)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
474 (while (< i len)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
475 (setq ch (aref kana i))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
476 (aset vec i
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
477 (if (< ch 128) ; CH is an ASCII letter for OKURIGANA,
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
478 (- ch) ; represented by a negative code.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
479 (if (= ch ?$B!<(B) ; `$B!<(B' is represented by 0.
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
480 0
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
481 (- (nth 2 (split-char ch)) 32))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
482 (setq i (1+ i)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
483 vec))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
484
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
485 (defun skkdic-extract-conversion-data (entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
486 (string-match "^\\cj+[a-z]* " entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
487 (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
488 (i (match-end 0))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
489 candidates)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
490 (while (string-match "[^ ]+" entry i)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
491 (setq candidates (cons (match-string 0 entry) candidates))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
492 (setq i (match-end 0)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
493 (cons (skkdic-get-kana-compact-codes kana) candidates)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
494
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
495 (defmacro skkdic-set-okuri-ari (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
496 `(defconst skkdic-okuri-ari
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
497 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
498 (map '(skkdic-okuri-ari))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
499 entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
500 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
501 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
502 (set-nested-alist (car entry) (cdr entry) map)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
503 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
504 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
505
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
506 (defmacro skkdic-set-postfix (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
507 `(defconst skkdic-postfix
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
508 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
509 (map '(nil))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
510 (longest 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
511 len entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
512 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
513 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
514 (setq len (length (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
515 (if (> len longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
516 (setq longest len))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
517 (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
518 (if (consp (car entry2))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
519 (let ((conversions (cdr entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
520 (while conversions
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
521 (if (not (member (car conversions) (car entry2)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
522 (setcar entry2 (cons (car conversions) (car entry2))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
523 (setq conversions (cdr conversions))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
524 (set-nested-alist (car entry) (cdr entry) map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
525 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
526 (setcar map longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
527 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
528
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
529 (defmacro skkdic-set-prefix (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
530 `(defconst skkdic-prefix
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
531 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
532 (map '(nil))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
533 (longest 1)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
534 len entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
535 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
536 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
537 (setq len (length (car entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
538 (if (> len longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
539 (setq longest len))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
540 (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
541 (if (consp (car entry2))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
542 (let ((conversions (cdr entry)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
543 (while conversions
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
544 (if (not (member (car conversions) (car entry2)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
545 (setcar entry2 (cons (car conversions) (car entry2))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
546 (setq conversions (cdr conversions))))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
547 (set-nested-alist (car entry) (cdr entry) map len)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
548 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
549 (setcar map longest)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
550 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
551
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
552 (defmacro skkdic-set-okuri-nasi (&rest entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
553 `(defconst skkdic-okuri-nasi
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
554 ',(let ((l entries)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
555 (map '(skdic-okuri-nasi))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
556 (count 0)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
557 entry)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
558 (while l
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
559 (setq count (1+ count))
34532
dad96251e889 (skkdic-set-okuri-nasi): Show
Kenichi Handa <handa@m17n.org>
parents: 31196
diff changeset
560 (if (= (% count 10000) 0)
87170
e50a2e215441 * erc-stamp.el (erc-echo-timestamp):
David Kastrup <dak@gnu.org>
parents: 78484
diff changeset
561 (message "%d entries" count))
31164
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
562 (setq entry (skkdic-extract-conversion-data (car l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
563 (set-nested-alist (car entry) (cdr entry) map)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
564 (setq l (cdr l)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
565 map)))
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
566
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
567 (provide 'ja-dic-cnv)
bb7de354d69f Renamed from skkdic-cnv.el.
Kenichi Handa <handa@m17n.org>
parents:
diff changeset
568
36681
8f93fc285ff3 Add coding: tag in Loval Vairables: section.
Kenichi Handa <handa@m17n.org>
parents: 34626
diff changeset
569 ;; Local Variables:
8f93fc285ff3 Add coding: tag in Loval Vairables: section.
Kenichi Handa <handa@m17n.org>
parents: 34626
diff changeset
570 ;; coding: iso-2022-7bit
8f93fc285ff3 Add coding: tag in Loval Vairables: section.
Kenichi Handa <handa@m17n.org>
parents: 34626
diff changeset
571 ;; End:
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 36681
diff changeset
572
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 51055
diff changeset
573 ;;; 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
574 ;;; ja-dic-cnv.el ends here