libchewing icon indicating copy to clipboard operation
libchewing copied to clipboard

Add a new API to get the frequency of phrases

Open mangokingTW opened this issue 9 years ago • 19 comments

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. http://i.imgur.com/sR6iGnN.png

mangokingTW avatar Mar 31 '16 15:03 mangokingTW

@mangokingTW

Please help to check the CI fails.

czchen avatar Apr 01 '16 16:04 czchen

I will try it, but I need a little time.

mangokingTW avatar Apr 03 '16 18:04 mangokingTW

Coverage Status

Coverage decreased (-1.2%) to 88.295% when pulling 9ecf75504b77ee28a7991843bf5e1529fc961394 on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.

coveralls avatar Apr 04 '16 13:04 coveralls

Coverage Status

Coverage decreased (-1.2%) to 88.295% when pulling 7fc4ce673a3e4a41a063ba87f8af931bd73ccdad on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.

coveralls avatar Apr 04 '16 13:04 coveralls

Coverage Status

Coverage decreased (-1.2%) to 88.319% when pulling 779ab4a05a1e093f97b974e24d949299658b3353 on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.

coveralls avatar Apr 04 '16 13:04 coveralls

Not sure what kind of test should I add, any suggestion? Thx.

mangokingTW avatar Apr 04 '16 14:04 mangokingTW

@mangokingTW : You can propose the APIs that expose statistics information for reviewing.

jserv avatar Apr 04 '16 14:04 jserv

@mangokingTW

You can add test case for the following scenario:

  1. Query phrase frequency.
  2. Enter the phrase.
  3. Query phrase frequency again.

The second frequency shall not be the same as the first one.

czchen avatar Apr 04 '16 15:04 czchen

@mangokingTW : Please use git rebase -i to rework your commits.

jserv avatar Apr 11 '16 16:04 jserv

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 avatar Apr 12 '16 17:04 mangokingTW

@mangokingTW : You don't have to make an apology for personal plans. Instead, you only have to reschedule and let us know.

jserv avatar Apr 12 '16 17:04 jserv

I will try to complete it before this weekend.

mangokingTW avatar Apr 12 '16 17:04 mangokingTW

Coverage Status

Coverage decreased (-0.1%) to 89.384% when pulling bf9f656308b517e197acc3ee2e48c5b1279aa74a on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.

coveralls avatar Apr 17 '16 03:04 coveralls

Coverage Status

Coverage decreased (-0.1%) to 89.384% when pulling abaf42e566fa7307af9ea45cd3bfa78d9cb701a6 on mangokingTW:master into 7fc42654c5a0ed73d2933688b8c07381a3d55cda on chewing:master.

coveralls avatar Apr 17 '16 03:04 coveralls

@mangokingTW : Can you squash the commits? I think we only accept two commits:

  • API changes
  • test case for corresponding APIs

jserv avatar Apr 17 '16 04:04 jserv

Coverage Status

Coverage decreased (-0.1%) to 89.384% when pulling 41a01f10579003c4430b3dbce9fc1da91a8da076 on mangokingTW:master into 5fa23684b0e2270d6ef3de8c9f6b3270f3a52b58 on chewing:master.

coveralls avatar Apr 17 '16 05:04 coveralls

It took a time for me to understand what should I do.

mangokingTW avatar Apr 17 '16 05:04 mangokingTW

@kanru, do you think the proposed change still makes sense?

jserv avatar Jan 08 '24 13:01 jserv

@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.

kanru avatar Jan 08 '24 15:01 kanru