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

繁体和字频问题 #4

Closed
bczhc opened this issue Jan 29, 2023 · 9 comments
Closed

繁体和字频问题 #4

bczhc opened this issue Jan 29, 2023 · 9 comments

Comments

@bczhc
Copy link

bczhc commented Jan 29, 2023

有两个问题:

  1. 已经在ctrl+`中切换到了简体,但候选里还是有繁体;
  2. 字频好像不是很对

@bigshans
Copy link
Owner

确实有这两个问题。

因为原有词库里是简繁混合的,一些繁体字和简体字的辅码不一样,不管怎么转都是有损的。我个人用的时候又用 opencc 剔了一遍,只留了简体。

词频的话,不是所有的单字都预设了词频,而且辅码也会影响排序,需要自己手动调整。虽然引入了 luna_pinyin 的词频,但仍然不是很理想。我自己用久了,一些词频也逐渐调整过来了。其实最好要有一个好一点的多字词库,用起来会更顺手。不过最好都要重新弄一下编码,不然总会有奇奇怪怪的组合出来。

我传了一下我目前的用的一些词库,你可以试一下,有一些个人趣味。我主要是用的久了,很多输入法自己记住了。

@bczhc
Copy link
Author

bczhc commented Jan 30, 2023

感谢即时的回复。繁体问题应该解决了。还有我发现在字库zrm_pinyin.dict.yaml文件中,把辅助码删了(就是把";xx"都给删去),字频就正常了。所以字库的字频是没问题的,应该还是哪里没有配置对吧。现在这是字频没问题了,但辅助码就用不了了。

Screenshot_2023-01-30_12-36-33

@bigshans
Copy link
Owner

是的,因为有辅码的加入使得编码不同了,字频也不能完全解决问题。如果不要辅码的话,还不如直接用一般的双拼方案合适。

要么把 sort 改成 original ,然后根据自己的需要调顺序。你可以看看效果如何?

@bczhc
Copy link
Author

bczhc commented Jan 30, 2023

加了辅码时,sort改成original也是一样的,字频依然不对。就是不知道该如何解决加了辅码影响了字频的问题。不过实在不行这也不是什么大问题,毕竟可以用辅助码了,也不是特别在意这个单字字频了。

@bigshans
Copy link
Owner

我再研究一下里面的问题。

词库你也可以试一下我个人的词库.

这个反查脚本也挺有用。

from pathlib import PosixPath
import sys

map = {}
need_parser = sys.argv[-1]

with open(PosixPath('~/.local/share/fcitx5/rime/zrm_pinyin.dict.yaml').expanduser(), 'r') as f:
    is_start = False
    for line in f.readlines():
        if not is_start:
            if line == '...\n':
                is_start = True
            continue
        elif line == '\n':
            continue
        ls = line.replace('\n', '').split('\t')
        if len(ls) < 2:
            continue
        if ls[0] in map:
            map[ls[0]].append(ls[1])
        else:
            map[ls[0]] = [ls[1]]

for i in range(len(need_parser)):
    if need_parser[i] in map:
        print(need_parser[i], ' '.join(map[need_parser[i]]))

这东西用多了就挺顺手了,字频日常用用差不多都能调回来。

@bigshans
Copy link
Owner

尝试了一下改顺序,似乎顺序也没有生效。字频目前应该是没有其他办法了。
我个人用起来还好,很多字频都习惯了,加上反查,常用字频基本都调整过来了。
这东西用得开心就好。

@bigshans bigshans closed this as completed Feb 1, 2023
@bczhc
Copy link
Author

bczhc commented Feb 6, 2023

我神奇地发现,使用最新的librime 1.8.5字频就好了。
image
image

经过了测试,发现就是1.8.0修复了,commit是 rime/librime@dd6af3d ,在1.7.3 cherry-pick这个commit一样可以解决。

Windows上就是用 https://github.com/fxliang/weasel/releases 这个地方维护的小狼毫,就用的更新的librime,没有字频问题了。

不管怎样终于算是解决了。

参考:

@bczhc
Copy link
Author

bczhc commented Feb 6, 2023

字频是属于librime的bug,Q&A里可以修改了。也感谢提供了自用的词库,好用。

@bigshans
Copy link
Owner

bigshans commented Feb 6, 2023

好的,已经修正过来了。词库能给你带来便利是最好 :) 。

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

No branches or pull requests

2 participants