-
-
Save lotem/5440677 to your computer and use it in GitHub Desktop.
| # Rime table | |
| # coding: utf-8 | |
| #@/db_name custom_phrase.txt | |
| #@/db_type tabledb | |
| # | |
| # 用於【朙月拼音】系列輸入方案 | |
| # 【小狼毫】0.9.21 以上 | |
| # | |
| # 請將該文件以UTF-8編碼保存爲 | |
| # Rime用戶文件夾/custom_phrase.txt | |
| # | |
| # 碼表各字段以製表符(Tab)分隔 | |
| # 順序爲:文字、編碼、權重(決定重碼的次序、可選) | |
| # | |
| # 雖然文本碼表編輯較爲方便,但不適合導入大量條目 | |
| # | |
| # 出現在以下這行註釋之後的 # 不再識別爲註釋: | |
| # no comment | |
| 中州韻輸入法引擎 rime 3 | |
| Rime Input Method Engine rime 2 | |
| https://rime.im/ rime 1 | |
| 星際我爭霸 starcraft | |
| tassadar@protoss.net email |
五笔_拼音有办法用这个功能不
五笔_拼音有办法用这个功能不
需要修改輸入方案
自定义短语里面有大量日语句子。
经常会简体汉字和这些自定义短语里的日语句子混合输入。
但是日语句子里的繁体汉字会被转换成简体的。
有没有什么办法不转换自定义短语里的内容?
有!在 simplifier 中指定 tags: [ abc ] 即可。
abc 代表主翻译器。tags: [ abc ] 相当于只对主翻译器转换。
短语能不能是分行的呢?比如
\begin{pmatrix}
x & y \
z & v
\end{pmatrix}
同问短语能不能是分行的?
这个功能挺实用。
应该是不能换行的吧?能换行就好,
同问:如何换行呢?
希望增加换行功能,比如用\n来给自定义短语换行等等。
不能使用.吗? 用来简写一些常用的域名, 比如 github.com g.h 期待只需要输入g.h就能输出github.com, 目前看来是只要包含了.就不能正确输出, 好像是,.被翻页占用的原因
还有个需求就是能用变量吗? 比如输出当前日期时间比较方便
emoji不能使用对吗?
❌ xx 1
符号怎么使用啊
支持换行了吗?
五笔_拼音有办法用这个功能不
custom_phrase里的格式是一样的,需要额外写一个wubi_pinyin.custom.yaml在用户文件夹里,代码写如下:
patch:
engine/translators:
- punct_translator
- reverse_lookup_translator
- script_translator
- table_translator@custom_phrase
- table_translator
custom_phrase:
dictionary: ""
user_dict: custom_phrase
db_class: stabledb
enable_completion: false
enable_sentence: false
initial_quality: 1
为什么文件里权重写了1,但是实际使用的时候有概率掉到3上呢
(不是那种有概率,就是有的正常,有的掉到3上,而且是确定的哪几个正常哪几个不对)
奇怪
rime 自定义短语支持 换行吗?
rime 自定义短语支持 换行吗?
同问,写的 \n 原样输出了
参考 https://github.com/hchunhui/librime-lua/blob/master/sample/lua/single_char.lua,自己写了个 lua 脚本,支持替换 \\n 为 \n,目前只有这个需求,如果有其他的需要替换可以自己修改代码:
-- lua/new_line.lua
-- 在方案补丁中新增 'engine/filters/@before last': lua_filter@*new_line
local M = {}
function M.init(env)
end
function M.func(input)
for cand in input:iter() do
-- 处理换行符 如果只需要 custom_phrase 里面的转换,判断一下 cand.type 是否为 user_table 就可以了
if (cand.text:match("\\n")) then
local replaced_text = string.gsub(cand.text, "\\n", "\n")
-- 生成新候选(关键!)候选文字不能直接修改,注释可以
local new_cand = Candidate(
cand.type,
cand.start,
cand._end,
replaced_text, -- 你想要的文字
cand.comment -- 你想要的注释
)
-- 保留原权重(不影响排序)
new_cand.quality = cand.quality
yield(new_cand)
else
yield(cand)
end
end
end
return M
自定义短语里面有大量日语句子。
经常会简体汉字和这些自定义短语里的日语句子混合输入。
但是日语句子里的繁体汉字会被转换成简体的。
有没有什么办法不转换自定义短语里的内容?