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

Miss a LICENSE #18

Closed
Freed-Wu opened this issue Oct 20, 2023 · 9 comments
Closed

Miss a LICENSE #18

Freed-Wu opened this issue Oct 20, 2023 · 9 comments

Comments

@Freed-Wu
Copy link
Collaborator

Freed-Wu commented Oct 20, 2023

Miss a LICENSE will affect packaging NixOS/nixpkgs#262218.

@Freed-Wu
Copy link
Collaborator Author

If you are busy to do, can you add me to collaborators? @petronny

@petronny
Copy link
Owner

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.

@Freed-Wu
Copy link
Collaborator Author

I found a LICENSE: https://aur.archlinux.org/packages/pinyin-completion:

Licenses: GPL3

@petronny
Copy link
Owner

I found a LICENSE: https://aur.archlinux.org/packages/pinyin-completion

This is my mistake. I will file an issue to the original repository.

@petronny
Copy link
Owner

adaptee#4

@Freed-Wu Freed-Wu pinned this issue Oct 21, 2023
@Freed-Wu
Copy link
Collaborator Author

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:

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.

@petronny
Copy link
Owner

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.

@Freed-Wu
Copy link
Collaborator Author

Freed-Wu commented Oct 21, 2023

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: mozillazg/python-pinyin#310

Currently, can you enable pre-commit.ci?

@petronny
Copy link
Owner

Currently, can you enable pre-commit.ci?

Done.

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