Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何在中英文混合输入时,自动个英文前后加入空格。 #327

Closed
iDvel opened this issue Jun 7, 2023 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@iDvel
Copy link
Owner

iDvel commented Jun 7, 2023

如何在中英文混合输入时,自动给英文前后加入空格。

Originally posted by @BenjaminX in #133 (comment)

@boomker
Copy link
Contributor

boomker commented Jun 7, 2023

我写了一个 lua 脚本, 大家可以参考一下
word_append_space
目前还不是那么的完美:

    1. 跨 APP 中英混合输入无法预知中英输入的情况
    1. 输入过程中, 对之前已经上屏到输入区的字符做二次编辑无法预知中英情况

@iDvel iDvel added the enhancement New feature or request label Jun 7, 2023
@iDvel
Copy link
Owner Author

iDvel commented Jun 7, 2023

判断中、英、数字再添加空格太复杂了,也确实有很多情况是不需要空格的。
我的想法是给中英混输词库添加空格,比如 VIP中P 自动变成 VIP 中 P
这个在 Word 中是不必要的,Word 会自动排版,默认不启用吧。

@iDvel iDvel closed this as completed in 1eed724 Jun 7, 2023
lovelock pushed a commit to lovelock/rime-ice that referenced this issue Jun 8, 2023
luckmoon pushed a commit to luckmoon/rime-ice that referenced this issue Jun 8, 2023
ann61c pushed a commit to ann61c/rime-ice that referenced this issue Jul 11, 2023
@bbingz
Copy link

bbingz commented Nov 11, 2023

求教,这个lua脚本怎么移植到五笔的配置当中呢?

@iDvel
Copy link
Owner Author

iDvel commented Nov 11, 2023

直接用就行了,只看候选项的格式,不分拼音五笔。

@ghost
Copy link

ghost commented Nov 24, 2024

我写了一个 lua 脚本, 大家可以参考一下 word_append_space 目前还不是那么的完美:

    1. 跨 APP 中英混合输入无法预知中英输入的情况
    1. 输入过程中, 对之前已经上屏到输入区的字符做二次编辑无法预知中英情况

大佬,这个文件是怎么用的啊?我把这个文件扔进了/lua 文件夹里,然后在 rime_ice.custom.yaml 里添加了

patch:
 engine/filters:
   - lua_filter@word_append_space

重新部署后中英文输入都没有候选框了- -,是不是还有别的配置?是的话就算了,不会搞。
谢谢

@boomker
Copy link
Contributor

boomker commented Nov 24, 2024

@frankilla1987 , 需要添加以下配置:

  # 注释下行, 以取消中英混合的候选词条里自动添加的空格
  'engine/filters/@before last': lua_filter@*word_append_space*filter
  # 注释下行, 以取消中英混合输出上屏时自动添加的前导空格
  'engine/processors/@after 1': lua_processor@*word_append_space*processor

Note:上面的配置,是 Lua 扩展滤镜的新写法,与雾凇传统写法不一样,你需要适当调整

这个脚本有更新:
https://github.com/boomker/rime-fast-xhup/blob/370fd058b90aaf452cc36aecd04a56dc7519f7b9/lua/word_append_space.lua

@ghost
Copy link

ghost commented Nov 24, 2024

@frankilla1987 , 需要添加以下配置:

  # 注释下行, 以取消中英混合的候选词条里自动添加的空格
  'engine/filters/@before last': lua_filter@*word_append_space*filter
  # 注释下行, 以取消中英混合输出上屏时自动添加的前导空格
  'engine/processors/@after 1': lua_processor@*word_append_space*processor

这个脚本有更新: https://github.com/boomker/rime-fast-xhup/blob/370fd058b90aaf452cc36aecd04a56dc7519f7b9/lua/word_append_space.lua

再加上boomker/rime-fast-xhup#33 (comment) 你的这个回复,还是没搞定。算了~😭感谢大佬回复!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants