libchewing
libchewing copied to clipboard
Add a new API to get the frequency of phrases
I think adding a new API to get the frequency of phrases is good for statistics or visualization.
For example, in my other project, I put a bar chart of frequency in chewing-editor.

@mangokingTW
Please help to check the CI fails.
I will try it, but I need a little time.
Coverage decreased (-1.2%) to 88.295% when pulling 9ecf75504b77ee28a7991843bf5e1529fc961394 on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.
Coverage decreased (-1.2%) to 88.295% when pulling 7fc4ce673a3e4a41a063ba87f8af931bd73ccdad on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.
Coverage decreased (-1.2%) to 88.319% when pulling 779ab4a05a1e093f97b974e24d949299658b3353 on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.
Not sure what kind of test should I add, any suggestion? Thx.
@mangokingTW : You can propose the APIs that expose statistics information for reviewing.
@mangokingTW
You can add test case for the following scenario:
- Query phrase frequency.
- Enter the phrase.
- Query phrase frequency again.
The second frequency shall not be the same as the first one.
@mangokingTW : Please use git rebase -i to rework your commits.
I had a trip to other country for few days at last week. And it is the mid-term week for my school now. My work is delayed. Sorry about that.
@mangokingTW : You don't have to make an apology for personal plans. Instead, you only have to reschedule and let us know.
I will try to complete it before this weekend.
Coverage decreased (-0.1%) to 89.384% when pulling bf9f656308b517e197acc3ee2e48c5b1279aa74a on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.
Coverage decreased (-0.1%) to 89.384% when pulling abaf42e566fa7307af9ea45cd3bfa78d9cb701a6 on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.
@mangokingTW : Can you squash the commits? I think we only accept two commits:
- API changes
- test case for corresponding APIs
Coverage decreased (-0.1%) to 89.384% when pulling 41a01f10579003c4430b3dbce9fc1da91a8da076 on mangokingTW:master into 5fa23684b0e2270d6ef3de8c9f6b3270f3a52b58 on chewing:master.
It took a time for me to understand what should I do.
@kanru, do you think the proposed change still makes sense?
@kanru, do you think the proposed change still makes sense?
I think it makes sense to expose an API to retrieve the frequency information. Currently this is already supported by the Dictionary trait in the rust version.
If we are going to expose a C API, I feel it should work with the iterator interface instead of another search by bopomofo one.