Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
修改一些東西
Browse files Browse the repository at this point in the history
  • Loading branch information
RegChien committed Mar 8, 2021
1 parent 628f71c commit 59b8c4d
Show file tree
Hide file tree
Showing 4 changed files with 363 additions and 154 deletions.
118 changes: 77 additions & 41 deletions luna_pinyin.custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,86 @@
#
# 作者:瑾昀 <cokunhui@gmail.com>
#
# 部署位置:
# ~/.config/ibus/rime (Linux)
# ~/Library/Rime (Mac OS)
# %APPDATA%\Rime (Windows)
#
# 於重新部署後生效
#
#
# 注意:本補靪適用於所有朙月拼音系列方案(「朙月拼音」、「朙月拼音·简化字」、「朙月拼音·臺灣正體」、「朙月拼音·語句流」)。
# 只須將本 custom.yaml 的前面名字改爲對應的輸入方案名字然後放入用戶文件夾重新部署即可。如 luna_pinyin_simp.custom.yaml。
# 雙拼用戶請使用 double_pinyin.custom.yaml。
#
#
# 附朙月拼音系列方案與其對應的 id 一覽表:
# 輸入方案 id
# 朙月拼音 luna_pinyin
# 朙月拼音·简化字 luna_pinyin_simp
# 朙月拼音·臺灣正體 luna_pinyin_tw
# 朙月拼音·語句流 luna_pinyin_fluency
#

patch:
switches:
- name: ascii_mode
reset: 0
states: ["中文", "西文"]
- name: full_shape
reset: 0
states: ["半角", "全角"]
- name: simplification
- name: zh_simp # (※1) 繁简转换
reset: 1
states: ["漢字", "汉字"]
- options: ["utf8", "gbk", "gb2312"] # (※2)字符集選單
reset: 0 # 默認 UTF
states:
- UTF-8
- GBK
- GB2312
- name: show_emoji
reset: 1
states: [ "🈚️️\uFE0E", "🈶️️\uFE0F" ]
# - name: s2tw # 簡繁轉換
# reset: 1
# states: [ "簡化字", "標準字" ]
- name: t2tw # 正繁轉換
states: [ "傳承字", "標準字" ]
reset: 0
states: [ "漢字", "汉字" ]

# simplifier:
# option_name: zh_simp

engine/filters:
- simplifier
- simplifier@emoji_conversion
- uniquifier
- charset_filter@gbk # (※3) GBK 过滤
- single_char_filter
- simplifier@s2tw # 簡繁轉換
- simplifier@t2tw # 正繁轉換

emoji_conversion:
opencc_config: emoji.json
option_name: show_emoji
tags: abc


# 加載 easy_en 依賴
"schema/dependencies/@1": easy_en
# 載入翻譯英文的碼表翻譯器,取名爲 english〔方案选单〕
"engine/translators/@4": table_translator@english
# english 翻譯器的設定項
english:
dictionary: easy_en
spelling_hints: 9
enable_completion: false
enable_sentence: false
initial_quality: -2
"speller/algebra/@before 0": xform/^([b-df-hj-np-tv-z])$/$1_/

# 載入朙月拼音擴充詞庫
# 載入朙月拼音擴充詞庫
"translator/dictionary": luna_pinyin.extended
# 改寫拼寫運算,使得含西文的詞彙(位於 luna_pinyin.cn_en.dict.yaml 中)不影響簡拼功能(注意,此功能只適用於朙月拼音系列方案,不適用於各類雙拼方案)
# 本條補靪只在「小狼毫 0.9.30」、「鼠鬚管 0.9.25 」、「Rime-1.2」及更高的版本中起作用。
"speller/algebra/@before 0": xform/^([b-df-hj-np-tv-z])$/$1_/
# 拼写纠错
"translator/enable_correction": true

# 採用臺灣正體
# s2tw: # 簡繁轉換
# option_name: s2tw
# opencc_config: s2tw.json
# tips: none

# 符号快速输入和部分符号的快速上屏
t2tw: # 正繁轉換
option_name: t2tw
opencc_config: t2tw.json
tips: none

# 符号快速输入和部分符号的快速上屏
punctuator:
import_preset: symbols
symbols:
"/fs": [½, ‰, ¼, ⅓, ⅔, ¾, ⅒ ]
"/bq": [😂️, 😅️, ☺️, 😱️, 😭️, 😇️, 🙃️, 🤔️, 💊️, 💯️, 👍️, 🙈️, 💩️, 😈️ ]
"/dn": [⌘, ⌥, ⇧, ⌃, ⎋, ⇪, , ⌫, ⌦, ↩︎, ⏎, ↑, ↓, ←, →, ↖, ↘, ⇟, ⇞]
"/fh": [ ©, ®, ℗, ℠, ™, ℡, , ♂, ♀, ☉, ☊, ☋, ☌, ☍, ☐, ☑︎, ☒, ☜, ☝, ☞, ☟, ✎, ✄, ♲, ♻, ⚐, ⚑, ⚠]
"/fh": [ ©, ®, ℗, ⓘ, ℠, ™, ℡, , ♂, ♀, ☉, ☊, ☋, ☌, ☍, ☐, ☑︎, ☒, ☜, ☝, ☞, ☟, ✎, ✄, ♻, ⚐, ⚑, ⚠]
"/xh": [ *, ×, ✱, ★, ☆, ✩, ✧, ❋, ❊, ❉, ❈, ❅, ✿, ✲]
half_shape:
"#": "#"
Expand All @@ -73,7 +92,7 @@ patch:
"~": "~"
"@": "@"
"=": "="
"/": ["/", "÷"]
"/": ["/", "÷",]
'\': ""
"_" : "──"
"'": {pair: ["「", "」"]}
Expand All @@ -83,8 +102,8 @@ patch:
"<": ["《", "〈", "«", "<"]
">": ["》", "〉", "»", ">"]
recognizer/patterns/punct: "^/([a-z]+|[0-9]0?)$"
# 模糊拼音

# 模糊拼音
'speller/algebra':
- erase/^xx$/ # 第一行保留

Expand Down Expand Up @@ -115,14 +134,14 @@ patch:

# 韻母部份
#- derive/^([bpmf])eng$/$1ong/ # meng = mong, ...
#- derive/([ei])n$/$1ng/ # en => eng, in => ing
#- derive/([ei])ng$/$1n/ # eng => en, ing => in
- derive/([ei])n$/$1ng/ # en => eng, in => ing
- derive/([ei])ng$/$1n/ # eng => en, ing => in

# 樣例足夠了,其他請自己總結……

# 模糊音定義先於簡拼定義,方可令簡拼支持以上模糊音
#- abbrev/^([a-z]).+$/$1/ # 簡拼(首字母)
#- abbrev/^([zcs]h).+$/$1/ # 簡拼(zh, ch, sh)
- abbrev/^([a-z]).+$/$1/ # 簡拼(首字母)
- abbrev/^([zcs]h).+$/$1/ # 簡拼(zh, ch, sh)

# 以下是一組容錯拼寫,《漢語拼音》方案以前者爲正
- derive/^([nl])ve$/$1ue/ # nve = nue, lve = lue
Expand All @@ -136,9 +155,26 @@ patch:
- derive/([dtngkhrzcs])o(u|ng)$/$1o/ # zho => zhong|zhou
- derive/ong$/on/ # zhonguo => zhong guo
- derive/ao$/oa/ # hoa => hao
- derive/ua$/au/ # shau => shua
- derive/([iu])a(o|ng?)$/a$1$2/ # tain => tian

# 分尖團後 v => ü 的改寫條件也要相應地擴充:
#'translator/preedit_format':
# - "xform/([nljqxyzcs])v/$1ü/"
# 分尖團後 v => ü 的改寫條件也要相應地擴充:
#'translator/preedit_format':
# - "xform/([nljqxyzcs])v/$1ü/"

__patch:
# Rx: BlindingDark/rime-easy-en:customize:schema=luna_pinyin_simp {
- patch/+:
__include: easy_en:/patch
# }

# 加載 easy_en 依賴
"schema/dependencies/@1": easy_en
"engine/translators/@4": table_translator@english # 載入翻譯英文的碼表翻譯器,取名爲 english
english: # english 翻譯器的設定項
dictionary: easy_en
spelling_hints: 9
enable_completion: false # 是否启用英文输入联想补全
enable_sentence: false # 關閉造句功能
enable_user_dict: true # 智能詞頻功能
initial_quality: -1 # 调整英文候选词的位置,如 -3 会更靠后
Loading

0 comments on commit 59b8c4d

Please sign in to comment.