Closed Freed-Wu closed 8 months ago
If you are busy to do, can you add me to collaborators? @petronny
Hi, as you can see that this repository is forked from https://github.com/adaptee/pinyin-completion. We may need the permission of the original author to add or change the license.
If you are busy to do, can you add me to collaborators?
Sure.
I found a LICENSE: https://aur.archlinux.org/packages/pinyin-completion:
Licenses: GPL3
I found a LICENSE: https://aur.archlinux.org/packages/pinyin-completion
This is my mistake. I will file an issue to the original repository.
I refactor the code to avoid the problem comes from original repo.
Now this plugin use pypinyin to get the pinyin of every word. We don't need to maintain any extra code except shell plugins.
I have added unit tests and CI/CD to make sure it can work.
Currently, pypinyin can work but not fast:
% hyperfine -r 10 'pypinyin 你好'
Benchmark 1: pypinyin 你好
Time (mean ± σ): 613.4 ms ± 4.9 ms [User: 465.2 ms, System: 147.6 ms]
Range (min … max): 604.5 ms … 619.2 ms 10 runs
% hyperfine -r 10 'echo 你好|pinyin-tool'
Benchmark 1: echo 你好|pinyin-tool
Time (mean ± σ): 435.1 ms ± 10.1 ms [User: 382.1 ms, System: 53.3 ms]
Range (min … max): 425.7 ms … 461.7 ms 10 runs
I have researched alternative tools:
pypinyin
rust-pinyin
. Miss many functions of pypinyin
And if pypinyin
supports:
it should be faster.
However, the above features should be upstream's works and it is not directly related to us.
Now this plugin use pypinyin to get the pinyin of every word. We don't need to maintain any extra code except shell plugins.
This is a great idea. However, I believe pypinyin is using ngram models so the speed will be slow.
We can write a new script with pypinyin
to generate a pinyin_initial.json
file and rewrite the pinyin-comp
with other languages like go or rust to bypass the copyright issue.
We can write a new script with pypinyin
I agree. And the new script also can be contributed to upstream, because I think not only this repo need it. A cache named pinyin_initial.json
store all character's pinyin's initial alphabet can accelerate all projects depends on pypinyin
: https://github.com/mozillazg/python-pinyin/issues/310
Currently, can you enable pre-commit.ci?
Currently, can you enable pre-commit.ci?
Done.
Miss a LICENSE will affect packaging https://github.com/NixOS/nixpkgs/issues/262218.