A multilingual input method framework
Revision | d069d2724f3873858d504f67f5f9f4aa7d99bb43 (tree) |
---|---|
Time | 2012-12-24 19:51:31 |
Author | KIHARA Hideto <deton@m1.i...> |
Commiter | KIHARA Hideto |
Add key customs for postfix katakana conversion with exclude or shrink.
* scm/tutcode-key-custom.scm
* scm/tutcode.scm
@@ -435,6 +435,12 @@ | ||
435 | 435 | (N_ "[TUT-Code] postfix katakana conversion") |
436 | 436 | (N_ "long description will be here")) |
437 | 437 | |
438 | +(define-custom 'tutcode-postfix-katakana-0-start-sequence "" | |
439 | + '(tutcode-keys3) | |
440 | + '(string ".*") | |
441 | + (N_ "[TUT-Code] postfix katakana conversion while hiragana continues") | |
442 | + (N_ "long description will be here")) | |
443 | + | |
438 | 444 | (define-custom 'tutcode-postfix-katakana-1-start-sequence "" |
439 | 445 | '(tutcode-keys3) |
440 | 446 | '(string ".*") |
@@ -489,6 +495,78 @@ | ||
489 | 495 | (N_ "[TUT-Code] postfix katakana conversion of 9 characters") |
490 | 496 | (N_ "long description will be here")) |
491 | 497 | |
498 | +(define-custom 'tutcode-postfix-katakana-exclude-1-sequence "" | |
499 | + '(tutcode-keys3) | |
500 | + '(string ".*") | |
501 | + (N_ "[TUT-Code] postfix katakana conversion excluding 1 character") | |
502 | + (N_ "long description will be here")) | |
503 | + | |
504 | +(define-custom 'tutcode-postfix-katakana-exclude-2-sequence "" | |
505 | + '(tutcode-keys3) | |
506 | + '(string ".*") | |
507 | + (N_ "[TUT-Code] postfix katakana conversion excluding 2 characters") | |
508 | + (N_ "long description will be here")) | |
509 | + | |
510 | +(define-custom 'tutcode-postfix-katakana-exclude-3-sequence "" | |
511 | + '(tutcode-keys3) | |
512 | + '(string ".*") | |
513 | + (N_ "[TUT-Code] postfix katakana conversion excluding 3 characters") | |
514 | + (N_ "long description will be here")) | |
515 | + | |
516 | +(define-custom 'tutcode-postfix-katakana-exclude-4-sequence "" | |
517 | + '(tutcode-keys3) | |
518 | + '(string ".*") | |
519 | + (N_ "[TUT-Code] postfix katakana conversion excluding 4 characters") | |
520 | + (N_ "long description will be here")) | |
521 | + | |
522 | +(define-custom 'tutcode-postfix-katakana-exclude-5-sequence "" | |
523 | + '(tutcode-keys3) | |
524 | + '(string ".*") | |
525 | + (N_ "[TUT-Code] postfix katakana conversion excluding 5 characters") | |
526 | + (N_ "long description will be here")) | |
527 | + | |
528 | +(define-custom 'tutcode-postfix-katakana-exclude-6-sequence "" | |
529 | + '(tutcode-keys3) | |
530 | + '(string ".*") | |
531 | + (N_ "[TUT-Code] postfix katakana conversion excluding 6 characters") | |
532 | + (N_ "long description will be here")) | |
533 | + | |
534 | +(define-custom 'tutcode-postfix-katakana-shrink-1-sequence "" | |
535 | + '(tutcode-keys3) | |
536 | + '(string ".*") | |
537 | + (N_ "[TUT-Code] postfix katakana conversion shrink 1 character") | |
538 | + (N_ "shrink last postfix katakana conversion by 1 character")) | |
539 | + | |
540 | +(define-custom 'tutcode-postfix-katakana-shrink-2-sequence "" | |
541 | + '(tutcode-keys3) | |
542 | + '(string ".*") | |
543 | + (N_ "[TUT-Code] postfix katakana conversion shrink 2 characters") | |
544 | + (N_ "shrink last postfix katakana conversion by 2 characters")) | |
545 | + | |
546 | +(define-custom 'tutcode-postfix-katakana-shrink-3-sequence "" | |
547 | + '(tutcode-keys3) | |
548 | + '(string ".*") | |
549 | + (N_ "[TUT-Code] postfix katakana conversion shrink 3 characters") | |
550 | + (N_ "shrink last postfix katakana conversion by 3 characters")) | |
551 | + | |
552 | +(define-custom 'tutcode-postfix-katakana-shrink-4-sequence "" | |
553 | + '(tutcode-keys3) | |
554 | + '(string ".*") | |
555 | + (N_ "[TUT-Code] postfix katakana conversion shrink 4 characters") | |
556 | + (N_ "shrink last postfix katakana conversion by 4 characters")) | |
557 | + | |
558 | +(define-custom 'tutcode-postfix-katakana-shrink-5-sequence "" | |
559 | + '(tutcode-keys3) | |
560 | + '(string ".*") | |
561 | + (N_ "[TUT-Code] postfix katakana conversion shrink 5 characters") | |
562 | + (N_ "shrink last postfix katakana conversion by 5 characters")) | |
563 | + | |
564 | +(define-custom 'tutcode-postfix-katakana-shrink-6-sequence "" | |
565 | + '(tutcode-keys3) | |
566 | + '(string ".*") | |
567 | + (N_ "[TUT-Code] postfix katakana conversion shrink 6 characters") | |
568 | + (N_ "shrink last postfix katakana conversion by 6 characters")) | |
569 | + | |
492 | 570 | (define-custom 'tutcode-postfix-kanji2seq-start-sequence "" |
493 | 571 | '(tutcode-keys3) |
494 | 572 | '(string ".*") |
@@ -127,10 +127,28 @@ | ||
127 | 127 | ;;; 活用する語に関しては、読みは指定された文字数で固定して語幹のみ伸縮。 |
128 | 128 | ;;; 例(「あおい」に対して3文字指定):「あおい―」>「あお―」>「あ―」 |
129 | 129 | ;;; * 後置型カタカナ変換は、以下の開始キーを設定すると使用可能になります。 |
130 | -;;; tutcode-postfix-katakana-start-sequence | |
131 | -;;; 読み1文字 tutcode-postfix-katakana-1-start-sequence | |
130 | +;;; 対象伸縮モード tutcode-postfix-katakana-start-sequence | |
131 | +;;; カタカナ変換対象の文字列を選択するモードを開始(後置型交ぜ書き変換同様)。 | |
132 | +;;; ひらがなが続く間 tutcode-postfix-katakana-0-start-sequence | |
133 | +;;; ひらがなや「ー」が続く間対象文字列として、カタカナに置換。 | |
134 | +;;; 対象1文字 tutcode-postfix-katakana-1-start-sequence | |
132 | 135 | ;;; ... |
133 | -;;; 読み9文字 tutcode-postfix-katakana-9-start-sequence | |
136 | +;;; 対象9文字 tutcode-postfix-katakana-9-start-sequence | |
137 | +;;; 指定文字数をカタカナに置換。 | |
138 | +;;; 1文字除いて置換 tutcode-postfix-katakana-exclude-1-sequence | |
139 | +;;; ... | |
140 | +;;; 6文字除いて置換 tutcode-postfix-katakana-exclude-6-sequence | |
141 | +;;; 指定文字数をひらがなとして残してカタカナに置換。 | |
142 | +;;; (カタカナに変換する文字列が長くて文字数を数えるのが面倒な場合向け) | |
143 | +;;; 例:「例えばあぷりけーしょん」2文字除いて置換→「例えばアプリケーション」 | |
144 | +;;; 1文字縮める tutcode-postfix-katakana-shrink-1-sequence | |
145 | +;;; ... | |
146 | +;;; 6文字縮める tutcode-postfix-katakana-shrink-6-sequence | |
147 | +;;; 直前の後置型カタカナ変換を指定文字数縮めます。繰り返し実行可能。 | |
148 | +;;; 例:「例えばあぷりけーしょん」ひらがなが続く間置換 | |
149 | +;;; →「例エバアプリケーション」1文字縮める | |
150 | +;;; →「例えバアプリケーション」1文字縮める | |
151 | +;;; →「例えばアプリケーション」 | |
134 | 152 | ;;; * 後置型漢字→入力シーケンス変換 |
135 | 153 | ;;; TUT-Codeオン・オフのモード切り替えなしで英単語を入力して、 |
136 | 154 | ;;; 後から英字化するための機能です。 |
@@ -2264,6 +2282,7 @@ | ||
2264 | 2282 | ((tutcode-postfix-mazegaki-inflection-9-start) "―9") |
2265 | 2283 | ((tutcode-selection-katakana-start) "カs") |
2266 | 2284 | ((tutcode-postfix-katakana-start) "カ") |
2285 | + ((tutcode-postfix-katakana-0-start) "カ0") | |
2267 | 2286 | ((tutcode-postfix-katakana-1-start) "カ1") |
2268 | 2287 | ((tutcode-postfix-katakana-2-start) "カ2") |
2269 | 2288 | ((tutcode-postfix-katakana-3-start) "カ3") |
@@ -2273,6 +2292,18 @@ | ||
2273 | 2292 | ((tutcode-postfix-katakana-7-start) "カ7") |
2274 | 2293 | ((tutcode-postfix-katakana-8-start) "カ8") |
2275 | 2294 | ((tutcode-postfix-katakana-9-start) "カ9") |
2295 | + ((tutcode-postfix-katakana-exclude-1) "ヵ1") | |
2296 | + ((tutcode-postfix-katakana-exclude-2) "ヵ2") | |
2297 | + ((tutcode-postfix-katakana-exclude-3) "ヵ3") | |
2298 | + ((tutcode-postfix-katakana-exclude-4) "ヵ4") | |
2299 | + ((tutcode-postfix-katakana-exclude-5) "ヵ5") | |
2300 | + ((tutcode-postfix-katakana-exclude-6) "ヵ6") | |
2301 | + ((tutcode-postfix-katakana-shrink-1) "か1") | |
2302 | + ((tutcode-postfix-katakana-shrink-2) "か2") | |
2303 | + ((tutcode-postfix-katakana-shrink-3) "か3") | |
2304 | + ((tutcode-postfix-katakana-shrink-4) "か4") | |
2305 | + ((tutcode-postfix-katakana-shrink-5) "か5") | |
2306 | + ((tutcode-postfix-katakana-shrink-6) "か6") | |
2276 | 2307 | ((tutcode-selection-kanji2seq-start) "/s") |
2277 | 2308 | ((tutcode-postfix-kanji2seq-start) "/@") |
2278 | 2309 | ((tutcode-postfix-kanji2seq-1-start) "/1") |
@@ -3375,6 +3406,8 @@ | ||
3375 | 3406 | (tutcode-begin-postfix-mazegaki-inflection-conversion pc 9)) |
3376 | 3407 | ((tutcode-postfix-katakana-start) |
3377 | 3408 | (tutcode-begin-postfix-katakana-conversion pc #f)) |
3409 | + ((tutcode-postfix-katakana-0-start) | |
3410 | + (tutcode-begin-postfix-katakana-conversion pc 0)) | |
3378 | 3411 | ((tutcode-postfix-katakana-1-start) |
3379 | 3412 | (tutcode-begin-postfix-katakana-conversion pc 1)) |
3380 | 3413 | ((tutcode-postfix-katakana-2-start) |
@@ -3393,6 +3426,30 @@ | ||
3393 | 3426 | (tutcode-begin-postfix-katakana-conversion pc 8)) |
3394 | 3427 | ((tutcode-postfix-katakana-9-start) |
3395 | 3428 | (tutcode-begin-postfix-katakana-conversion pc 9)) |
3429 | + ((tutcode-postfix-katakana-exclude-1) | |
3430 | + (tutcode-begin-postfix-katakana-conversion pc -1)) | |
3431 | + ((tutcode-postfix-katakana-exclude-2) | |
3432 | + (tutcode-begin-postfix-katakana-conversion pc -2)) | |
3433 | + ((tutcode-postfix-katakana-exclude-3) | |
3434 | + (tutcode-begin-postfix-katakana-conversion pc -3)) | |
3435 | + ((tutcode-postfix-katakana-exclude-4) | |
3436 | + (tutcode-begin-postfix-katakana-conversion pc -4)) | |
3437 | + ((tutcode-postfix-katakana-exclude-5) | |
3438 | + (tutcode-begin-postfix-katakana-conversion pc -5)) | |
3439 | + ((tutcode-postfix-katakana-exclude-6) | |
3440 | + (tutcode-begin-postfix-katakana-conversion pc -6)) | |
3441 | + ((tutcode-postfix-katakana-shrink-1) | |
3442 | + (tutcode-postfix-katakana-shrink pc 1)) | |
3443 | + ((tutcode-postfix-katakana-shrink-2) | |
3444 | + (tutcode-postfix-katakana-shrink pc 2)) | |
3445 | + ((tutcode-postfix-katakana-shrink-3) | |
3446 | + (tutcode-postfix-katakana-shrink pc 3)) | |
3447 | + ((tutcode-postfix-katakana-shrink-4) | |
3448 | + (tutcode-postfix-katakana-shrink pc 4)) | |
3449 | + ((tutcode-postfix-katakana-shrink-5) | |
3450 | + (tutcode-postfix-katakana-shrink pc 5)) | |
3451 | + ((tutcode-postfix-katakana-shrink-6) | |
3452 | + (tutcode-postfix-katakana-shrink pc 6)) | |
3396 | 3453 | ((tutcode-postfix-kanji2seq-start) |
3397 | 3454 | (tutcode-begin-postfix-kanji2seq-conversion pc #f)) |
3398 | 3455 | ((tutcode-postfix-kanji2seq-1-start) |
@@ -3961,14 +4018,6 @@ | ||
3961 | 4018 | ;;; 負の値: 絶対値の文字数をひらがなとして残してカタカナ変換。 |
3962 | 4019 | ;;; (カタカナに変換する文字列が長くて文字数を数えるのが面倒な場合向け) |
3963 | 4020 | ;;; 「例えばあぷりけーしょん」alw→「例えばアプリケーション」 |
3964 | -;;; ~/.uimでの設定例: | |
3965 | -;;; (tutcode-rule-set-sequences! | |
3966 | -;;; `(((("a" "l" "l")) | |
3967 | -;;; (,(lambda (state pc) | |
3968 | -;;; (tutcode-begin-postfix-katakana-conversion pc 0)))) | |
3969 | -;;; ((("a" "l" "q")) | |
3970 | -;;; (,(lambda (state pc) | |
3971 | -;;; (tutcode-begin-postfix-katakana-conversion pc -1)))))) | |
3972 | 4021 | (define (tutcode-begin-postfix-katakana-conversion pc yomi-len) |
3973 | 4022 | (let* |
3974 | 4023 | ((former-all (tutcode-postfix-katakana-acquire-yomi pc |
@@ -6657,6 +6706,8 @@ | ||
6657 | 6706 | '(tutcode-postfix-mazegaki-inflection-9-start)) |
6658 | 6707 | (make-subrule tutcode-postfix-katakana-start-sequence |
6659 | 6708 | '(tutcode-postfix-katakana-start)) |
6709 | + (make-subrule tutcode-postfix-katakana-0-start-sequence | |
6710 | + '(tutcode-postfix-katakana-0-start)) | |
6660 | 6711 | (make-subrule tutcode-postfix-katakana-1-start-sequence |
6661 | 6712 | '(tutcode-postfix-katakana-1-start)) |
6662 | 6713 | (make-subrule tutcode-postfix-katakana-2-start-sequence |
@@ -6675,6 +6726,30 @@ | ||
6675 | 6726 | '(tutcode-postfix-katakana-8-start)) |
6676 | 6727 | (make-subrule tutcode-postfix-katakana-9-start-sequence |
6677 | 6728 | '(tutcode-postfix-katakana-9-start)) |
6729 | + (make-subrule tutcode-postfix-katakana-exclude-1-sequence | |
6730 | + '(tutcode-postfix-katakana-exclude-1)) | |
6731 | + (make-subrule tutcode-postfix-katakana-exclude-2-sequence | |
6732 | + '(tutcode-postfix-katakana-exclude-2)) | |
6733 | + (make-subrule tutcode-postfix-katakana-exclude-3-sequence | |
6734 | + '(tutcode-postfix-katakana-exclude-3)) | |
6735 | + (make-subrule tutcode-postfix-katakana-exclude-4-sequence | |
6736 | + '(tutcode-postfix-katakana-exclude-4)) | |
6737 | + (make-subrule tutcode-postfix-katakana-exclude-5-sequence | |
6738 | + '(tutcode-postfix-katakana-exclude-5)) | |
6739 | + (make-subrule tutcode-postfix-katakana-exclude-6-sequence | |
6740 | + '(tutcode-postfix-katakana-exclude-6)) | |
6741 | + (make-subrule tutcode-postfix-katakana-shrink-1-sequence | |
6742 | + '(tutcode-postfix-katakana-shrink-1)) | |
6743 | + (make-subrule tutcode-postfix-katakana-shrink-2-sequence | |
6744 | + '(tutcode-postfix-katakana-shrink-2)) | |
6745 | + (make-subrule tutcode-postfix-katakana-shrink-3-sequence | |
6746 | + '(tutcode-postfix-katakana-shrink-3)) | |
6747 | + (make-subrule tutcode-postfix-katakana-shrink-4-sequence | |
6748 | + '(tutcode-postfix-katakana-shrink-4)) | |
6749 | + (make-subrule tutcode-postfix-katakana-shrink-5-sequence | |
6750 | + '(tutcode-postfix-katakana-shrink-5)) | |
6751 | + (make-subrule tutcode-postfix-katakana-shrink-6-sequence | |
6752 | + '(tutcode-postfix-katakana-shrink-6)) | |
6678 | 6753 | (make-subrule tutcode-postfix-kanji2seq-start-sequence |
6679 | 6754 | '(tutcode-postfix-kanji2seq-start)) |
6680 | 6755 | (make-subrule tutcode-postfix-kanji2seq-1-start-sequence |