Initial Commit
[packages] / mule-packages / lookup / packages / jitenban97 / iwakoku.el
1 ;;; iwakoku.el --- supplement file for \e$B!V4dGH9q8l<-E5!W\e(B
2 ;; Copyright (C) 1999 Lookup Development Team <lookup@ring.gr.jp>
3
4 ;; Author: Keisuke Nishida <kei@psn.net>
5 ;; Target: ndtp 1.0, ndeb 1.0
6 ;; Format: 1.1
7 ;; Version: $Id: iwakoku.el,v 1.1 1999-07-23 07:17:35 steveb Exp $
8
9 ;; This program is free software; you can redistribute it and/or
10 ;; modify it under the terms of the GNU General Public License
11 ;; as published by the Free Software Foundation; either version 2
12 ;; of the License, or (at your option) any later version.
13
14 ;; This program is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ;; GNU General Public License for more details.
18
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with this program; if not, write to the Free Software Foundation,
21 ;; Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22
23 ;;; Code:
24
25 (require 'lookup-package)
26
27 (defconst iwakoku-gaiji-table
28   (lookup-new-gaiji-table
29    '(("za321" "[\e$BL>\e(B]") ("za322" "[\e$BBe\e(B]") ("za323" "[\e$B7A\e(B]") ("za324" "[\e$BF0\e(B]")
30      ("za325" "[\e$BI{\e(B]") ("za326" "[\e$B@\\e(B]") ("za327" "[\e$BA0\e(B]") ("za328" "[\e$B4'\e(B]")
31      ("za329" "[\e$B4V\e(B]") ("za32a" "[\e$B=u\e(B") ("za32b" "\e$BF0\e(B]") ("za32c" "[\e$B@\\e(B")
32      ("za32d" "\e$BF,\e(B]") ("za32e" "\e$BHx\e(B]") ("za32f" "[U]") ("za330" "[C]")
33      ("za331" "(\e$BC1\e(B)") ("za332" "(\e$BJ#\e(B)") ("za333" "[A]") ("za334" "[P]")
34      ("za335" "(\e$B<+\e(B)") ("za336" "(\e$BB>\e(B)") ("za337" "[\e$B@.\e(B") ("za338" "\e$B6g\e(B]")
35      ("za339" nil "<\e$B2;\e(B>") ("za33a" nil "<\e$BNc\e(B>") ("za33b" nil "<\e$B%a%b\e(B>")
36      ("za33c" nil "<\e$B0lMw\e(B>") ("za33f" "\e$(C"Q\e(B") ("za34f" "\e$(C!j\e(B")
37      ("za37c" "(C)") ("za37d" "(R)") ("za722" "\e$B"M\e(B"))))
38
39 (defconst iwakoku-arranges
40   '(iwakoku-fix-by-black-list
41     lookup-arrange-gaijis
42     lookup-arrange-references
43     lookup-arrange-default-headings
44     iwakoku-arrange-headings
45     lookup-arrange-fill-lines))
46
47 (setq lookup-package-dictionary-options
48       (list (cons ':gaiji-table iwakoku-gaiji-table)
49             (cons ':arranges iwakoku-arranges)))
50
51 (defun iwakoku-fix-by-black-list (entry)
52   (let ((code (lookup-entry-code entry)))
53     (cond
54      ((string= code "212d:d8")
55       (search-forward "\e$B$5\e(B\n\e$B$?\e(B") (replace-match "\e$B$5$?\e(B")))))
56
57 (defun iwakoku-arrange-headings (entry)
58   (while (re-search-forward "\\(\\[.\\]\\)\\|\\(([0-9]+)\\)\\|([\e$B%"\e(B-\e$B%s\e(B]+)" nil t)
59     (lookup-make-region-heading (match-beginning 0) (match-end 0)
60                                 (if (match-beginning 1) 3
61                                   (if (match-beginning 2) 4 5)))
62     ;; \e$B$3$N<-=q$O!"9`L\$,0l9T$K$:$i$:$i$HJB$Y$i$l$F$$$k$N$G!"\e(B
63     ;; \e$BE,Ev$J8D=j$G2~9T$7$F$*$/!#\e(B
64     (save-excursion
65       (goto-char (match-beginning 0))
66       (unless (or (bolp) (get-text-property (- (point) 2) 'lookup-heading))
67         (newline)))))
68
69 ;;; iwakoku.el ends here