;;; -*-byte-compile-dynamic: t;-*-
;;; od-italiana.el --- dictionary-dependent file (Sanseido Crown fran,Agais-japonais)
;; Author: MITA Yoshio <mita@jp.FreeBSD.org>
;; This file is created for Nichigai associates EB book ISBN4-8169-7031-2
(eval-when-compile

(defconst odccl-gaiji-italiana1
  (list
	nil	nil	nil	nil	nil	nil	nil	nil
	nil	nil	nil	nil	nil	nil	nil	nil
	nil	nil	nil	nil	nil	nil	nil	nil
	nil	nil	nil	nil	nil	nil	nil	nil
	nil ["#`E" ",AH"]  ["#`a" ",A`"] ["#^a" ",Ab"] 
	["#'e" ",Ai"] ["#`e" ",Ah"] ["#`i" ",Al"] ["#'o" ",As"]
	;
	["#`o" ",Ar"] ["#^o" ",At"] ["#`u" ",Ay"] ["#^u" ",A{"] 
)

(defun odccl-make-ccl-italiana (&optional key)
  (odccl-make-ccl
   (odccl-make-low-tables
    (append
     (odccl-low-alist-japanese key)
     (list (cons 161
		 (` (read-branch
		     r2
		     (,@ (odccl-select odccl-gaiji-italiana1 key))))))
	   )))))

)				; end of eval-when-compile

;(defconst od-ccl-italiana (odccl-compile odccl-make-ccl-italiana))

(odccl-define od-ccl-italiana-x (ccl-compile (odccl-make-ccl-italiana 'x)))

(odccl-define od-ccl-italiana-nw (ccl-compile (odccl-make-ccl-italiana)))

(defvar od-italiana-not-example-header-regexp " +[^ ･・]")
(defvar od-italiana-example-header-regexp " +[･・]")

(defun od-filter-italiana ()
  (let ((head (concat "^" od-italiana-not-example-header-regexp))
	(tail (concat "\n" od-italiana-example-header-regexp)))
    (goto-char 1)
    (while (re-search-forward head nil t)
      (end-of-line)
      (if (looking-at tail)
	  (insert "：")))))

(defun od-italiana-compute-fill-prefix ()
  (save-excursion
    (while (eolp)
      (forward-char))
    (cond ((looking-at
	    " +\\([A-Z]?[1-9][0-9]?[a-z]? \\|[a-z] \\|[･・]\\|[−]\\|([1-9][0-9]?)\\)")
;;;	   (goto-char (match-end 0))
;;;	   (concat "　" (make-string (- (current-column) 2) ?\ )))
;;	   (goto-char (match-beginning 0))
;;	   (concat "　" (make-string (+ (current-column) 3) ?\ )))
	   "　   ")
	  ((>= (current-indentation) 2)
	   (concat "　"
		   (make-string (- (current-indentation) 2) ?\ )))
	  (t
	   nil))))

(od-modify-dict-parameters
 "italian"
 (cons
  (cons 'summary
	(cons od-italiana-not-example-header-regexp
	      "\\(：$\\|\^M\\)"))
  '((pretty-name . "現代イタリア語表現辞典(イタリア語引き)")
    (ccl . (od-ccl-italiana-x . od-ccl-italiana-nw))
    (japanese-input . nil)
    (filter-func-list
     . (od-convert-one-digit-superscript
	od-filter-italiana od-filter-buffer))
    (filter-regexp-list . nil)
    ;; (fill-function . default)
    (compute-fill-prefix-func . od-italiana-compute-fill-prefix)
    (header-column . nil)
    (secondary-dictionary . ((?k . "italiana") (?K . "italiana"))))))

(od-modify-dict-parameters
 "italian-j"
 (cons
  (cons 'summary
	(cons od-italiana-not-example-header-regexp
	      "\\(：$\\|\^M\\)"))
  '((pretty-name . "現代イタリア語表現辞典(日本語引き)")
    (ccl . (od-ccl-italiana-x . od-ccl-italiana-nw))
    (japanese-input . t)
    (filter-func-list
     . (od-convert-one-digit-superscript
	od-filter-italiana od-filter-buffer))
    (filter-regexp-list . nil)
    ;; (fill-function . default)
    (compute-fill-prefix-func . od-italiana-compute-fill-prefix)
    (header-column . nil)
    (secondary-dictionary . ((?a . "italiana") (?A . "italiana"))))))

(od-add-title-name "		         現代イタリア語表現辞典")

;;; od-italiana.el ends here

