mirror of
https://github.com/d0zingcat/rime_wanxiang.git
synced 2026-05-13 15:10:03 +00:00
fix: 修复当根目录的置顶包含英文的时候导致replacer简码也会出现的问题
This commit is contained in:
24
README.md
24
README.md
@@ -350,21 +350,21 @@ bash rime-install amzxyz/rime_wanxiang@wanxiang-shouyou-fuzhu:plum/dicts
|
||||
| `jm_zrm.txt` | **自然码双拼简码** | 下载后复制内容,追加到根目录的 `custom_phrase.txt` 中。 |
|
||||
| `tips_user.txt` | **Tips 翻译扩展数据** | 下载后放入 `lua/data` 目录中,重新部署即可生效。 |
|
||||
|
||||
#### 9. 📂 压缩包数据管理
|
||||
#### 9. 📂 数据管理
|
||||
| 文件名 | 用途 | 注意事项 |
|
||||
| --- | --- | --- |
|
||||
| `lua/data` | **存放lua加载的txt数据** | 数据的更新需要编辑txt后先删除lua文件夹下面对应的userdb数据库,重新部署才能重建数据库,从而实现更新 |
|
||||
| `lua/data/chinese_english.txt` | **中文翻译英文数据库** | 数据库位于replacer.userdb中。 |
|
||||
| `lua/data/english_chinese.txt` | **英文翻译中文数据库** | 数据库位于replacer.userdb中。 |
|
||||
| `lua/data/emoji.txt` | **emoji数据库** | 数据库位于replacer.userdb中。 |
|
||||
| `lua/data/abbrev.txt` | **公共简码数据库** | 数据库位于replacer.userdb中。 |
|
||||
| `lua/data/t9_abbrev.txt` | **t9用公共简码数据库** | 数据库位于replacer.userdb中。数字为键 |
|
||||
| `lua/data/*Phrases.txt` | **OpenCC简繁转换词组数据库** | 数据库位于replacer.userdb中。HK香港TW台湾 |
|
||||
| `lua/data/*Characters.txt` | **OpenCC简繁转换单字数据库** | 数据库位于replacer.userdb中。ST简繁、TS繁简 |
|
||||
| `lua/data/chinese_english.txt` | **中文翻译英文数据库** | 数据库位于lua/replacer.userdb中。 |
|
||||
| `lua/data/english_chinese.txt` | **英文翻译中文数据库** | 数据库位于lua/replacer.userdb中。 |
|
||||
| `lua/data/emoji.txt` | **emoji数据库** | 数据库位于lua/replacer.userdb中。 |
|
||||
| `lua/data/abbrev.txt` | **公共简码数据库** | 数据库位于lua/replacer.userdb中。 |
|
||||
| `lua/data/t9_abbrev.txt` | **t9用公共简码数据库** | 数据库位于lua/replacer.userdb中。数字为键 |
|
||||
| `lua/data/*Phrases.txt` | **OpenCC简繁转换词组数据库** | 数据库位于lua/replacer.userdb中。HK香港TW台湾 |
|
||||
| `lua/data/*Characters.txt` | **OpenCC简繁转换单字数据库** | 数据库位于lua/replacer.userdb中。ST简繁、TS繁简 |
|
||||
| `tips_show.txt` | **Tips 自带数据** | 数据库位于tips.userdb |
|
||||
| `tips_user.txt` | **Tips 用户数据** | 空文件交给用户自定义,数据库位于tips.userdb |
|
||||
| `input_statistics.lua` | **输入统计lua创建的实时数据** | 数据库位于stats.userdb |
|
||||
|
||||
| `tips_user.txt` | **Tips 用户数据** | 空文件交给用户自定义,数据库位于lua/tips.userdb |
|
||||
| `input_statistics.lua` | **输入统计lua创建的实时数据** | 数据库位于lua/stats.userdb |
|
||||
| `super_sequence.lua` | **手动排序lua创建的实时数据** | 数据库位于lua/sequence.userdb |
|
||||
|
||||
### 答疑
|
||||
|
||||
@@ -606,6 +606,8 @@ datetime_formats:
|
||||
|
||||
**自动上屏:** 例如:三位、四位简码唯一时,自动上屏如`jjkw岌岌可危` `zmhu怎么回事` 。默认未开启,方案文件中`speller:`字段下取消注释这两句开启 `# auto_select: true # auto_select_pattern: ^[a-z]+/|^[a-df-zA-DF-Z]\w{3}|^e\w{4}`
|
||||
|
||||
**空码回溯:** 当输入的时候前面编码有候选,但继续输入无候选了,此时会将上一次的候选显示到候选中并在注释中显示了一个`~`作为表示一种不稳固状态,在英文输入句子的时候也会有这个状态的出现。这样的设计省去了回退键,可以直接空格上屏,同时他也能极大的减少三码是为空给用户带来的异常感知。
|
||||
|
||||
**数字后自动半角:** 当中文状态输入数字的时候后面立即输入,。将自动转换为数字分割符,例如科学记数法1000,000 小数点 3.1415,如果你加入冒号:还可以优雅的输入时间12:30,当然你还可以双击输入的符号恢复全角符号的输出。但若你完全没有场景使用该功能,则可以通过patch,将其修改为commit
|
||||
```punctuator/digit_separators: ",." > punctuator/digit_separators: commit```
|
||||
|
||||
|
||||
@@ -974,10 +974,10 @@
|
||||
符号:≈ 约等号
|
||||
符号:≠ 不等于
|
||||
符号:≠ 不等号
|
||||
符号:≤ 小于号
|
||||
符号:<≤> 小于号
|
||||
符号:≤ 小于等于
|
||||
符号:≤ 小于等于号
|
||||
符号:≥ 大于号
|
||||
符号:> 大于号
|
||||
符号:≥ 大于等于
|
||||
符号:≥ 大于等于号
|
||||
符号:吋 英寸
|
||||
|
||||
@@ -528,26 +528,40 @@ function M.func(input, env)
|
||||
end
|
||||
end
|
||||
-- [Main Loop] 主循环
|
||||
local pending_cands = {}
|
||||
local limit = 10
|
||||
local has_phrase = false
|
||||
local cand_count = 0
|
||||
|
||||
|
||||
for cand in input:iter() do
|
||||
cand_count = cand_count + 1
|
||||
|
||||
if cand_count == 1 then
|
||||
-- 判断是否为"空码" (raw / english / 纯字母 / 文本等于输入)
|
||||
local has_letter = string.find(cand.text, "[a-zA-Z]")
|
||||
local is_empty = (cand.type == "raw"
|
||||
or cand.type == "english"
|
||||
or cand.text == input_code
|
||||
or has_letter) -- 只要包含字母,就算作空
|
||||
try_trigger_abbrev(is_empty)
|
||||
|
||||
if cand_count <= limit then
|
||||
table.insert(pending_cands, cand)
|
||||
if cand.type == "phrase" then
|
||||
has_phrase = true
|
||||
end
|
||||
else
|
||||
if cand_count == limit + 1 then
|
||||
if not has_phrase then
|
||||
try_trigger_abbrev(true)
|
||||
end
|
||||
for _, pc in ipairs(pending_cands) do
|
||||
process_rules(pc)
|
||||
end
|
||||
pending_cands = nil
|
||||
end
|
||||
process_rules(cand)
|
||||
end
|
||||
|
||||
-- 原候选逻辑
|
||||
process_rules(cand)
|
||||
end
|
||||
if cand_count == 0 then
|
||||
try_trigger_abbrev(true)
|
||||
|
||||
if pending_cands then
|
||||
if not has_phrase then
|
||||
try_trigger_abbrev(true)
|
||||
end
|
||||
for _, pc in ipairs(pending_cands) do
|
||||
process_rules(pc)
|
||||
end
|
||||
end
|
||||
end
|
||||
return M
|
||||
Reference in New Issue
Block a user