Revision: 6045
Author: ek.kato
Date: Wed Nov 4 08:13:55 2009
Log: * scm/japanese.scm (japanese-auto-start-henkan-keyword-list)
- New. List for character to start auto conversion.
* scm/ajax-ime-custom.scm (ajax-ime-auto-start-henkan?)
* scm/anthy-utf8-custom.scm (anthy-auto-start-henkan?)
* scm/anthy-custom.scm (anthy-auto-start-henkan?)
* scm/canna-custom.scm (canna-auto-start-henkan?)
* scm/mana-custom.scm (mana-auto-start-henkan?)
* scm/sj3-custom.scm (sj3-auto-start-henkan?)
* scm/social-ime-custom.scm (social-ime-auto-start-henkan?)
- New. Default is #f.
* scm/ajax-ime.scm (ajax-ime-proc-input-state-with-preedit)
* scm/anthy-utf8.scm (anthy-utf8-proc-input-state-with-preedit)
* scm/anthy.scm (anthy-proc-input-state-with-preedit)
* scm/canna.scm (canna-proc-input-state-with-preedit)
* scm/mana.scm (mana-proc-input-state-with-preedit)
* scm/sj3.scm (sj3-proc-input-state-with-preedit)
* scm/social-ime.scm (social-ime-proc-input-state-with-preedit)
- Start auto conversion with punctuation marks.
http://code.google.com/p/uim/source/detail?r=6045
Modified:
/trunk/scm/ajax-ime-custom.scm
/trunk/scm/ajax-ime.scm
/trunk/scm/anthy-custom.scm
/trunk/scm/anthy-utf8-custom.scm
/trunk/scm/anthy-utf8.scm
/trunk/scm/anthy.scm
/trunk/scm/canna-custom.scm
/trunk/scm/canna.scm
/trunk/scm/japanese.scm
/trunk/scm/mana-custom.scm
/trunk/scm/mana.scm
/trunk/scm/sj3-custom.scm
/trunk/scm/sj3.scm
/trunk/scm/social-ime-custom.scm
/trunk/scm/social-ime.scm
=======================================
--- /trunk/scm/ajax-ime-custom.scm Mon Aug 17 04:25:12 2009
+++ /trunk/scm/ajax-ime-custom.scm Wed Nov 4 08:13:55 2009
@@ -325,6 +325,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'ajax-ime-auto-start-henkan? #f
+ '(ajax-ime-advanced special-op)
+ '(boolean)
+ (N_ "Enable auto conversion with punctuation marks")
+ (N_ "long description will be here."))
+
(define-custom 'ajax-ime-use-mode-transition-keys-in-off-mode? #f
'(ajax-ime-advanced mode-transition)
'(boolean)
=======================================
--- /trunk/scm/ajax-ime.scm Mon Aug 17 04:25:12 2009
+++ /trunk/scm/ajax-ime.scm Wed Nov 4 08:13:55 2009
@@ -1069,6 +1069,14 @@
(ajax-ime-proc-input-state ac key key-state))))))
(define (ajax-ime-proc-input-state-with-preedit ac key key-state)
+ (define (check-auto-conv str)
+ (and
+ str
+ ajax-ime-auto-start-henkan?
+ (string-find japanese-auto-start-henkan-keyword-list str)
+ (begin
+ (ajax-ime-reset-prediction-window ac)
+ (ajax-ime-begin-conv ac))))
(let ((preconv-str (ajax-ime-context-preconv-ustr ac))
(raw-str (ajax-ime-context-raw-ustr ac))
(rkc (ajax-ime-context-rkc ac))
@@ -1265,7 +1273,8 @@
(list key-str key-str key-str)
(list (ja-wide key-str) (ja-wide key-str)
(ja-wide key-str))))
- (ustr-insert-elem! raw-str key-str))
+ (ustr-insert-elem! raw-str key-str)
+ (check-auto-conv key-str))
(let* ((key-str (charcode->string
(if (= rule ajax-ime-input-rule-kana)
key
@@ -1288,7 +1297,8 @@
(ustr-insert-elem! raw-str key-str))
(ustr-insert-elem!
raw-str
- (string-append pend key-str))))))))))))
+ (string-append pend key-str))))))
+ (check-auto-conv (if res (car res) #f))))))))
(define ajax-ime-context-confirm-kana!
(lambda (ac)
=======================================
--- /trunk/scm/anthy-custom.scm Thu Mar 26 20:54:02 2009
+++ /trunk/scm/anthy-custom.scm Wed Nov 4 08:13:55 2009
@@ -351,6 +351,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'anthy-auto-start-henkan? #f
+ '(anthy-advanced special-op)
+ '(boolean)
+ (N_ "Enable auto conversion with punctuation marks")
+ (N_ "long description will be here."))
+
(define-custom 'anthy-use-mode-transition-keys-in-off-mode? #f
'(anthy-advanced mode-transition)
'(boolean)
=======================================
--- /trunk/scm/anthy-utf8-custom.scm Thu Mar 26 20:54:02 2009
+++ /trunk/scm/anthy-utf8-custom.scm Wed Nov 4 08:13:55 2009
@@ -358,6 +358,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'anthy-auto-start-henkan? #f
+ '(anthy-advanced special-op)
+ '(boolean)
+ (N_ "Enable auto conversion with punctuation marks")
+ (N_ "long description will be here."))
+
(define-custom 'anthy-use-mode-transition-keys-in-off-mode? #f
'(anthy-advanced mode-transition)
'(boolean)
=======================================
--- /trunk/scm/anthy-utf8.scm Tue Mar 3 07:42:54 2009
+++ /trunk/scm/anthy-utf8.scm Wed Nov 4 08:13:55 2009
@@ -1044,6 +1044,14 @@
(define anthy-utf8-proc-input-state-with-preedit
(lambda (ac key key-state)
+ (define (check-auto-conv str)
+ (and
+ str
+ anthy-auto-start-henkan?
+ (string-find japanese-auto-start-henkan-keyword-list str)
+ (begin
+ (anthy-utf8-reset-prediction-window ac)
+ (anthy-utf8-begin-conv ac))))
(let ((preconv-str (anthy-utf8-context-preconv-ustr ac))
(raw-str (anthy-utf8-context-raw-ustr ac))
(rkc (anthy-utf8-context-rkc ac))
@@ -1264,7 +1272,8 @@
(list key-str key-str key-str)
(list (ja-wide key-str) (ja-wide key-str)
(ja-wide key-str))))
- (ustr-insert-elem! raw-str key-str))
+ (ustr-insert-elem! raw-str key-str)
+ (check-auto-conv key-str))
(let* ((key-str (if (= rule anthy-input-rule-kana)
(if (symbol? key)
(symbol->string key)
@@ -1302,7 +1311,8 @@
(intern-key-symbol key-str)
(symbol-bound? (string->symbol key-str)))
(symbol-value (string->symbol key-str))
- key-str))))))))))))))
+ key-str)))))))
+ (check-auto-conv (if res (car res) #f)))))))))
(define anthy-utf8-context-confirm-kana!
(lambda (ac)
=======================================
--- /trunk/scm/anthy.scm Tue Mar 3 07:42:54 2009
+++ /trunk/scm/anthy.scm Wed Nov 4 08:13:55 2009
@@ -1039,6 +1039,14 @@
(define anthy-proc-input-state-with-preedit
(lambda (ac key key-state)
+ (define (check-auto-conv str)
+ (and
+ str
+ anthy-auto-start-henkan?
+ (string-find japanese-auto-start-henkan-keyword-list str)
+ (begin
+ (anthy-reset-prediction-window ac)
+ (anthy-begin-conv ac))))
(let ((preconv-str (anthy-context-preconv-ustr ac))
(raw-str (anthy-context-raw-ustr ac))
(rkc (anthy-context-rkc ac))
@@ -1259,7 +1267,8 @@
(list key-str key-str key-str)
(list (ja-wide key-str) (ja-wide key-str)
(ja-wide key-str))))
- (ustr-insert-elem! raw-str key-str))
+ (ustr-insert-elem! raw-str key-str)
+ (check-auto-conv key-str))
(let* ((key-str (if (= rule anthy-input-rule-kana)
(if (symbol? key)
(symbol->string key)
@@ -1297,7 +1306,8 @@
(intern-key-symbol key-str)
(symbol-bound? (string->symbol key-str)))
(symbol-value (string->symbol key-str))
- key-str))))))))))))))
+ key-str))))))))
+ (check-auto-conv (if res (car res) #f))))))))
(define anthy-context-confirm-kana!
(lambda (ac)
=======================================
--- /trunk/scm/canna-custom.scm Mon Aug 17 04:25:12 2009
+++ /trunk/scm/canna-custom.scm Wed Nov 4 08:13:55 2009
@@ -380,6 +380,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'canna-auto-start-henkan? #f
+ '(canna-advanced special-op)
+ '(boolean)
+ (N_ "Enable auto conversion with punctuation marks")
+ (N_ "long description will be here."))
+
(define-custom 'canna-use-mode-transition-keys-in-off-mode? #f
'(canna-advanced mode-transition)
'(boolean)
=======================================
--- /trunk/scm/canna.scm Mon Aug 17 04:25:12 2009
+++ /trunk/scm/canna.scm Wed Nov 4 08:13:55 2009
@@ -935,6 +935,14 @@
(canna-proc-input-state cc key key-state))))))
(define (canna-proc-input-state-with-preedit cc key key-state)
+ (define (check-auto-conv str)
+ (and
+ str
+ canna-auto-start-henkan?
+ (string-find japanese-auto-start-henkan-keyword-list str)
+ (begin
+ (canna-reset-prediction-window cc)
+ (canna-begin-conv cc))))
(let ((preconv-str (canna-context-preconv-ustr cc))
(raw-str (canna-context-raw-ustr cc))
(rkc (canna-context-rkc cc))
@@ -1131,7 +1139,8 @@
(list key-str key-str key-str)
(list (ja-wide key-str) (ja-wide key-str)
(ja-wide key-str))))
- (ustr-insert-elem! raw-str key-str))
+ (ustr-insert-elem! raw-str key-str)
+ (check-auto-conv key-str))
(let* ((key-str (charcode->string
(if (= rule canna-input-rule-kana)
key
@@ -1154,7 +1163,8 @@
(ustr-insert-elem! raw-str key-str))
(ustr-insert-elem!
raw-str
- (string-append pend key-str))))))))))))
+ (string-append pend key-str))))))
+ (check-auto-conv (if res (car res) #f))))))))
(define canna-context-confirm-kana!
(lambda (cc)
=======================================
--- /trunk/scm/japanese.scm Tue Jan 20 18:11:15 2009
+++ /trunk/scm/japanese.scm Wed Nov 4 08:13:55 2009
@@ -915,5 +915,8 @@
(set-symbol-value! 'yen "\\")
))
+;; TODO: Support new custom type string-list.
+(define
japanese-auto-start-henkan-keyword-list '("¡¢" "¡£" "¡¥" "¡¤" "¡©" "¡×" "¡ª" "¡¨" "¡§" ")" ";" ":" "¡Ë" "¡É" "¡Û" "¡Ù" "¡Õ" "¡Ó" "¡Ñ" "¡Ï" "¡Í" "}" "]" "?" "." "," "!"))
+
;;
(require "rk.scm")
=======================================
--- /trunk/scm/mana-custom.scm Tue Jan 20 18:11:15 2009
+++ /trunk/scm/mana-custom.scm Wed Nov 4 08:13:55 2009
@@ -297,6 +297,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'mana-auto-start-henkan? #f
+ '(mana-advanced special-op)
+ '(boolean)
+ (N_ "Enable auto conversion with punctuation marks")
+ (N_ "long description will be here."))
+
(define-custom 'mana-use-mode-transition-keys-in-off-mode? #f
'(mana-advanced mode-transition)
'(boolean)
=======================================
--- /trunk/scm/mana.scm Tue Jan 20 18:11:15 2009
+++ /trunk/scm/mana.scm Wed Nov 4 08:13:55 2009
@@ -994,6 +994,12 @@
(define mana-proc-input-state-with-preedit
(lambda (mc key key-state)
+ (define (check-auto-conv str)
+ (and
+ str
+ mana-auto-start-henkan?
+ (string-find japanese-auto-start-henkan-keyword-list str)
+ (mana-begin-conv mc)))
(let ((preconv-str (mana-context-preconv-ustr mc))
(raw-str (mana-context-raw-ustr mc))
(rkc (mana-context-rkc mc))
@@ -1197,7 +1203,8 @@
(list key-str key-str key-str)
(list (ja-wide key-str) (ja-wide key-str)
(ja-wide key-str))))
- (ustr-insert-elem! raw-str key-str))
+ (ustr-insert-elem! raw-str key-str)
+ (check-auto-conv key-str))
(let* ((key-str (charcode->string
(if (= rule mana-input-rule-kana)
key
@@ -1220,7 +1227,8 @@
(ustr-insert-elem! raw-str key-str))
(ustr-insert-elem!
raw-str
- (string-append pend key-str)))))))))))))
+ (string-append pend key-str))))))
+ (check-auto-conv (if res (car res) #f)))))))))
(define mana-context-confirm-kana!
(lambda (mc)
=======================================
--- /trunk/scm/sj3-custom.scm Mon Aug 17 04:25:12 2009
+++ /trunk/scm/sj3-custom.scm Wed Nov 4 08:13:55 2009
@@ -335,6 +335,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'sj3-auto-start-henkan? #f
+ '(sj3-advanced special-op)
+ '(boolean)
+ (N_ "Enable auto conversion with punctuation marks")
+ (N_ "long description will be here."))
+
(define-custom 'sj3-use-mode-transition-keys-in-off-mode? #f
'(sj3-advanced mode-transition)
'(boolean)
=======================================
--- /trunk/scm/sj3.scm Mon Aug 17 04:25:12 2009
+++ /trunk/scm/sj3.scm Wed Nov 4 08:13:55 2009
@@ -1206,7 +1206,15 @@
(sj3-context-set-prediction-index! sc #f)
(sj3-proc-input-state sc key key-state))))))
-(define (sj3-proc-input-state-with-preedit sc key key-state)
+(define (sj3-proc-input-state-with-preedit sc key key-state)
+ (define (check-auto-conv str)
+ (and
+ str
+ sj3-auto-start-henkan?
+ (string-find japanese-auto-start-henkan-keyword-list str)
+ (begin
+ (sj3-reset-prediction-window sc)
+ (sj3-begin-conv sc))))
(let ((preconv-str (sj3-context-preconv-ustr sc))
(raw-str (sj3-context-raw-ustr sc))
(rkc (sj3-context-rkc sc))
@@ -1403,7 +1411,8 @@
(list key-str key-str key-str)
(list (ja-wide key-str) (ja-wide key-str)
(ja-wide key-str))))
- (ustr-insert-elem! raw-str key-str))
+ (ustr-insert-elem! raw-str key-str)
+ (check-auto-conv key-str))
(let* ((key-str (charcode->string
(if (= rule sj3-input-rule-kana)
key
@@ -1426,7 +1435,8 @@
(ustr-insert-elem! raw-str key-str))
(ustr-insert-elem!
raw-str
- (string-append pend key-str))))))))))))
+ (string-append pend key-str))))))
+ (check-auto-conv (if res (car res) #f))))))))
(define sj3-context-confirm-kana!
(lambda (sc)
=======================================
--- /trunk/scm/social-ime-custom.scm Mon Apr 6 21:48:24 2009
+++ /trunk/scm/social-ime-custom.scm Wed Nov 4 08:13:55 2009
@@ -334,6 +334,12 @@
(N_ "Enable vi-cooperative mode")
(N_ "long description will be here."))
+(define-custom 'social-ime-auto-start-henkan? #f
+ '(social-ime-advanced special-op)
+ '(boolean)
+ (N_ "Enable auto conversion with punctuation marks")
+ (N_ "long description will be here."))
+
(define-custom 'social-ime-use-mode-transition-keys-in-off-mode? #f
'(social-ime-advanced mode-transition)
'(boolean)
=======================================
--- /trunk/scm/social-ime.scm Tue Apr 21 04:06:13 2009
+++ /trunk/scm/social-ime.scm Wed Nov 4 08:13:55 2009
@@ -1097,6 +1097,14 @@
(social-ime-proc-input-state sc key key-state))))))
(define (social-ime-proc-input-state-with-preedit sc key key-state)
+ (define (check-auto-conv str)
+ (and
+ str
+ social-ime-auto-start-henkan?
+ (string-find japanese-auto-start-henkan-keyword-list str)
+ (begin
+ (social-ime-reset-prediction-window sc)
+ (social-ime-begin-conv sc))))
(let ((preconv-str (social-ime-context-preconv-ustr sc))
(raw-str (social-ime-context-raw-ustr sc))
(rkc (social-ime-context-rkc sc))
@@ -1293,7 +1301,8 @@
(list key-str key-str key-str)
(list (ja-wide key-str) (ja-wide key-str)
(ja-wide key-str))))
- (ustr-insert-elem! raw-str key-str))
+ (ustr-insert-elem! raw-str key-str)
+ (check-auto-conv key-str))
(let* ((key-str (charcode->string
(if (= rule social-ime-input-rule-kana)
key
@@ -1316,7 +1325,8 @@
(ustr-insert-elem! raw-str key-str))
(ustr-insert-elem!
raw-str
- (string-append pend key-str))))))))))))
+ (string-append pend key-str))))))
+ (check-auto-conv (if res (car res) #f))))))))
(define social-ime-context-confirm-kana!
(lambda (sc)