Skip to content

Instantly share code, notes, and snippets.

@fillmember
Created March 19, 2017 20:41
Show Gist options
  • Save fillmember/e5192088e33b660ab2707013b86cf09c to your computer and use it in GitHub Desktop.
Save fillmember/e5192088e33b660ab2707013b86cf09c to your computer and use it in GitHub Desktop.
我的RIME注音許氏方案
# Rime schema
# encoding: utf-8
schema:
schema_id: bopomofo_hsuq
name: 注音・許式Q 0.4
version: "0.4"
author:
- 佛振 <chen.sst@gmail.com>
- Patrick <ipatrickmac@gmail.com>
description: |
注音符號輸入,採用「許式」鍵盤排列。
以qdfjs 輸入聲調「ˉˊˇˋ˙」 Enter候選字上屏
——————
(@fillmember 2017 修改)
dependencies:
- luna_pinyin
- emoji
switches:
- name: ascii_mode
states: ["中文", "英文"]
- name: full_shape
states: ["半型", "全型"]
- name: simplification
states: ["繁體", "簡體"]
engine: # 輸入引擎設定,即掛接組件的「處方」
processors: # 一、這批組件處理各類按鍵消息
- ascii_composer # ※ 處理西文模式及中西文切換
- recognizer # ※ 與 matcher 搭配,處理符合特定規則的輸入碼,如網址、反查等
- key_binder # ※ 在特定條件下將按鍵綁定到其他按鍵,如重定義逗號、句號爲候選翻頁鍵
- speller # ※ 拼寫處理器,接受字符按鍵,編輯輸入碼
- punctuator # ※ 句讀處理器,將單個字符按鍵直接映射爲文字符號
- selector # ※ 選字處理器,處理數字選字鍵、上、下候選定位、換頁鍵
- navigator # ※ 處理輸入欄內的光標移動鍵
- fluency_editor # ※ 句式編輯器,用於以空格斷詞、回車上屏的【注音】、【語句流】等輸入方案,替換 express_editor,也可以寫作 fluency_editor
segmentors: # 二、這批組件識別不同內容類型,將輸入碼分段
- ascii_segmentor # ※ 標識西文段落
- matcher # ※ 標識符合特定規則的段落,如網址、反查等
- abc_segmentor # ※ 標識常規的文字段落
- punct_segmentor # ※ 標識句讀段落
- fallback_segmentor # ※ 標識其他未標識段落
translators: # 三、這批組件翻譯特定類型的編碼段爲一組候選文字
- echo_translator # ※ 沒有其他候選字時,回顯輸入碼
- punct_translator # ※ 轉換標點符號
- r10n_translator
- reverse_lookup_translator # ※ 反查翻譯器,用另一種編碼方案查碼
filters: # 四、這批組件過濾翻譯的結果
- simplifier # ※ 繁簡轉換
- uniquifier # ※ 過濾重複的候選字,有可能來自繁簡轉換
speller:
alphabet: 'zyxwvutsrqponmlkjihgfedcba'
initials: 'zyxwvutsrqponmlkjihgfedcba'
finals: "q"
delimiter: "'"
#use_space: true
algebra:
- erase/^xx$/
- xform/^m(\d)$/mu$1/
- 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/
- abbrev/^([bpmfdtnlgkhjqxZCSrzcs]).+$/$1/
- derive/^([A-Za-z]+)\d$/$1/
- abbrev/^([bpmfdtnlgkhjqxZCSrzcs]).+(\d)$/$1$2/
- 'xlit|bpmfdtnlgkhjqxZCSrzcsiuvaoeEAIOUMNKGR12345|bpmfdtnlgkhjvcjvcrzasexuyhgeiawomnkllqdfjs|'
translator:
dictionary: terra_pinyin
prism: bopomofo_hsuq
# spelling_hints: 2
preedit_format:
- xform/b/ㄅ/
- xform/p/ㄆ/
- xform/m([yhgexuiawomnkl])/ㄇ$1/
- xform/(^|[ '])f/ㄈ/
- xform/(^|[ '])d/ㄉ/
- xform/t/ㄊ/
- xform/n([yhgexuiawomnkl])/ㄋ$1/
- xform/(^|[ '])l$/ㄦ/
- xform/(^|[ '])ld/ㄦˊ/
- xform/(^|[ '])lf/ㄦˇ/
- xform/(^|[ '])lj/ㄦˋ/
- xform/(^|[ '])ls/ㄥ˙/
- xform/(^|[ '])l/ㄌ/
- xform/h([yhgexuiawomnkl])/ㄏ$1/
- xform/k([yhgexuiawomnkl])/ㄎ$1/
- xform/g([yhgexuiawomnkl])/ㄍ$1/
- xform/z/ㄗ/
- xform/(^|[ '])a/ㄘ/
- xform/(^|[ '])s/ㄙ/
- xform/(^|[ '])j([eu])/ㄐ$2/
- xform/(^|[ '])v([eu])/ㄑ$2/
- xform/(^|[ '])c([eu])/ㄒ$2/
- xform/(^|[ '])j/ㄓ/
- xform/(^|[ '])v/ㄔ/
- xform/(^|[ '])c/ㄕ/
- xform/r/ㄖ/
- xform/y/ㄚ/
- xform/h/ㄛ/
- xform/g/ㄜ/
- xform/([eu])e/$1ㄝ/
- xform/e/ㄧ/
- xform/u/ㄩ/
- xform/x/ㄨ/
- xform/i/ㄞ/
- xform/a/ㄟ/
- xform/w/ㄠ/
- xform/o/ㄡ/
- xform/m/ㄢ/
- xform/n/ㄣ/
- xform/k/ㄤ/
- xform/l/ㄥ/
- xform/d/ˊ/
- xform/f/ˇ/
- xform/j/ˋ/
- xform/s/˙/
- xlit|q'|ˉ |
reverse_lookup:
dictionary: emoji
enable_completion: false
prefix: "`"
# suffix: "'"
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: "!"}
"\"": {pair: ["“", "”"]}
"#": {commit: "#"}
"$": ["¥", "$", "€", "£", "¥", "¢", "¤"]
"%": ["%", "%", "°", "℃"]
"&": ["&", "&"]
"'": {pair: ["‘", "’"]}
"(": "("
")": ")"
"*": ["*", "*", "・", "×", "※", "❂", "·"]
"+": ["+", "+"]
.: {commit: "。"}
":": {commit: ":"}
";": {commit: ";"}
"=": ["=", "="]
"?": {commit: "?"}
"@": {commit: "@"}
"[": ["「", "【", "《", "〔", "["]
"\\": {commit: "、"}
"]": ["」", "】", "》", "〕", "]"]
"^": {commit: "……"}
_: ["——", "-", "-"]
"`": {commit: "`"}
"{": ["『", "〖", "〈", "{"]
"|": {commit: "・"}
"}": ["』", "〗", "〉", "}"]
"~": {commit: "〜"}
half_shape:
"!": {commit: "!"}
"\"": {pair: ["“", "”"]}
"#": {commit: "#"}
"$": ["¥", "$", "€", "£", "¥", "¢", "¤"]
"%": ["%", "%", "°", "℃"]
"&": "&"
"'": {pair: ["‘", "’"]}
"(": "("
")": ")"
"*": ["*", "*", "・", "×", "※", "❂", "·"]
"+": "+"
",": {commit: ","}
.: {commit: "。"}
":": {commit: ":"}
";": {commit: ";"}
"=": "="
"?": {commit: "?"}
"@": {commit: "@"}
"[": ["「", "【", "《", "〔", "["]
"\\": {commit: "、"}
"]": ["」", "】", "》", "〕", "]"]
"^": {commit: "……"}
_: ["——", "-", "-"]
"`": {commit: "`"}
"{": ["『", "〖", "〈", "{"]
"|": {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:|file:).*$|^[a-z]+[.].+$"
reverse_lookup: "`[a-z]*'?$"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment