Skip to content

openfly_hint_filter 过滤掉次选问题 #40

Closed

Description

@rysyd

挂载上开源小鹤后,发现多数次选没有了,检查了开启的编码文件和方案文件后,发现如果启用 lua_filter@openfly_hint_filter,似乎会把单字有次选的次选编码过滤掉。

Activity

  1. amorphobia commented on Apr 1, 2021

    @amorphobia
    Owner

    目前可以通过在 openfly.custom.yaml 里定义一个新的开关来控制二重简码的显示

    # encoding: utf-8
    patch:
      switches/+:
        - name: openfly_enable_2nd_short
          states: [ 二重简码关闭, 开启 ]

    上游 librime-lua 的一个改动 (hchunhui/librime-lua#92) 还没有进入到 librime 正式版里,等正式版包含了之后,可以像小鹤音形电脑版那样输入 oei 来切换这个开关。

  2. rysyd commented on Apr 1, 2021

    @rysyd
    Author

    好的,谢谢;
    我大致修改了yielded_count > 1 暂时解决

    if is_short and disable_2nd and yielded_count > 0 and cand.type ~= "completion" then break end

    ,lua 没看得太懂,不确定有什么影响……

  3. amorphobia commented on Apr 1, 2021

    @amorphobia
    Owner

    你发现的这个对应的是官方发布的小鹤音形的「二重简码」,官方的直通车是输入 oei 然后选择关闭或开启
    image

    当前版本的二重简码一共有90个,filter 的这一行就是控制这个词库显示的开关
    image

    不推荐直接修改 lua 脚本,因为以后的更新会覆盖。如果想要默认显示二重简码,建议在 openfly.custom.yaml 里加上

    patch:
      switches/+:
        - name: openfly_enable_2nd_short
          states: [ 二重简码关闭, 开启 ]
          reset: 1

    这段代码是在 Rime 的开关里面加上二重简码的开关,并且 reset: 1 会默认打开二重简码,正如 Rime 里的简繁、中英的开关。

    另外,需要在 default.custom.yaml 里面加上

    __patch:
      - patch/+:
          "switcher/save_options/+":
            - "openfly_enable_2nd_short"

    如果你是通过东风破安装的,那么这段应该已经有了,这个代码是将二重简码的开关设置为自动保存,这样即使重新加载 Rime 算法服务后,也会读取之前的设置。

    另外,当前版本的 librime 算法服务,没有包含 hchunhui/librime-lua#92 这个改动,所以暂时无法像官方版小鹤音形那样通过直通车切换开关,但是可以使用 Rime 自己的方式,绑定快捷键来切换。

  4. Repository owner locked and limited conversation to collaborators on Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions