]> code.delx.au - gnu-emacs/blob - lisp/language/japan-util.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / language / japan-util.el
1 ;;; japan-util.el --- utilities for Japanese -*- coding: iso-2022-7bit; -*-
2
3 ;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
4 ;; Free Software Foundation, Inc.
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
6 ;; 2005, 2006, 2007, 2008
7 ;; National Institute of Advanced Industrial Science and Technology (AIST)
8 ;; Registration Number H14PRO021
9
10 ;; Keywords: mule, multilingual, Japanese
11
12 ;; This file is part of GNU Emacs.
13
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation, either version 3 of the License, or
17 ;; (at your option) any later version.
18
19 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
23
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26
27 ;;; Commentary:
28
29 ;;; Code:
30
31 ;;;###autoload
32 (defun setup-japanese-environment-internal ()
33 ;; By default, we use 'japanese-iso-8bit for file names. But, the
34 ;; following prefer-coding-system will override it.
35 (if (memq system-type '(windows-nt ms-dos cygwin))
36 (prefer-coding-system 'japanese-shift-jis)
37 (prefer-coding-system 'japanese-iso-8bit))
38 (use-cjk-char-width-table))
39
40 (defconst japanese-kana-table
41 '((?\e$B$"\e(B ?\e$B%"\e(B ?\e(I1\e(B) (?\e$B$$\e(B ?\e$B%$\e(B ?\e(I2\e(B) (?\e$B$&\e(B ?\e$B%&\e(B ?\e(I3\e(B) (?\e$B$(\e(B ?\e$B%(\e(B ?\e(I4\e(B) (?\e$B$*\e(B ?\e$B%*\e(B ?\e(I5\e(B)
42 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e(B") (?\e$B$G\e(B ?\e$B%G\e(B "\e(IC^\e(B") (?\e$B$I\e(B ?\e$B%I\e(B "\e(ID^\e(B")
55 (?\e$B$P\e(B ?\e$B%P\e(B "\e(IJ^\e(B") (?\e$B$S\e(B ?\e$B%S\e(B "\e(IK^\e(B") (?\e$B$V\e(B ?\e$B%V\e(B "\e(IL^\e(B") (?\e$B$Y\e(B ?\e$B%Y\e(B "\e(IM^\e(B") (?\e$B$\\e(B ?\e$B%\\e(B "\e(IN^\e(B")
56 (?\e$B$Q\e(B ?\e$B%Q\e(B "\e(IJ_\e(B") (?\e$B$T\e(B ?\e$B%T\e(B "\e(IK_\e(B") (?\e$B$W\e(B ?\e$B%W\e(B "\e(IL_\e(B") (?\e$B$Z\e(B ?\e$B%Z\e(B "\e(IM_\e(B") (?\e$B$]\e(B ?\e$B%]\e(B "\e(IN_\e(B")
57 (?\e$B$!\e(B ?\e$B%!\e(B ?\e(I'\e(B) (?\e$B$#\e(B ?\e$B%#\e(B ?\e(I(\e(B) (?\e$B$%\e(B ?\e$B%%\e(B ?\e(I)\e(B) (?\e$B$'\e(B ?\e$B%'\e(B ?\e(I*\e(B) (?\e$B$)\e(B ?\e$B%)\e(B ?\e(I+\e(B)
58 (?\e$B$C\e(B ?\e$B%C\e(B ?\e(I/\e(B)
59 (?\e$B$c\e(B ?\e$B%c\e(B ?\e(I,\e(B) (?\e$B$e\e(B ?\e$B%e\e(B ?\e(I-\e(B) (?\e$B$g\e(B ?\e$B%g\e(B ?\e(I.\e(B)
60 (?\e$B$n\e(B ?\e$B%n\e(B "\e(I\\e(B")
61 ("\e$B$&!+\e(B" ?\e$B%t\e(B "\e(I3^\e(B") (nil ?\e$B%u\e(B "\e(I6\e(B") (nil ?\e$B%v\e(B "\e(I9\e(B"))
62 "Japanese JISX0208 Kana character table.
63 Each element is of the form (HIRAGANA KATAKANA HANKAKU-KATAKANA), where
64 HIRAGANA and KATAKANA belong to `japanese-jisx0208',
65 HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.")
66
67 ;; Put properties 'katakana, 'hiragana, and 'jix0201 to each Japanese
68 ;; kana characters for conversion among them.
69 (let ((l japanese-kana-table)
70 slot hiragana katakana jisx0201)
71 (while l
72 (setq slot (car l)
73 hiragana (car slot) katakana (nth 1 slot) jisx0201 (nth 2 slot)
74 l (cdr l))
75 (if hiragana
76 (if (stringp hiragana)
77 (if (> (length hiragana) 1)
78 (let ((hira (aref hiragana 0)))
79 (put-char-code-property
80 hira 'kana-composition
81 (cons (cons (aref hiragana 1) katakana)
82 (get-char-code-property hira 'kana-composition)))))
83 (put-char-code-property hiragana 'katakana katakana)
84 (put-char-code-property hiragana 'jisx0201 jisx0201)))
85 (when (integerp katakana)
86 (put-char-code-property katakana 'hiragana hiragana)
87 (put-char-code-property katakana 'jisx0201 jisx0201))
88 (if jisx0201
89 (if (stringp jisx0201)
90 (if (> (length jisx0201) 1)
91 (let ((kana (aref jisx0201 0)))
92 (put-char-code-property
93 kana 'kana-composition
94 (cons (cons (aref jisx0201 1) katakana)
95 (get-char-code-property kana 'kana-composition)))))
96 (put-char-code-property jisx0201 'hiragana hiragana)
97 (put-char-code-property jisx0201 'katakana katakana)
98 (put-char-code-property jisx0201 'jisx0208 katakana)))))
99
100 (defconst japanese-symbol-table
101 '((?\\e$B!!\e(B ?\ ) (?\e$B!$\e(B ?, ?\e(I$\e(B) (?\e$B!%\e(B ?. ?\e(I!\e(B) (?\e$B!"\e(B ?, ?\e(I$\e(B) (?\e$B!#\e(B ?. ?\e(I!\e(B) (?\e$B!&\e(B nil ?\e(I%\e(B)
102 (?\e$B!'\e(B ?:) (?\e$B!(\e(B ?\;) (?\e$B!)\e(B ??) (?\e$B!*\e(B ?!) (?\e$B!+\e(B nil ?\e(I^\e(B) (?\e$B!,\e(B nil ?\e(I_\e(B)
103 (?\e$B!-\e(B ?') (?\e$B!.\e(B ?`) (?\e$B!0\e(B ?^) (?\e$B!2\e(B ?_) (?\e$B!<\e(B ?- ?\e(I0\e(B) (?\e$B!=\e(B ?-) (?\e$B!>\e(B ?-)
104 (?\e$B!?\e(B ?/) (?\e$B!@\e(B ?\\) (?\e$B!A\e(B ?~) (?\e$B!C\e(B ?|) (?\e$B!F\e(B ?`) (?\e$B!G\e(B ?') (?\e$B!H\e(B ?\") (?\e$B!I\e(B ?\")
105 (?\\e$B!J\e(B ?\() (?\\e$B!K\e(B ?\)) (?\\e$B!N\e(B ?[) (?\\e$B!O\e(B ?]) (?\\e$B!P\e(B ?{) (?\\e$B!Q\e(B ?})
106 (?\e$B!R\e(B ?<) (?\e$B!S\e(B ?>) (?\\e$B!V\e(B nil ?\\e(I"\e(B) (?\\e$B!W\e(B nil ?\\e(I#\e(B)
107 (?\e$B!\\e(B ?+) (?\e$B!]\e(B ?-) (?\e$B!a\e(B ?=) (?\e$B!c\e(B ?<) (?\e$B!d\e(B ?>)
108 (?\e$B!l\e(B ?') (?\e$B!m\e(B ?\") (?\e$B!o\e(B ?\\) (?\e$B!p\e(B ?$) (?\e$B!s\e(B ?%) (?\e$B!t\e(B ?#) (?\e$B!u\e(B ?&) (?\e$B!v\e(B ?*)
109 (?\e$B!w\e(B ?@))
110 "Japanese JISX0208 symbol character table.
111 Each element is of the form (SYMBOL ASCII HANKAKU), where SYMBOL
112 belongs to `japanese-jisx0208', ASCII belongs to `ascii', and HANKAKU
113 belongs to `japanese-jisx0201-kana'.")
114
115 ;; Put properties 'jisx0208, 'jisx0201, and 'ascii to each Japanese
116 ;; symbol and ASCII characters for conversion among them.
117 (let ((l japanese-symbol-table)
118 slot jisx0208 ascii jisx0201)
119 (while l
120 (setq slot (car l)
121 jisx0208 (car slot) ascii (nth 1 slot) jisx0201 (nth 2 slot)
122 l (cdr l))
123 (if ascii
124 (progn
125 (put-char-code-property jisx0208 'ascii ascii)
126 (put-char-code-property ascii 'jisx0208 jisx0208)))
127 (if jisx0201
128 (progn
129 (put-char-code-property jisx0208 'jisx0201 jisx0201)
130 (put-char-code-property jisx0201 'jisx0208 jisx0208)))))
131
132 (defconst japanese-alpha-numeric-table
133 '((?\e$B#0\e(B . ?0) (?\e$B#1\e(B . ?1) (?\e$B#2\e(B . ?2) (?\e$B#3\e(B . ?3) (?\e$B#4\e(B . ?4)
134 (?\e$B#5\e(B . ?5) (?\e$B#6\e(B . ?6) (?\e$B#7\e(B . ?7) (?\e$B#8\e(B . ?8) (?\e$B#9\e(B . ?9)
135 (?\e$B#A\e(B . ?A) (?\e$B#B\e(B . ?B) (?\e$B#C\e(B . ?C) (?\e$B#D\e(B . ?D) (?\e$B#E\e(B . ?E)
136 (?\e$B#F\e(B . ?F) (?\e$B#G\e(B . ?G) (?\e$B#H\e(B . ?H) (?\e$B#I\e(B . ?I) (?\e$B#J\e(B . ?J)
137 (?\e$B#K\e(B . ?K) (?\e$B#L\e(B . ?L) (?\e$B#M\e(B . ?M) (?\e$B#N\e(B . ?N) (?\e$B#O\e(B . ?O)
138 (?\e$B#P\e(B . ?P) (?\e$B#Q\e(B . ?Q) (?\e$B#R\e(B . ?R) (?\e$B#S\e(B . ?S) (?\e$B#T\e(B . ?T)
139 (?\e$B#U\e(B . ?U) (?\e$B#V\e(B . ?V) (?\e$B#W\e(B . ?W) (?\e$B#X\e(B . ?X) (?\e$B#Y\e(B . ?Y) (?\e$B#Z\e(B . ?Z)
140 (?\e$B#a\e(B . ?a) (?\e$B#b\e(B . ?b) (?\e$B#c\e(B . ?c) (?\e$B#d\e(B . ?d) (?\e$B#e\e(B . ?e)
141 (?\e$B#f\e(B . ?f) (?\e$B#g\e(B . ?g) (?\e$B#h\e(B . ?h) (?\e$B#i\e(B . ?i) (?\e$B#j\e(B . ?j)
142 (?\e$B#k\e(B . ?k) (?\e$B#l\e(B . ?l) (?\e$B#m\e(B . ?m) (?\e$B#n\e(B . ?n) (?\e$B#o\e(B . ?o)
143 (?\e$B#p\e(B . ?p) (?\e$B#q\e(B . ?q) (?\e$B#r\e(B . ?r) (?\e$B#s\e(B . ?s) (?\e$B#t\e(B . ?t)
144 (?\e$B#u\e(B . ?u) (?\e$B#v\e(B . ?v) (?\e$B#w\e(B . ?w) (?\e$B#x\e(B . ?x) (?\e$B#y\e(B . ?y) (?\e$B#z\e(B . ?z))
145 "Japanese JISX0208 alpha numeric character table.
146 Each element is of the form (ALPHA-NUMERIC ASCII), where ALPHA-NUMERIC
147 belongs to `japanese-jisx0208', ASCII belongs to `ascii'.")
148
149 ;; Put properties 'jisx0208 and 'ascii to each Japanese alpha numeric
150 ;; and ASCII characters for conversion between them.
151 (let ((l japanese-alpha-numeric-table)
152 slot jisx0208 ascii)
153 (while l
154 (setq slot (car l)
155 jisx0208 (car slot) ascii (cdr slot)
156 l (cdr l))
157 (put-char-code-property jisx0208 'ascii ascii)
158 (put-char-code-property ascii 'jisx0208 jisx0208)))
159
160 ;; Convert string STR by FUNC and return a resulting string.
161 (defun japanese-string-conversion (str func &rest args)
162 (let ((buf (get-buffer-create " *Japanese work*")))
163 (save-excursion
164 (set-buffer buf)
165 (erase-buffer)
166 (insert str)
167 (apply func 1 (point) args)
168 (buffer-string))))
169
170 ;;;###autoload
171 (defun japanese-katakana (obj &optional hankaku)
172 "Convert argument to Katakana and return that.
173 The argument may be a character or string. The result has the same type.
174 The argument object is not altered--the value is a copy.
175 Optional argument HANKAKU t means to convert to `hankaku' Katakana
176 \(`japanese-jisx0201-kana'), in which case return value
177 may be a string even if OBJ is a character if two Katakanas are
178 necessary to represent OBJ."
179 (if (stringp obj)
180 (japanese-string-conversion obj 'japanese-katakana-region hankaku)
181 (or (get-char-code-property obj (if hankaku 'jisx0201 'katakana))
182 obj)))
183
184 ;;;###autoload
185 (defun japanese-hiragana (obj)
186 "Convert argument to Hiragana and return that.
187 The argument may be a character or string. The result has the same type.
188 The argument object is not altered--the value is a copy."
189 (if (stringp obj)
190 (japanese-string-conversion obj 'japanese-hiragana-region)
191 (or (get-char-code-property obj 'hiragana)
192 obj)))
193
194 ;;;###autoload
195 (defun japanese-hankaku (obj &optional ascii-only)
196 "Convert argument to `hankaku' and return that.
197 The argument may be a character or string. The result has the same type.
198 The argument object is not altered--the value is a copy.
199 Optional argument ASCII-ONLY non-nil means to return only ASCII character."
200 (if (stringp obj)
201 (japanese-string-conversion obj 'japanese-hankaku-region ascii-only)
202 (or (and (not ascii-only)
203 (get-char-code-property obj 'jisx0201))
204 (get-char-code-property obj 'ascii)
205 obj)))
206
207 ;;;###autoload
208 (defun japanese-zenkaku (obj)
209 "Convert argument to `zenkaku' and return that.
210 The argument may be a character or string. The result has the same type.
211 The argument object is not altered--the value is a copy."
212 (if (stringp obj)
213 (japanese-string-conversion obj 'japanese-zenkaku-region)
214 (or (get-char-code-property obj 'jisx0208)
215 obj)))
216
217 (defun japanese-replace-region (from to string)
218 "Replace the region specified by FROM and TO to STRING."
219 (goto-char from)
220 (insert string)
221 (delete-char (- to from)))
222
223 ;;;###autoload
224 (defun japanese-katakana-region (from to &optional hankaku)
225 "Convert Japanese `hiragana' chars in the region to `katakana' chars.
226 Optional argument HANKAKU t means to convert to `hankaku katakana' character
227 of which charset is `japanese-jisx0201-kana'."
228 (interactive "r\nP")
229 (save-restriction
230 (narrow-to-region from to)
231 (save-excursion
232 (goto-char (point-min))
233 (while (re-search-forward "\\cH\\|\\cK" nil t)
234 (let* ((kana (preceding-char))
235 (composition
236 (and (not hankaku)
237 (get-char-code-property kana 'kana-composition)))
238 next slot)
239 (if (and composition (setq slot (assq (following-char) composition)))
240 (japanese-replace-region (match-beginning 0) (1+ (point))
241 (cdr slot))
242 (let ((kata (get-char-code-property
243 kana (if hankaku 'jisx0201 'katakana))))
244 (if kata
245 (japanese-replace-region (match-beginning 0) (point)
246 kata)))))))))
247
248
249 ;;;###autoload
250 (defun japanese-hiragana-region (from to)
251 "Convert Japanese `katakana' chars in the region to `hiragana' chars."
252 (interactive "r")
253 (save-restriction
254 (narrow-to-region from to)
255 (save-excursion
256 (goto-char (point-min))
257 (while (re-search-forward "\\cK\\|\\ck" nil t)
258 (let* ((kata (preceding-char))
259 (composition (get-char-code-property kata 'kana-composition))
260 next slot)
261 (if (and composition (setq slot (assq (following-char) composition)))
262 (japanese-replace-region (match-beginning 0) (1+ (point))
263 (get-char-code-property
264 (cdr slot) 'hiragana))
265 (let ((hira (get-char-code-property kata 'hiragana)))
266 (if hira
267 (japanese-replace-region (match-beginning 0) (point)
268 hira)))))))))
269
270 ;;;###autoload
271 (defun japanese-hankaku-region (from to &optional ascii-only)
272 "Convert Japanese `zenkaku' chars in the region to `hankaku' chars.
273 `Zenkaku' chars belong to `japanese-jisx0208'
274 `Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'.
275 Optional argument ASCII-ONLY non-nil means to convert only to ASCII char."
276 (interactive "r\nP")
277 (save-restriction
278 (narrow-to-region from to)
279 (save-excursion
280 (goto-char (point-min))
281 (while (re-search-forward "\\cj" nil t)
282 (let* ((zenkaku (preceding-char))
283 (hankaku (or (and (not ascii-only)
284 (get-char-code-property zenkaku 'jisx0201))
285 (get-char-code-property zenkaku 'ascii))))
286 (if hankaku
287 (japanese-replace-region (match-beginning 0) (match-end 0)
288 hankaku)))))))
289
290 ;;;###autoload
291 (defun japanese-zenkaku-region (from to &optional katakana-only)
292 "Convert hankaku' chars in the region to Japanese `zenkaku' chars.
293 `Zenkaku' chars belong to `japanese-jisx0208'
294 `Hankaku' chars belong to `ascii' or `japanese-jisx0201-kana'.
295 Optional argument KATAKANA-ONLY non-nil means to convert only KATAKANA char."
296 (interactive "r\nP")
297 (save-restriction
298 (narrow-to-region from to)
299 (save-excursion
300 (goto-char (point-min))
301 (while (or (and katakana-only
302 (re-search-forward "\\ck" nil t))
303 (and (not katakana-only)
304 (re-search-forward "\\ca\\|\\ck" nil t)))
305 (let* ((hankaku (preceding-char))
306 (composition (get-char-code-property hankaku 'kana-composition))
307 next slot)
308 (if (and composition (setq slot (assq (following-char) composition)))
309 (japanese-replace-region (match-beginning 0) (1+ (point))
310 (cdr slot))
311 (let ((zenkaku (japanese-zenkaku hankaku)))
312 (if zenkaku
313 (japanese-replace-region (match-beginning 0) (match-end 0)
314 zenkaku)))))))))
315
316 ;;;###autoload
317 (defun read-hiragana-string (prompt &optional initial-input)
318 "Read a Hiragana string from the minibuffer, prompting with string PROMPT.
319 If non-nil, second arg INITIAL-INPUT is a string to insert before reading."
320 (read-multilingual-string prompt initial-input "japanese-hiragana"))
321
322 ;;
323 (provide 'japan-util)
324
325 ;; arch-tag: b579595c-c9ad-4b57-9314-98cd8b214f89
326 ;;; japan-util.el ends here