GithubHelp home page GithubHelp logo

Comments (6)

boomker avatar boomker commented on May 26, 2024
  1. 需要在rime.lua 中添加
    -- 适用于中文输入方案的中英文之间加空格
word_append_space = require("word_append_space")
word_append_space_filter = word_append_space.filter
word_append_space_processor = word_append_space.processor
  1. 在主配置文件里引用这两个Lua功能
    - lua_processor@word_append_space_processor
    - lua_filter@word_append_space_filter

另外你说的不生效,是指没有一点效果,还是在一些特定情况, 这个脚本还不是那么完美, 在一些情况下,用起来感觉像是没有效果的

from rime-fast-xhup.

dyphire avatar dyphire commented on May 26, 2024

通过进一步研究这个配置中的写法。我通过以下补丁使它生效了

patch:
  engine/processors/@before 0: lua_processor@word_append_space_processor
  engine/filters/+:
    - lua_filter@word_append_space_filter
    - uniquifier

但我在测试中发现输入英文时无论前面有没有输入中文它都会在单词前添加空格,这会是什么原因呢?

from rime-fast-xhup.

boomker avatar boomker commented on May 26, 2024

但我在测试中发现输入英文时无论前面有没有输入中文它都会在单词前添加空格,这会是什么原因呢?


这个脚本在处理换行时, 或者当前行全部删除重新编辑时,会有这样的情况。
这个问题有点难以解决, Rime程序没法捕获你编辑时所有按键和编辑的状态。

from rime-fast-xhup.

dyphire avatar dyphire commented on May 26, 2024

但我在测试中发现输入英文时无论前面有没有输入中文它都会在单词前添加空格,这会是什么原因呢?

这个脚本在处理换行时, 或者当前行全部删除重新编辑时,会有这样的情况。 这个问题有点难以解决, Rime程序没法捕获你编辑时所有按键和编辑的状态。

但我遇到的问题是只要输入英文它就会自动在前面添加空格,英文后输入中文它会正常地在中间添加空格。现在困扰我的是如何让它只在中文之后输入英文的时候才在前面加空格

from rime-fast-xhup.

boomker avatar boomker commented on May 26, 2024

你的意思是,前一个输入英文单词后, 后面再输入一个英文单词不用在前面添加空格是吗?
当你在一个 app 输入了中文, 换到另一个 app 后输入英文, 可能还是会在英文前面添加空格,
貌似 Librime-lua 还没探测 app 切换的接口,所以没法在 app 切换后准确的得知是否添加空格。

from rime-fast-xhup.

dyphire avatar dyphire commented on May 26, 2024

你的意思是,前一个输入英文单词后, 后面再输入一个英文单词不用在前面添加空格是吗? 当你在一个 app 输入了中文, 换到另一个 app 后输入英文, 可能还是会在英文前面添加空格, 貌似 Librime-lua 还没探测 app 切换的接口,所以没法在 app 切换后准确的得知是否添加空格。

我遇到的问题是每一次输入英文都会添加空格,即使是第一次输入也是如此
不过看上去确实存在很多由于 rime 限制无法处理的场景,还是老老实实手动加空格吧

from rime-fast-xhup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.