1 ;;; mew-lang-jp.el --- Japanese specific stuff for Mew
3 ;; Author: Mito <mit@nines.nec.co.jp>
4 ;; Kazu Yamamoto <Kazu@Mew.org>
5 ;; Created: Sep 08, 1997
6 ;; Revised: Aug 24, 1998
10 (defconst mew-lang-jp-version "mew-lang-jp.el version 0.02")
13 (defvar mew-katakana-alist
14 '(( 161 . "
\e(I'
\e(B" )
25 ( 172 . "
\e(I6^
\e(B" )
27 ( 174 . "
\e(I7^
\e(B" )
29 ( 176 . "
\e(I8^
\e(B" )
31 ( 178 . "
\e(I9^
\e(B" )
33 ( 180 . "
\e(I:^
\e(B" )
35 ( 182 . "
\e(I;^
\e(B" )
37 ( 184 . "
\e(I<^
\e(B" )
39 ( 186 . "
\e(I=^
\e(B" )
41 ( 188 . "
\e(I>^
\e(B" )
43 ( 190 . "
\e(I?^
\e(B" )
45 ( 192 . "
\e(I@^
\e(B" )
47 ( 194 . "
\e(IA^
\e(B" )
50 ( 197 . "
\e(IB^
\e(B" )
52 ( 199 . "
\e(IC^
\e(B" )
54 ( 201 . "
\e(ID^
\e(B" )
61 ( 208 . "
\e(IJ^
\e(B" )
62 ( 209 . "
\e(IJ_
\e(B" )
64 ( 211 . "
\e(IK^
\e(B" )
65 ( 212 . "
\e(IK_
\e(B" )
67 ( 214 . "
\e(IL^
\e(B" )
68 ( 215 . "
\e(IL_
\e(B" )
70 ( 217 . "
\e(IM^
\e(B" )
71 ( 218 . "
\e(IM_
\e(B" )
73 ( 220 . "
\e(IN^
\e(B" )
74 ( 221 . "
\e(IN_
\e(B" )
91 ( 239 . "
\e(I\
\e(B" ) ;
\e(I\
\e(B ->
\e$B%o
\e(B
\e$B$KJQ49$9$k$h$&$K
\e(B
92 ( 238 . "
\e(I\
\e(B" ) ;
\e$B%o$H%n$N=gHV$,8r49$7$F$"$k!#
\e(B
97 ( 244 . "
\e(I3^
\e(B" )
99 ( 246 . "
\e(I9
\e(B" )))
101 (defvar mew-katakana-kigou-alist
102 '(( 162 . "
\e(I$
\e(B" )
103 ( 163 . "
\e(I!
\e(B" )
104 ( 166 . "
\e(I%
\e(B" )
105 ( 171 . "
\e(I^
\e(B" )
106 ( 172 . "
\e(I_
\e(B" )
107 ( 188 . "
\e(I0
\e(B" )
108 ( 214 . "
\e(I"
\e(B" )
109 ( 215 . "
\e(I#
\e(B" )))
111 (defvar mew-dakuon-list
112 '( ?
\e$B%+
\e(B ?
\e$B%-
\e(B ?
\e$B%/
\e(B ?
\e$B%1
\e(B ?
\e$B%3
\e(B
113 ?
\e$B%5
\e(B ?
\e$B%7
\e(B ?
\e$B%9
\e(B ?
\e$B%;
\e(B ?
\e$B%=
\e(B
114 ?
\e$B%?
\e(B ?
\e$B%A
\e(B ?
\e$B%D
\e(B ?
\e$B%F
\e(B ?
\e$B%H
\e(B
115 ?
\e$B%O
\e(B ?
\e$B%R
\e(B ?
\e$B%U
\e(B ?
\e$B%X
\e(B ?
\e$B%[
\e(B))
117 (defvar mew-handakuon-list (memq ?
\e$B%O
\e(B mew-dakuon-list))
119 (defun mew-search-henkan-alist (ch list)
123 (if (string= ch (cdr (car ptr)))
125 (setq result (car (car ptr)))
127 (setq ptr (cdr ptr))))
130 (defun mew-zenkaku-katakana-region (beg end)
132 (narrow-to-region beg end)
135 (while (re-search-forward "\\ck" nil t)
136 (let ((ch (preceding-char))
142 (setq wk (preceding-char)))
143 (cond ((= wk ?
\e$B%&
\e(B)
145 (insert "
\e$B%t
\e(B"))
146 ((setq wk (memq wk mew-dakuon-list))
148 (insert (1+ (car wk))))
151 (insert "
\e$B!+
\e(B"))))
155 (setq wk (preceding-char)))
156 (if (setq wk (memq wk mew-handakuon-list))
159 (insert (+ 2 (car wk))))
162 (insert "
\e$B!,
\e(B"))))
163 ((setq wk (mew-search-henkan-alist
164 (char-to-string ch) mew-katakana-alist))
168 (insert (mew-make-char mew-lc-jp 37 (- wk 128)))
169 (insert (mew-make-char mew-lc-jp ?\245 wk)))))
170 ((setq wk (mew-search-henkan-alist
171 (char-to-string ch) mew-katakana-kigou-alist))
175 (insert (mew-make-char mew-lc-jp 33 (- wk 128)))
176 (insert (mew-make-char mew-lc-jp ?\241 wk)))))))))))
178 (provide 'mew-lang-jp)
180 ;;; Copyright Notice:
182 ;; Copyright (C) 1997, 1998 Mew developing team.
183 ;; All rights reserved.
185 ;; Redistribution and use in source and binary forms, with or without
186 ;; modification, are permitted provided that the following conditions
189 ;; 1. Redistributions of source code must retain the above copyright
190 ;; notice, this list of conditions and the following disclaimer.
191 ;; 2. Redistributions in binary form must reproduce the above copyright
192 ;; notice, this list of conditions and the following disclaimer in the
193 ;; documentation and/or other materials provided with the distribution.
194 ;; 3. Neither the name of the team nor the names of its contributors
195 ;; may be used to endorse or promote products derived from this software
196 ;; without specific prior written permission.
198 ;; THIS SOFTWARE IS PROVIDED BY THE TEAM AND CONTRIBUTORS ``AS IS'' AND
199 ;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
200 ;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
201 ;; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TEAM OR CONTRIBUTORS BE
202 ;; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
203 ;; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
204 ;; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
205 ;; BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
206 ;; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
207 ;; OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
208 ;; IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
210 ;;; mew-lang-jp.el ends here