-
Notifications
You must be signed in to change notification settings - Fork 93
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
形码单字会根据词频改变候选词序 #449
Comments
是呢,现在的规则是,第一个汉字永远是词库的第一个汉字,后面的会按照使用频率动态调整,我不知道这个规则合不合理 |
对形码来说固定字序最好,词序我觉得可以调整。 |
或者能否把这个排序方法暴露出来,形码特殊处理 |
型码既涉及字词,又涉及个人词库,公共词库,感觉很绕脑袋,最好能找一个通用的算法,如果找不到,我就将相关函数劈来,方便你们 override |
或者添加一个选项来控制 |
就我个人而言。如果全是字,按词库来。如果字词混合,字按库来排,词按频率。如果全是词,按频率。我记得有次讨论过了 |
现在版本用 cl-lib 写后,看不太懂,不会 hack了。 |
意思是先排字,后排词? 还是先排词后排字? |
先按标准库排字。 |
基本上就是在你的配置中添加类似下面的代码
|
这个怎么用啊?放在require 'pyim 后面吗? 搜索了下,大概明白了履盖的方法。但不知道怎么写这个逻辑,能不能麻烦你帮下忙 |
我试着调整了一下,你可以再试试
|
好的,谢谢。 另外我调试了下,发现获取common-words时的词时,顺序就已经变了。 (pyim-dcache-get "wubi/g" '(code2word)) 这段代码输出:
我理解这个 code2word是不是词库,默认是不会变顺序的?默认顺序应该“一”在最前面(一级简码) 我将dcache删除后,重新启动,输出这样:
|
对,这个顺序不会变,词库什么样子,顺序就是什么样子,除非你添加了多个词库 |
但在我这确实改变顺序了,不知道什么原因。会不会跟我的用法有关系? 我现在有三台机器会相互同步个人词库。定时用 pyim-export-words-and-counts 导出到外部 dict 文件,启动emacs时,再用pyim-import-words-and-counts 分别导进三个词库。现在会生成大量的带日期缓存文件:
|
现在词序是预期的了。
像这些还是会出现,不知道什么原因。 |
这是pyim对个人词库缓存的保护机制,如果个人词库缓存的尺寸发生的变化超过一个阈值,pyim就会backup, 防止缓存损坏导致的数据丢失 |
这种是不是会导致词库变化较大啊。 |
不知道,一般词库 hash-table-count 变化超过20%,就会自动备份, |
好的,谢谢。我定期手动删除吧。 |
如您所说,不同形码用户的需求确实不同。比如说,我作为郑码用户,就希望输入法完全不考虑字词区分,只按词频或者词典顺序进行排序。 既然不同用户需求不同,还希望留出一个选项,至少将“严格按词典文件排序”作为一个候选项? |
@xuan-w 我觉得有特殊需求的同学还是直接 advice 下面的函数吧,比选项更灵活
|
@tumashu 能不能把上面这段写到文档里啊 🙏 |
有段时间没升级了,刚升级到最新,发现形码(五笔)单字会根据词频改变候选词序:
词库里的顺序:
wubi/g 一 与 王
The text was updated successfully, but these errors were encountered: