[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

新しい詳細読み機構: auditory-display-table-jp.el



渡辺です。

4つのフィールドを持つ詳細読み辞書を、char-table を使って作ってみました。
auditory-display-table-jp.el という名前でチェックインしました。今はま
だ辞書の中身がないので、このモジュールはどこからも呼ばれていませんが、
辞書が出来たら JapaneseDic.elの代わりになる予定です。
本多君、辞書の中身を作ってください。

すぐに吟味していただけるようにさわりだけ、以下に書きます。

---
(require 'cl)
(put 'auditory-display-table 'char-table-extra-slots 6)
(setq auditory-display-table-jp (make-char-table 'auditory-display-table))

;
(defun bep-get-phonetic-string (char &optional field)
  "Return the phonetic string, the 2nd field of dic, for this CHAR."
(interactive "sChar:\nnField:") 
(let ((dummy-array ["dummy" "dummy" "dummy"]))
(or (aref
     (or
      (aref auditory-display-table-jp (string-to-char char))
      (fillarray dummy-array char)) ; avoid error and return char itself
     (if field field 0))
    " ")))
;
(defun bep-get-cursor-string (char)
  "Return the short phonetic string (2nd field) of CHAR."
  (interactive "sChar:\n") 
  (bep-get-phonetic-string char 0))
;
(defun bep-get-explanatory-string (char)
  "Return the explanatory string (3rd field) of CHAR."
  (interactive "sChar:\n") 
  (bep-get-phonetic-string char 1))
;
(defun bep-get-long-explanatory-string (char)
  "Return the detail explanatory string (4th field) of CHAR."
  (interactive "sChar:\n") 
  (bep-get-phonetic-string char 2))
;
;; fill auditory-display-table-jp
(mapcar
 (function
  (lambda (dictionary)
    (aset auditory-display-table-jp
          (string-to-char (first dictionary)) ; Key
          (vector                             ; Values
                  (second dictionary)
                  (third dictionary)
                  (fourth dictionary)))))
'(
  ("井" "イ" "イド" "イドミズ")
  ("亜" "ア" "アジア" "アジア")
  ("あ"  "ア" "アサヒ" "ヒラガナノア")
;; 辞書の中身はまだない
))

以上。