;; This file will be part of GNU Emacs (in future).
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; EGG is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
-;; GNU Emacs is distributed in the hope that it will be useful,
+;; EGG is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;; Code:
+(defconst sj3-support-languages '("Japanese"))
+
(defconst sj3-conversion-backend
[ sj3-init
(defun sj3-init ()
)
-(defun sj3-start-conversion (yomi)
+(defun sj3-start-conversion (yomi lang)
"Convert YOMI string to kanji, and enter conversion mode.
Return the list of bunsetsu."
(let ((env (sj3-get-environment)))
(env (sj3bunsetsu-get-env b1))
yomi1 yomi2
bunsetsu1 bunsetsu2)
- (save-match-data
- (string-match (concat "^\\(" (make-string len ?.) "\\)\\(.*$\\)") yomi)
- (setq yomi1 (match-string 1 yomi))
- (setq yomi2 (match-string 2 yomi)))
+ (setq yomi1 (substring yomi 0 len)
+ yomi2 (substring yomi len))
(setq bunsetsu1
(sj3rpc-tanbunsetsu-conversion env yomi1))
;; Only set once.
(list bunsetsu1))))
;; XXX: Not implemented yet
-(defun sj3-fini ()
+(defun sj3-fini (lang)
)
+;;; setup
+
+(require 'egg)
+(load "egg/sj3rpc")
+
+;;;###autoload
+(defun egg-activate-sj3 (&optional arg)
+ "Activate SJ3 backend of Tamagotchy."
+ (egg-set-support-languages sj3-support-languages)
+ (egg-set-conversion-backend sj3-conversion-backend
+ sj3-support-languages
+ nil)
+ (apply 'egg-mode arg))
+
;;; egg/sj3.el ends here.