原文: https://github.com/LEOYoon-Tsaw/Rime_collections/blob/master/Rime_description.md
更新时间:2022/04/26
Schema.yaml 詳解 
開始之前 
# Rime schema
# encoding: utf-8描述檔 
name:方案的顯示名偁〔即出現於方案選單中以示人的,通常爲中文〕schema_id:方案內部名,在代碼中引用此方案時以此名爲正,通常由英文、數字、下劃線組成author:發明人、撰寫者。如果您對方案做出了修改,請保留原作者名,並將自己的名字加在後面description:請簡要描述方案歷史、碼表來源、該方案規則等dependencies:如果本方案依賴於其它方案〔通常來說會依頼其它方案做爲反查,抑或是兩種或多種方案混用時〕version:版本號,在發佈新版前請確保已陞版本號
示例 
schema:
  name: "蒼頡檢字法"
  schema_id: cangjie6
  author:
    - "發明人 朱邦復先生、沈紅蓮女士"
  dependencies:
    - luna_pinyin
    - jyutping
    - zyenpheng
  description: |
    第六代倉頡輸入法
    碼表由雪齋、惜緣和crazy4u整理
  version: 0.19開關 
通常包含以下數個,但並不限於此,自定義濾鏡皆可設置開關調控
ascii_mode是中英文轉換開關。預設0爲中文,1爲英文full_shape是全角符號/半角符號開關。注意,開啓全角時英文字母亦爲全角。0爲半角,1爲全角extended_charset是字符集開關。0爲 CJK 基本字符集,1爲 CJK 全字符集- 僅
table_translator可用 
- 僅
 ascii_punct是中西文標點轉換開關,0爲中文句讀,1爲西文標點。simplification是轉化字開關。一般情況下與上同,0爲不開啓轉化,1爲轉化。- 所有關關選項名偁可自定義,可用快捷鍵切換:該名偁可用於
key_binder/bindings中的toggle:後 
yaml- name: simplification states: ["漢字", "汉字"] reset: 0- 亦可使用多選開關,同樣支持快捷鍵:
options名偁用於key_binder/bindings時,使用set_option:或unset_option:開啓或關閉某一個 
yaml- options: [ zh_trad, zh_cn, zh_mars ] states: - 字型 → 漢字 - 字型 → 汉字 - 字型 → 䕼茡 reset: 0name/options名:須與simplifier中option_name相同states:可不寫,如不寫則此開關存在但不可見,可由快捷鍵操作reset:設定默認狀態〔reset可不寫,此時切換窗口時不會重置到默認狀態〕
- 所有關關選項名偁可自定義,可用快捷鍵切換:該名偁可用於
 
示例 
switches:
  - name: ascii_mode
    reset: 0
    states: ["中文", "西文"]
  - name: full_shape
    states: ["半角", "全角"]
  - name: extended_charset
    states: ["通用", "增廣"]
  - name: simplification
    states: ["漢字", "汉字"]
  - name: ascii_punct
    states: ["句讀", "符號"]引擎 
- 以下加粗項爲可細配者,斜體者爲不常用者
 
引擎分四組:
一、processors 
- 這批組件處理各類按鍵消息
 
ascii_composer處理西文模式及中西文切recognizer與matcher搭配,處理符合特定規則的輸入碼,如網址、反查等tagskey_binder在特定條件下將按鍵綁定到其他按鍵,如重定義逗號、句號爲候選翻頁、開關快捷鍵等speller拼寫處理器,接受字符按鍵,編輯輸入punctuator句讀處理器,將單個字符按鍵直接映射爲標點符號或文字selector選字處理器,處理數字選字鍵〔可以換成別的哦〕、上、下候選定位、換頁navigator處理輸入欄內的光標移動express_editor編輯器,處理空格、回車上屏、回退鍵fluid_editor句式編輯器,用於以空格斷詞、回車上屏的【注音】、【語句流】等輸入方案,替換express_editorchord_composer和絃作曲家或曰並擊處理器,用於【宮保拼音】等多鍵並擊的輸入方案lua_processor使用lua自定義按鍵,後接@+lua函數名lua函數名即用戶文件夾內rime.lua中函數名,參數爲(key, env)
二、segmentors 
- 這批組件識別不同內容類型,將輸入碼分段並加上
tag 
ascii_segmentor標識西文段落〔譬如在西文模式下〕字母直接上屛matcher配合recognizer標識符合特定規則的段落,如網址、反查等,加上特定tagabc_segmentor標識常規的文字段落,加上abc這個tagpunct_segmentor標識句讀段落〔鍵入標點符號用〕加上punct這個tagfallback_segmentor標識其他未標識段落affix_segmentor用戶自定義tag- 此項可加載多個實例,後接
@+tag名 
- 此項可加載多個實例,後接
 lua_segmentor使用lua自定義切分,後接@+lua函數名
三、translators 
- 這批組件翻譯特定類型的編碼段爲一組候選文字
 
echo_translator沒有其他候選字時,回顯輸入碼〔輸入碼可以Shift+Enter上屛〕punct_translator配合punct_segmentor轉換標點符號table_translator碼表翻譯器,用於倉頡、五筆等基於碼表的輸入方案
- 此項可加載多個實例,後接
@+翻譯器名〔如:cangjie、wubi等〕1.script_translator腳本翻譯器,用於拼音、粵拼等基於音節表的輸入方案 - 此項可加載多個實例,後接
@+翻譯器名〔如:pinyin、jyutping等〕1.reverse_lookup_translator反查翻譯器,用另一種編碼方案查碼 
lua_translator使用lua自定義輸入,例如動態輸入當前日期、時間,後接@+lua函數名lua函數名即用戶文件夾內rime.lua中函數名,參數爲(input, seg, env)- 可以
env.engine.context:get_option("option_name")方式綁定到switch開關/key_binder快捷鍵 
四、filters 
- 這批組件過濾翻譯的結果,自定義濾鏡皆可使用開關調控
 
uniquifier過濾重複的候選字,有可能來自**simplifier**cjk_minifier字符集過濾〔僅用於script_translator,使之支援extended_charset開關〕single_char_filter單字過濾器,如加載此組件,則屛敝詞典中的詞組〔僅table_translator有效〕simplifier用字轉換reverse_lookup_filter反查濾鏡,以更靈活的方式反查,Rime1.0 後替代*reverse_lookup_translator*- 此項可加載多個實例,後接
@+濾鏡名〔如:pinyin_lookup、jyutping_lookup等〕 
- 此項可加載多個實例,後接
 lua_filter使用lua自定義過濾,例如過濾字符集、調整排序,後接@+lua函數名lua函數名即用戶文件夾內rime.lua中函數名,參數爲(input, env)- 可以
env.engine.context:get_option("option_name")方式綁定到switch開關/key_binder快捷鍵 
示例 
cangjie6.schema.yaml
engine:
  processors:
    - ascii_composer
    - recognizer
    - key_binder
    - speller
    - punctuator
    - selector
    - navigator
    - express_editor
  segmentors:
    - ascii_segmentor
    - matcher
    - affix_segmentor@pinyin
    - affix_segmentor@jyutping
    - affix_segmentor@pinyin_lookup
    - affix_segmentor@jyutping_lookup
    - affix_segmentor@reverse_lookup
    - abc_segmentor
    - punct_segmentor
    - fallback_segmentor
  translators:
    - punct_translator
    - table_translator
    - script_translator@pinyin
    - script_translator@jyutping
    - script_translator@pinyin_lookup
    - script_translator@jyutping_lookup
    - lua_translator@get_date
  filters:
    - simplifier@zh_simp
    - uniquifier
    - cjk_minifier
    - reverse_lookup_filter@middle_chinese
    - reverse_lookup_filter@pinyin_reverse_lookup
    - reverse_lookup_filter@jyutping_reverse_lookup
    - lua_filter@single_char_first細項配置 
- 凡
comment_format、preedit_format、speller/algebra所用之正則表達式,請參閱「Perl 正則表達式」 
引擎中所舉之加粗者均可在下方詳細描述,格式爲:
name:
  branches: configurations或
name:
  branches:
    - configurations一、speller 
alphabet:定義本方案輸入鍵initials:定義僅作始碼之鍵finals:定義僅作末碼之鍵delimiter:上屛時的音節間分音符algebra:拼寫運算規則,由之算出的拼寫匯入prism中max_code_length:形碼最大碼長,超過則頂字上屛〔number〕auto_select:自動上屛〔true或false〕auto_select_pattern:自動上屏規則,以正則表達式描述,當輸入串可以被匹配時自動頂字上屏。use_space:以空格作輸入碼〔true或false〕
speller的演算包含:
xform --改寫〔不保留原形〕
derive --衍生〔保留原形〕
abbrev --簡拼〔出字優先級較上兩組更低〕
fuzz --畧拼〔此種簡拼僅組詞,不出單字〕
xlit --變換〔適合大量一對一變換〕
erase --刪除示例 
luna_pinyin.schema.yaml
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/二、segmentor 
segmentor配合recognizer標記出tag。這裏會用到affix_segmentor和abc_segmentortag用在translator、reverse_lookup_filter、simplifier中用以標定各自作用範圍- 如果不需要用到
extra_tags則不需要單獨配置segmentor 
tag:設定其tagprefix:設定其前綴標識,可不塡,不塡則無前綴suffix:設定其尾綴標識,可不塡,不塡則無尾綴tips:設定其輸入前提示符,可不塡,不塡則無提示符closing_tips:設定其結束輸入提示符,可不塡,不塡則無提示符extra_tags:爲此segmentor所標記的段落插上其它tag
當affix_segmentor和translator重名時,兩者可併在一處配置,此處 1-5 條對應下面 19-23 條。abc_segmentor僅可設extra_tags#### 示例
cangjie6.schema.yaml
reverse_lookup:
  tag: reverse_lookup
  prefix: "`"
  suffix: ";"
  tips: "【反查】"
  closing_tips: "【蒼頡】"
  extra_tags:
    - pinyin_lookup
    - jyutping_lookup三、translator 
- 每個方案有一個主
translator,在引擎列表中不以@+翻譯器名定義,在細項配置時直接以translator:命名。以下加粗項爲可在主translator中定義之項,其它可在副〔以@+翻譯器名命名〕translator中定義 
enable_charset_filter:是否開啓字符集過濾〔僅table_translator有效。啓用cjk_minifier後可適用於script_translator〕enable_encoder:是否開啓自動造詞〔僅table_translator有效〕encode_commit_history:是否對已上屛詞自動成詞〔僅table_translator有效〕max_phrase_length:最大自動成詞詞長〔僅table_translator有效〕enable_completion:提前顯示尚未輸入完整碼的字〔僅table_translator有效〕sentence_over_completion:在無全碼對應字而僅有逐鍵提示時也開啓智能組句〔僅table_translator有效〕strict_spelling:配合speller中的fuzz規則,僅以畧拼碼組詞〔僅table_translator有效〕disable_user_dict_for_patterns:禁止某些編碼錄入用戶詞典enable_sentence:是否開啓自動造句enable_user_dict:是否開啓用戶詞典〔用戶詞典記錄動態字詞頻、用戶詞〕- 以上選塡
true或false 
- 以上選塡
 dictionary:翻譯器將調取此字典文件prism:設定由此主翻譯器的speller生成的棱鏡文件名,或此副編譯器調用的棱鏡名user_dict:設定用戶詞典名db_class:設定用戶詞典類型,可設tabledb〔文本〕或userdb〔二進制〕preedit_format:上屛碼自定義comment_format:提示碼自定義spelling_hints:設定多少字以內候選標註完整帶調拼音〔僅script_translator有效〕initial_quality:設定此翻譯器出字優先級tag:設定此翻譯器針對的tag。可不塡,不塡則僅針對abcprefix:設定此翻譯器的前綴標識,可不塡,不塡則無前綴suffix:設定此翻譯器的尾綴標識,可不塡,不塡則無尾綴tips:設定此翻譯器的輸入前提示符,可不塡,不塡則無提示符closing_tips:設定此翻譯器的結束輸入提示符,可不塡,不塡則無提示符contextual_suggestions:是否使用語言模型優化輸出結果〔需配合grammar使用〕max_homophones:最大同音簇長度〔需配合grammar使用〕max_homographs:最大同形簇長度〔需配合grammar使用〕
示例 
cangjie6.schema.yaml 蒼頡主翻譯器
translator:
  dictionary: cangjie6
  enable_charset_filter: true
  enable_sentence: true
  enable_encoder: true
  encode_commit_history: true
  max_phrase_length: 5
  preedit_format:
    - xform/^([a-z ])$/$1|\U$1\E/
    - xform/(?<=[a-z])\s(?=[a-z])//
    - "xlit|ABCDEFGHIJKLMNOPQRSTUVWXYZ|日月金木水火土竹戈十大中一弓人心手口尸廿山女田止卜片|"
  comment_format:
    - "xlit|abcdefghijklmnopqrstuvwxyz~|日月金木水火土竹戈十大中一弓人心手口尸廿山女田止卜片・|"
  disable_user_dict_for_patterns:
    - "^z.$"
  initial_quality: 0.75cangjie6.schema.yaml 拼音副翻譯器
pinyin:
  tag: pinyin
  dictionary: luna_pinyin
  enable_charset_filter: true
  prefix: 'P' #須配合recognizer
  suffix: ';' #須配合recognizer
  preedit_format:
    - "xform/([nl])v/$1ü/"
    - "xform/([nl])ue/$1üe/"
    - "xform/([jqxy])v/$1u/"
  tips: "【漢拼】"
  closing_tips: "【蒼頡】"pinyin_simp.schema.yaml 拼音・簡化字主翻譯器
translator:
  dictionary: luna_pinyin
  prism: luna_pinyin_simp
  preedit_format:
    - xform/([nl])v/$1ü/
    - xform/([nl])ue/$1üe/
    - xform/([jqxy])v/$1u/luna_pinyin.schema.yaml 朙月拼音用戶短語
custom_phrase: #這是一個table_translator
  dictionary: ""
  user_dict: custom_phrase
  db_class: tabledb
  enable_sentence: false
  enable_completion: false
  initial_quality: 1四、reverse_lookup_filter 
- 此濾鏡須掛在
translator上,不影響該translator工作 
tags:設定其作用範圍overwrite_comment:是否覆蓋其他提示dictionary:反查所得提示碼之碼表comment_format:自定義提示碼格式
示例 
cangjie6.schema.yaml
pinyin_reverse_lookup: #該反查濾鏡名
  tags: [ pinyin_lookup ] #掛在這個tag所對應的翻譯器上
  overwrite_comment: true
  dictionary: cangjie6 #反查所得爲蒼頡碼
  comment_format:
    - "xform/$/〕/"
    - "xform/^/〔/"
    - "xlit|abcdefghijklmnopqrstuvwxyz |日月金木水火土竹戈十大中一弓人心手口尸廿山女田止卜片、|"五、simplifier 
option_name:對應switches中設定的切換項名,暨key_binder/binding中所用名opencc_config:用字轉換配置文件位於:
rime_dir/opencc/,自帶之配置文件含:- 繁轉簡〔默認〕:
t2s.json - 繁轉臺灣:
t2tw.json - 繁轉香港:
t2hk.json - 簡轉繁:
s2t.json 
- 繁轉簡〔默認〕:
 
tags:設定轉換範圍tips:設定是否提示轉換前的字,可塡none〔或不塡〕、char〔僅對單字有效〕、allcomment_format:自定義提示碼格式allow_erase_comment:是否允許返回空提示碼〔默認false〕show_in_comment:設定是否僅將轉換結果顯示在備注中excluded_types:取消特定範圍〔一般爲reverse_lookup_translator〕轉化用字
示例 
修改自 luna_pinyin_kunki.schema
zh_tw:
  option_name: zh_tw
  opencc_config: t2tw.json
  tags: [ abc ] #abc對應abc_segmentor
  tips: none
  allow_erase_comment: true
  comment_format:
    - xform/.*//六、chord_composer 
- 並擊把鍵盤分兩半,相當於兩塊鍵盤。兩邊同時擊鍵,系統默認在其中一半上按的鍵先於另一半,由此得出上屛碼
 
alphabet:字母表,包含用於並擊的按鍵。擊鍵雖有先後,形成並擊時,一律以字母表順序排列algebra:拼寫運算規則,將一組並擊編碼轉換爲拼音音節output_format:並擊完成後套用的式樣,追加隔音符號prompt_format:並擊過程中套用的式樣,加方括弧
示例 
combo_pinyin.schema.yaml
chord_composer:
  # 字母表,包含用於並擊的按鍵
  # 擊鍵雖有先後,形成並擊時,一律以字母表順序排列
  alphabet: "swxdecfrvgtbnjum ki,lo."
  # 拼寫運算規則,將一組並擊編碼轉換爲拼音音節
  algebra:
    # 先將物理按鍵字符對應到宮保拼音鍵位中的拼音字母
    - 'xlit|swxdecfrvgtbnjum ki,lo.|sczhlfgdbktpRiuVaNIUeoE|'
    # 以下根據宮保拼音的鍵位分別變換聲母、韻母部分
    # 組合聲母
    - xform/^zf/zh/
    - xform/^cl/ch/
    - xform/^fb/m/
    - xform/^ld/n/
    - xform/^hg/r/
    ……
    # 聲母獨用時補足隠含的韻母
    - xform/^([bpf])$/$1u/
    - xform/^([mdtnlgkh])$/$1e/
    - xform/^([mdtnlgkh])$/$1e/
    - xform/^([zcsr]h?)$/$1i/
  # 並擊完成後套用的式樣,追加隔音符號
  output_format:
    - "xform/^([a-z]+)$/$1'/"
  # 並擊過程中套用的式樣,加方括弧
  prompt_format:
    - "xform/^(.*)$/[$1]/"七、lua 
- 請參攷hchunhui/librime-lua 以尋求更多靈感。
 
lua_translatorlua_filterlua_processorlua_segmentor
示例 
rime.lua
function get_date(input, seg, env)
  --- 以 show_date 爲開關名或 key_binder 中 toggle 的對象
  on = env.engine.context:get_option("show_date")
  if (on and input == "date") then
    --- Candidate(type, start, end, text, comment)
    yield(Candidate("date", seg.start, seg._end, os.date("%Y年%m月%d日"), " 日期"))
  end
end
---
function single_char_first(input, env)
  --- 以 single_char 爲開關名或 key_binder 中 toggle 的對象
  on = env.engine.context:get_option("single_char")
  local cache = {}
  for cand in input:iter() do
    if (not on or utf8.len(cand.text) == 1) then
      yield(cand)
    else
      table.insert(cache, cand)
    end
  end
  for i, cand in ipairs(cache) do
    yield(cand)
  end
end八、其它 
- 包括
recognizer、key_binder、punctuator。 標點 、 快捷鍵 、 二三選重 、特殊字符等均於此設置 
import_preset:由外部統一文件導入grammar:下設:language:取值zh-han[ts]-t-essay-bg[wc]collocation_max_length:最大搭配長度(整句輸入可忽畧此項)collocation_min_length:最小搭配長度(整句輸入可忽畧此項)
recognizer:下設patterns:配合segmentor的prefix和suffix完成段落劃分、tag分配- 前字段可以爲以
affix_segmentor@someTag定義的Tag名,或者punct、reverse_lookup兩個內設的字段。其它字段不調用輸入法引擎,輸入即輸出〔如url等字段〕 
- 前字段可以爲以
 key_binder:下設bindings:設置功能性快捷鍵每一條
binding包含:when作用範圍、accept實際所按之鍵,以及期望的操作操作可爲以下任意一個:
send輸出按鍵、toggle切換開關、send_sequence輸出一串按鍵、set_option開某多選開關、unset_option關某多選開關、select選候選字toggle可用字段包含各開關名set_option、unset_option可用字段包含多選開關名when可用字段包含:paging 翻䈎用 has_menu 操作候選項用 composing 操作輸入碼用 always 全域accept和send可用字段除 A-Za-z0-9 外,還包含以下鍵板上實際有的鍵:BackSpace 退格 Tab 水平定位符 Linefeed 换行 Clear 清除 Return 回車 Pause 暫停 Sys_Req 印屏 Escape 退出 Delete 刪除 Home 原位 Left 左箭頭 Up 上箭頭 Right 右箭頭 Down 下箭頭 Prior、Page_Up 上翻 Next、Page_Down 下翻 End 末位 Begin 始位 Shift_L 左Shift Shift_R 右Shift Control_L 左Ctrl Control_R 右Ctrl Meta_L 左Meta Meta_R 右Meta Alt_L 左Alt Alt_R 右Alt Super_L 左Super Super_R 右Super Hyper_L 左Hyper Hyper_R 右Hyper Caps_Lock 大寫鎖 Shift_Lock 上檔鎖 Scroll_Lock 滾動鎖 Num_Lock 小鍵板鎖 Select 選定 Print 列印 Execute 執行 Insert 插入 Undo 還原 Redo 重做 Menu 菜單 Find 蒐尋 Cancel 取消 Help 幫助 Break 中斷 space exclam ! quotedbl " numbersign # dollar $ percent % ampersand & apostrophe ' parenleft ( parenright ) asterisk * plus + comma , minus - period . slash / colon : semicolon ; less < equal = greater > question ? at @ bracketleft [ backslash bracketright ] asciicircum ^ underscore _ grave ` braceleft { bar | braceright } asciitilde ~ KP_Space 小鍵板空格 KP_Tab 小鍵板水平定位符 KP_Enter 小鍵板回車 KP_Delete 小鍵板刪除 KP_Home 小鍵板原位 KP_Left 小鍵板左箭頭 KP_Up 小鍵板上箭頭 KP_Right 小鍵板右箭頭 KP_Down 小鍵板下箭頭 KP_Prior、KP_Page_Up 小鍵板上翻 KP_Next、KP_Page_Down 小鍵板下翻 KP_End 小鍵板末位 KP_Begin 小鍵板始位 KP_Insert 小鍵板插入 KP_Equal 小鍵板等於 KP_Multiply 小鍵板乘號 KP_Add 小鍵板加號 KP_Subtract 小鍵板減號 KP_Divide 小鍵板除號 KP_Decimal 小鍵板小數點 KP_0 小鍵板0 KP_1 小鍵板1 KP_2 小鍵板2 KP_3 小鍵板3 KP_4 小鍵板4 KP_5 小鍵板5 KP_6 小鍵板6 KP_7 小鍵板7 KP_8 小鍵板8 KP_9 小鍵板9
editor用以訂製操作鍵〔不支持import_preset:〕,鍵板鍵名同key_binder/bindings中的accept和send,效果定義如下:confirm 上屏候選項 commit_comment 上屏候選項備注 commit_raw_input 上屏原始輸入 commit_script_text 上屏變換後輸入 commit_composition 語句流單字上屏 revert 撤消上次輸入 back 按字符回退 back_syllable 按音節回退 delete_candidate 刪除候選項 delete 向後刪除 cancel 取消輸入 noop 空punctuator:下設full_shape:和half_shape:分别控制全角模式下的符號和半角模式下的符號,另有use_space:空格頂字〔true或false〕- 每條標點項可加
commit直接上屏和pair交替上屏兩種模式,默認爲選單模式 
- 每條標點項可加
 
示例 
修改自 cangjie6.schema.yaml
key_binder:
  import_preset: default
  bindings:
    - {accept: semicolon, send: 2, when: has_menu} #分號選第二重碼
    - {accept: apostrophe, send: 3, when: has_menu} #引號選第三重碼
    - {accept: "Control+1", select: .next, when: always}
    - {accept: "Control+2", toggle: full_shape, when: always}
    - {accept: "Control+3", toggle: simplification, when: always}
    - {accept: "Control+4", toggle: extended_charset, when: always}
editor:
  bindings:
    Return: commit_comment
punctuator:
  import_preset: symbols
  half_shape:
    "'": {pair: ["「", "」"]} #第一次按是「,第二次是」
    "(": ["〔", "["] #彈出選單
    .: {commit: "。"} #無選單,直接上屛。優先級最高
recognizer:
  import_preset: default
  patterns:
    email: "^[a-z][-_.0-9a-z]*@.*$"
    url: "^(www[.]|https?:|ftp:|mailto:).*$"
    reverse_lookup: "`[a-z]*;?$"
    pinyin_lookup: "`P[a-z]*;?$"
    jyutping_lookup: "`J[a-z]*;?$"
    pinyin: "(?<!`)P[a-z']*;?$"
    jyutping: "(?<!`)J[a-z']*;?$"
    punct: "/[a-z]*$" #配合symbols.yaml中的特殊字符輸入其它 
- Rime 還爲每個方案提供選單和一定的外觀訂製能力
 - 通常情況下
menu在default.yaml中定義〔或用戶修改檔default.custom.yaml〕,style在squirrel.yaml或weasel.yaml〔或用戶修改檔squirrel.custom.yaml或weasel.custom.yaml〕 
示例 
menu:
  alternative_select_labels: [ ①, ②, ③, ④, ⑤, ⑥, ⑦, ⑧, ⑨ ]  # 修改候選標籤
  alternative_select_keys: ASDFGHJKL #如編碼字符佔用數字鍵則須另設選字鍵
  page_size: 5 #選單每䈎顯示個數
style:
  font_face: "HanaMinA, HanaMinB" #字體〔小狼毫得且僅得設一個字體;鼠鬚管得設多個字體,後面的字體自動補前面字體不含的字〕
  font_point: 15 #字號
  label_format: '%s'  # 候選標籤格式
  horizontal: false #橫/直排
  line_spacing: 1 #行距
  inline_preedit: true #輸入碼內嵌Dict.yaml 詳解 
開始之前 
# Rime dict
# encoding: utf-8
〔你還可以在這註釋字典來源、變動記錄等〕描述檔 
name:內部字典名,也即schema所引用的字典名,確保與文件名相一致version:如果發佈,請確保每次改動陞版本號
示例 
name: "cangjie6.extended"
version: "0.1"配置 
sort:字典初始排序,可選original或by_weightuse_preset_vocabulary:是否引入「八股文」〔含字詞頻、詞庫〕max_phrase_length:配合use_preset_vocabulary:,設定導入詞條最大詞長min_phrase_weight:配合use_preset_vocabulary:,設定導入詞條最小詞頻columns:定義碼表以Tab分隔出的各列,可設text【文本】、code【碼】、weight【權重】、stem【造詞碼】import_tables:加載其它外部碼表encoder:形碼造詞規則exclude_patterns:rules:可用length_equal:和length_in_range:定義。大寫字母表示字序,小寫字母表示其所跟隨的大寫字母所以表的字中的編碼序tail_anchor:造詞碼包含結構分割符〔僅用於倉頡〕exclude_patterns取消某編碼的造詞資格
示例 
cangjie6.extended.dict.yaml
sort: by_weight
use_preset_vocabulary: false
import_tables:
  - cangjie6 #單字碼表由cangjie6.dict.yaml導入
columns: #此字典爲純詞典,無單字編碼,僅有字和詞頻
  - text #字/詞
  - weight #字/詞頻
encoder:
  exclude_patterns:
    - '^z.*$'
  rules:
    - length_equal: 2 #對於二字詞
      formula: "AaAzBaBbBz" #取第一字首尾碼、第二字首次尾碼
    - length_equal: 3 #對於三字詞
      formula: "AaAzBaYzZz" #取第一字首尾碼、第二字首尾碼、第三字尾碼
    - length_in_range: [4, 5] #對於四至五字詞
      formula: "AaBzCaYzZz" #取第一字首碼,第二字尾碼、第三字首碼、倒數第二字尾碼、最後一字尾碼
  tail_anchor: "'"碼表 
- 以
Tab分隔各列,各列依columns:定義排列。 
示例 
cangjie6.dict.yaml
columns:
  - text #第一列字/詞
  - code #第二列碼
  - weight #第三列字/詞頻
  - stem #第四列造詞碼cangjie6.dict.yaml
個	owjr	246268	ow'jr
看	hqbu	245668
中	l	243881
呢	rsp	242970
來	doo	235101
嗎	rsqf	221092
爲	bhnf	211340
會	owfa	209844
她	vpd	204725
與	xyc	203975
給	vfor	193007
等	hgdi	183340
這	yymr	181787
用	bq	168934	b'q雪齋
 09-Nov-2013