-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxfsm.schema.yaml
125 lines (112 loc) · 5.93 KB
/
xfsm.schema.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Rime schema settings
# encoding: utf-8
# 参考地址:https://github.com/rime/home/wiki/RimeWithSchemata
# 具体选项设置:https://github.com/LEOYoon-Tsaw/Rime_collections/blob/master/Rime_description.md
# 方案基本信息
schema:
schema_id: xfsm
name: 西风瘦码-$hell
version: "2019.11.19"
author:
- "$hell <yangzhaoyunfei@qq.com>"
description: |
顶功类输入法,适合单字派。
码表作者:化外愚民。
敲 ` 鍵進入拼音反查.
dependencies:
- pinyin_simp
switches:
- name: ascii_mode # 中英文轉換開關。預設0爲中文,1爲英文
reset: 0
states: [ 中文, 西文 ]
- name: full_shape # 全角符號/半角符號開關。注意,開啓全角時英文字母亦爲全角。0爲半角,1爲全角
states: [ 半角, 全角 ]
- name: simplification # 轉化字開關。一般情況下與上同,0爲不開啓轉化,1爲轉化
states: [ 汉字, 漢字 ]
- name: extended_charset # 字符集開關,僅table_translator可用。0爲CJK基本字符集,1爲CJK全字符集。
states: [ 通用, 增廣 ]
- name: ascii_punct # 中西文标点转换开关,0为中文句读,1为西文标点。
states: [ 。,, ., ]
# 输入引擎、功能组件,输入码-》识别分段-》各段翻译
engine: # 輸入引擎設定,即掛接組件的「處方」
processors: # 一、這批組件處理各類按鍵消息
- ascii_composer # ※ 處理西文模式及中西文切換
- recognizer # ※ 與 matcher 搭配,處理符合特定規則的輸入碼,如網址、反查等
- key_binder # ※ 在特定條件下將按鍵綁定到其他按鍵,如重定義逗號、句號爲候選翻頁鍵
- speller # ※ 拼寫處理器,接受字符按鍵,編輯輸入碼
- punctuator # ※ 句讀處理器,將單個字符按鍵直接映射爲文字符號
- selector # ※ 選字處理器,處理數字選字鍵、上、下候選定位、換頁鍵
- navigator # ※ 處理輸入欄內的光標移動鍵
- express_editor # ※ 編輯器,處理空格、回車上屏、回退鍵等
segmentors: # 二、這批組件識別不同內容類型,將輸入碼分段
- ascii_segmentor # ※ 標識西文段落
- matcher # ※ 標識符合特定規則的段落,如網址、反查等
- abc_segmentor # ※ 標識常規的文字段落
- affix_segmentor@pinyin_segmentor # 用戶自定義tag,此項可加載多個實例,後接@+tag名
- punct_segmentor # ※ 標識句讀段落
- fallback_segmentor # ※ 標識其他未標識段落
translators: # 三、這批組件翻譯特定類型的編碼段爲一組候選文字
- punct_translator # ※ 轉換標點符號
- table_translator # ※ 碼表翻譯器,用於倉頡、五筆等基於碼表的輸入方案,替換 script_translator。此項可加載多個實例,後接@+翻譯器名〔如:cangjie、wubi等〕
- script_translator@pinyin_translator
- lua_translator@date_translator # 自定义系统变量输出
filters: # 四、這批組件過濾翻譯的結果
- simplifier
- uniquifier
- reverse_lookup_filter@pinyin_reverse_lookup_filters # 反查滤镜,以更灵活的方式反查,Rime1.0后替代reverse_lookup_translator,可能可加载多个实例,后接@+滤镜名〔如:pinyin_lookup,jyutping_lookup等〕
# 各组件详细参数
speller:
alphabet: ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba,./;^*!?><$] # 定义本方案输入键
#delimiter: " " # 上屛时的音节间分音符,应该音码方案才使用
auto_select: true # 自动上屛〔true或false〕
initials: "bcdfghjklmnpqrstvwxyz" # 定義僅作始碼之鍵
finals: ",./;" #定義僅作末碼之鍵
# 反查分段器
pinyin_segmentor:
tag: pinyin # 爲此segmentor所標記的段落插上该tag
prefix: "`" # 設定其前綴標識,可不塡,不塡則無前綴;此处作为反查引導鍵「`」
tips: "[拼音反查]"
# 主翻译器-瘦码
translator:
dictionary: xfsm_dz # 翻译器将调取此字典文件
enable_charset_filter: false # 是否开启字符集过滤〔仅table_translator有效。cjk_minifier启用后可适用于script_translator〕
enable_sentence: false # 是否开启自动造句
enable_completion: true
enable_encoder: true
enable_user_dict: false
encode_commit_history: true
max_phrase_length: 6
# 副翻译器-拼音
pinyin_translator:
tag: pinyin # 設定此翻譯器針對的tag。
dictionary: pinyin_simp
# 反查滤镜
pinyin_reverse_lookup_filters: # 滤镜名
tags: [ pinyin ] # 滤镜作用于--`处理这些tag的翻译器--上
overwrite_comment: true # 是否覆蓋其他提示
dictionary: xfsm_dz # 反查所得提示碼之碼表
comment_format: &comment # 自定義提示碼格式,表达式参考:https://www.boost.org/doc/libs/1_49_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html
- "xform/$/〕/"
- "xform/^/〔/"
- "xform/ /, /"
punctuator:
import_preset: symbols # 請在這裏更改標點設置,具體範例參照symbols.yaml本節
key_binder:
import_preset: default
recognizer:
import_preset: default
patterns:
pinyin: "^`[a-z]*'?$"
# 反查引導鍵
punct: "^/[0-9]?[a-z]*$"
# 以「/」引導特殊符號
ascii_composer:
good_old_caps_lock: true
switch_key:
Shift_L: inline_ascii
Shift_R: commit_text
Control_L: noop
Control_R: noop
Caps_Lock: commit_code
menu:
page_size: 15