Skip to content

Instantly share code, notes, and snippets.

@lotem
Created October 18, 2012 17:36
Show Gist options
  • Save lotem/3913578 to your computer and use it in GitHub Desktop.
Save lotem/3913578 to your computer and use it in GitHub Desktop.
【注音】、【語句流】逗號、句號頂字上屏修改方案
# Rime schema
# encoding: utf-8
schema:
schema_id: bopomofo
name: 注音
version: "0.6.9999"
author:
- 佛振 <chen.sst@gmail.com>
description: |
注音符號輸入,採用「大千式」鍵盤排列。
本方案採用「無模式」設計,以大寫字母鍵或上下方向鍵、空格鍵選詞;在音節邊界不明確處,可加入 ' 符號,以分隔第一聲的注音與後續音節。
dependencies:
- cangjie5
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
states: [ 漢字, 汉字 ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- fluency_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- r10n_translator
- reverse_lookup_translator
filters:
- simplifier
- uniquifier
menu:
alternative_select_keys: "ABCDEFGHIJ"
speller:
alphabet: '1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/-6347'
delimiter: " '"
algebra:
- erase/^xx$/
- xform/^r5$/er5/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/^yi?/i/
- xform/^wu?/u/
- xform/iu/v/
- xform/^([jqx])u/$1v/
- xform/([iuv])n/$1en/
- xform/^zhi?/Z/
- xform/^chi?/C/
- xform/^shi?/S/
- xform/^([zcsr])i/$1/
- xform/ai/A/
- xform/ei/I/
- xform/ao/O/
- xform/ou/U/
- xform/ang/K/
- xform/eng/G/
- xform/an/M/
- xform/en/N/
- xform/er/R/
- xform/eh/E/
- xform/([iv])e/$1E/
- xform/1$//
- abbrev/^([bpmfdtnlgkhjqxZCSrzcs]).+$/$1/
- abbrev/^([A-Za-z]+)\d$/$1/
- 'xlit|bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR2345|1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/-6347|'
translator:
dictionary: terra_pinyin
prism: bopomofo
preedit_format:
- 'xlit|1qaz2wsxedcrfv5tgbyhnujm8ik,9ol.0p;/-6347|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˊˇˋ˙|'
reverse_lookup:
dictionary: cangjie5
enable_completion: true
prefix: "`"
tips: 〔倉頡〕
preedit_format:
- "xlit|abcdefghijklmnopqrstuvwxyz|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符|"
comment_format:
- xform/^r5$/er5/
- xform/^([jqx])y?u/$1v/
- xform/^y/i/
- xform/^w/u/
- xform/iu/iou/
- xform/ui/uei/
- xform/ong/ung/
- xform/([iu])n/$1en/
- xform/zh/Z/
- xform/ch/C/
- xform/sh/S/
- xform/ai/A/
- xform/ei/I/
- xform/ao/O/
- xform/ou/U/
- xform/ang/K/
- xform/eng/G/
- xform/an/M/
- xform/en/N/
- xform/er/R/
- xform/eh/E/
- xform/([iv])e/$1E/
- xform/1//
- 'xlit|bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR2345|ㄅㄆㄇㄈㄉㄊㄋㄌㄍㄎㄏㄐㄑㄒㄓㄔㄕㄖㄗㄘㄙㄧㄨㄩㄚㄛㄜㄝㄞㄟㄠㄡㄢㄣㄤㄥㄦˊˇˋ˙|'
punctuator:
full_shape:
" " : { commit: " " }
"<" : { commit: "," }
">" : { commit: "。" }
"?" : [ ?, /, "/", ÷ ]
":" : [ :, ; ]
"'" : { pair: [ "‘", "’" ] }
"\"" : { pair: [ "“", "”" ] }
"\\" : [ 、, \, "\\" ]
"|" : [ ・, |, "|", "§", "¦" ]
"`" : [ `, "`" ]
"~" : [ 〜, "~", ~, 〰 ]
"!" : { commit: ! }
"@" : [ @, "@", ☯ ]
"#" : [ #, "#", ⌘ ]
"%" : [ %, "%", "°", "℃" ]
"$" : [ ¥, "$", "€", "£", "¥", "¢", "¤" ]
"^" : { commit: …… }
"&" : [ &, "&" ]
"*" : [ *, "*", ・, ×, ※, ❂, · ]
"(" : [ (, 》, 〉 ]
")" : [ ), 《, 〈 ]
"_" : [ ——, -, "-" ]
"+" : [ +, "+" ]
"=" : [ =, "=" ]
"[" : [ 「, 【, 〔, [ ]
"]" : [ 」, 】, 〕, ] ]
"{" : [ 『, 〖, { ]
"}" : [ 』, 〗, } ]
half_shape:
"<" : { commit: "," }
">" : { commit: "。" }
"?" : [ ?, /, "/", ÷ ]
":" : [ :, ; ]
"'" : { pair: [ "‘", "’" ] }
"\"" : { pair: [ "“", "”" ] }
"\\" : [ 、, "\\", \ ]
"|" : [ ・, "|", |, "§", "¦" ]
"`" : "`"
"~" : "~"
"!" : { commit: ! }
"@" : "@"
"#" : "#"
"%" : [ "%", %, "°", "℃" ]
"$" : [ ¥, "$", "€", "£", "¥", "¢", "¤" ]
"^" : { commit: …… }
"&" : "&"
"*" : [ "*", *, ・, ×, ※, ❂, · ]
"(" : [ (, 《, 〈 ]
")" : [ ), 》, 〉 ]
"_" : [ ——, -, "-" ]
"+" : "+"
"=" : "="
"[" : [ 「, 【, 〔, [ ]
"]" : [ 」, 】, 〕, ] ]
"{" : [ 『, 〖, { ]
"}" : [ 』, 〗, } ]
key_binder:
bindings:
# Emacs style
- { when: composing, accept: Control+p, send: Up }
- { when: composing, accept: Control+n, send: Down }
- { when: composing, accept: Control+b, send: Left }
- { when: composing, accept: Control+f, send: Right }
- { when: composing, accept: Control+a, send: Home }
- { when: composing, accept: Control+e, send: End }
- { when: composing, accept: Control+d, send: Delete }
- { when: composing, accept: Control+g, send: Escape }
- { when: composing, accept: Alt+v, send: Page_Up }
- { when: composing, accept: Control+v, send: Page_Down }
# commonly used paging keys
- { when: composing, accept: ISO_Left_Tab, send: Page_Up }
- { when: composing, accept: Shift+Tab, send: Page_Up }
- { when: composing, accept: Tab, send: Page_Down }
- { when: paging, accept: minus, send: Page_Up }
- { when: has_menu, accept: equal, send: Page_Down }
recognizer:
patterns:
email: "^[a-z][-_.0-9a-z]*@.*$"
uppercase: "^[A-Z][-_+.'0-9A-Za-z]*$"
url: "^(www[.]|https?:|ftp:|mailto:).*$"
reverse_lookup: "`[a-z]*$"
# Rime schema
# encoding: utf-8
schema:
schema_id: luna_pinyin_fluency
name: 朙月拼音・語句流
version: "0.13.9999"
author:
- 佛振 <chen.sst@gmail.com>
description: |
朙月拼音・語句流錄入!
以空格分詞、標點或回車上屏。
dependencies:
- cangjie5
switches:
- name: ascii_mode
reset: 0
states: [ 中文, 西文 ]
- name: full_shape
states: [ 半角, 全角 ]
- name: simplification
states: [ 漢字, 汉字 ]
engine:
processors:
- ascii_composer
- recognizer
- key_binder
- speller
- punctuator
- selector
- navigator
- fluency_editor
segmentors:
- ascii_segmentor
- matcher
- abc_segmentor
- punct_segmentor
- fallback_segmentor
translators:
- punct_translator
- r10n_translator
- reverse_lookup_translator
filters:
- simplifier
- uniquifier
speller:
alphabet: zyxwvutsrqponmlkjihgfedcba
delimiter: " '"
algebra:
- erase/^xx$/
- abbrev/^([a-z]).+$/$1/
- abbrev/^([zcs]h).+$/$1/
- derive/^([nl])ve$/$1ue/
- derive/^([jqxy])u/$1v/
- derive/un$/uen/
- derive/ui$/uei/
- derive/iu$/iou/
- derive/([aeiou])ng$/$1gn/
- derive/([dtngkhrzcs])o(u|ng)$/$1o/
- derive/ong$/on/
- derive/ao$/oa/
- derive/([iu])a(o|ng?)$/a$1$2/
translator:
dictionary: luna_pinyin
prism: luna_pinyin_fluency
preedit_format:
- xform/([nljqxy])v/$1ü/
reverse_lookup:
dictionary: cangjie5
enable_completion: true
prefix: "`"
tips: 〔倉頡〕
preedit_format:
- "xlit|abcdefghijklmnopqrstuvwxyz|日月金木水火土竹戈十大中一弓人心手口尸廿山女田難卜符|"
comment_format:
- xform/([nl])v/$1ü/
punctuator:
import_preset: default
key_binder:
bindings:
# Emacs style
- { when: composing, accept: Control+p, send: Up }
- { when: composing, accept: Control+n, send: Down }
- { when: composing, accept: Control+b, send: Left }
- { when: composing, accept: Control+f, send: Right }
- { when: composing, accept: Control+a, send: Home }
- { when: composing, accept: Control+e, send: End }
- { when: composing, accept: Control+d, send: Delete }
- { when: composing, accept: Control+k, send: Shift+Delete }
- { when: composing, accept: Control+g, send: Escape }
- { when: composing, accept: Alt+v, send: Page_Up }
- { when: composing, accept: Control+v, send: Page_Down }
# commonly used paging keys
- { when: composing, accept: ISO_Left_Tab, send: Page_Up }
- { when: composing, accept: Shift+Tab, send: Page_Up }
- { when: composing, accept: Tab, send: Page_Down }
- { when: has_menu, accept: minus, send: Page_Up }
- { when: has_menu, accept: equal, send: Page_Down }
#- { when: paging, accept: comma, send: Page_Up }
#- { when: has_menu, accept: period, send: Page_Down }
recognizer:
import_preset: default
patterns:
number: "^[-+]?[0-9][.:0-9]*[%]?$"
reverse_lookup: "`[a-z]*$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment