+1998-02-21 KATAYAMA Yoshio <kate@pfu.co.jp>
+
+ * its.el (its-ins/del-SYL-batch): Set its-lang property.
+ (its-translate-region): Remove its-lang property from translated
+ text.
+ (its-translate-region-internal): New function. Retain its-lang
+ property on translated text.
+
+ * egg-mlh.el (mlh-space-bar-backward-henkan): Force base language
+ to Japanese.
+
+ (mlh-hangul mlh-zhongwen-tw mlh-zhongwen): New functions for
+ conversion functions.
+
1998-02-20 KATAYAMA Yoshio <kate@pfu.co.jp>
* its.el (its-restart): New function.
(interactive)
(let ((henkan-begin nil)
(inhibit-henkan t))
+ (its-select-hiragana) ;; force to Japanese
(mlh-backward-henkan)
(if henkan-begin
(if (or inhibit-henkan (= henkan-begin (point)))
(progn
(message "Converting...")
(sit-for 0)
- (put-text-property henkan-begin (point) 'its-lang "Japanese")
(egg-convert-region henkan-begin (point))
(message "") ))
(setq this-command 'self-insert-command)
(?q . mlh-quit)
; (?r . mlh-)
(?s . mlh-small-letter)
-; (?t . mlh-)
+ (?t . mlh-zhongwen-tw)
(?u . mlh-kanji)
; (?v . mlh-)
(?w . mlh-white-space)
(setq beg (point))
(goto-char end-marker)
(forward-char -1)
- (its-translate-region beg (point))
+ (its-translate-region-internal beg (point))
(delete-region (point) end-marker)
(if (null henkan-begin)
(setq henkan-begin beg)))
(setq beg (point))
(goto-char end-marker)
(forward-char -2)
- (its-translate-region beg (point))
+ (its-translate-region-internal beg (point))
(delete-region (point) end-marker)
(setq henkan-begin (point)))
(setq beg (point))
(goto-char end-marker)
(forward-char -2)
- (its-translate-region beg (point))
+ (its-translate-region-internal beg (point))
(insert (mlh-hira-to-kata
(prog1
(buffer-substring beg (point))
(setq i (+ i 3)))
result))
+(defun mlh-hangul ()
+ (forward-char -1)
+ (skip-chars-backward "a-zEO-RTW,.[]")
+ (mlh-backward-henkan)
+ (setq beg (point))
+ (setq inhibit-henkan nil)
+ (goto-char end-marker)
+ (forward-char -2)
+ (let (its-current-map its-current-language egg-mode-line-title)
+ (its-select-hangul)
+ (its-translate-region-internal beg (point)))
+ (delete-region (point) end-marker)
+ (if (null henkan-begin)
+ (setq henkan-begin beg)))
+
+(defun mlh-zhongwen ()
+ (forward-char -1)
+ (skip-chars-backward "a-z0-4 ,.[]")
+ (mlh-backward-henkan)
+ (setq beg (point))
+ (setq inhibit-henkan nil)
+ (goto-char end-marker)
+ (forward-char -2)
+ (let (its-current-map its-current-language egg-mode-line-title)
+ (its-select-pinyin-cn)
+ (its-translate-region-internal beg (point)))
+ (delete-region (point) end-marker)
+ (if (null henkan-begin)
+ (setq henkan-begin beg)))
+
+(defun mlh-zhongwen-tw ()
+ (forward-char -1)
+ (skip-chars-backward "a-z0-4,.[]")
+ (mlh-backward-henkan)
+ (setq beg (point))
+ (setq inhibit-henkan nil)
+ (goto-char end-marker)
+ (forward-char -2)
+ (let (its-current-map its-current-language egg-mode-line-title)
+ (its-select-pinyin-tw)
+ (its-translate-region-internal beg (point)))
+ (delete-region (point) end-marker)
+ (if (null henkan-begin)
+ (setq henkan-begin beg)))
+
(provide 'egg-mlh)
;;; egg-mlh.el ends here.
(defvar its-translation-result nil "")
(defun its-ins/del-SYL-batch (newsyl oldsyl)
+ (let (output)
(its-update-latest-SYL newsyl)
(if (and newsyl
(consp (cdr newsyl))
(not (its-kst-p (its-get-kst/t newsyl))))
- ;; DSYL
- (setq its-translation-result
- (cons (its-get-output newsyl) its-translation-result))))
-
-(defun its-translate-region (start end &optional map)
+ (progn
+ ;; DSYL
+ (setq output (its-get-output newsyl))
+ (put-text-property 0 (length output)
+ 'its-lang its-current-language output)
+ (setq its-translation-result
+ (cons output its-translation-result))))))
+
+(defun its-translate-region (start end)
(interactive "r")
+ (its-translate-region-internal start end)
+ (remove-text-properties start (point) '(its-lang nil)))
+
+(defun its-translate-region-internal (start end)
(setq its-translation-result nil)
(goto-char start)
(let ((i 0)