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

ankiclient: add four new aggregate frequency markers #238

Merged

Conversation

precondition
Copy link
Contributor

@precondition precondition commented Aug 28, 2024

This commit adds support for 4 new markers (introduced in Yomitan in yomidevs/yomitan#600):

  1. {frequency-harmonic-rank} (Default: 9999999)
  2. {frequency-harmonic-occurrence} (Default: 0)
  3. {frequency-average-rank} (Default: 9999999)
  4. {frequency-average-occurrence} (Default: 0)

These markers aggregate the term frequency information of multiple dictionaries into a single numeric value, often used for sorting Anki cards by frequency.

src/anki/ankiclient.cpp Outdated Show resolved Hide resolved
src/anki/ankiclient.cpp Outdated Show resolved Hide resolved
src/anki/ankiclient.cpp Outdated Show resolved Hide resolved
src/anki/ankiclient.cpp Outdated Show resolved Hide resolved
@ripose-jp
Copy link
Owner

This needs to be fixed. I recommend you download Qt Creator rather than editing .ui files directly.

image

@precondition
Copy link
Contributor Author

precondition commented Aug 29, 2024

This needs to be fixed. I recommend you download Qt Creator rather than editing .ui files directly.
[image]

Fixed in c5671f0. For some reason, Qt Creator mangled the whole file, rendering the diff unreadable so I manually post-processed the XML file to format it in the same order as originally. Additionally, since the description labels have no word wrapping, I omitted the very last part of the descriptions listed on Yomitan's page.

@precondition precondition force-pushed the aggregate-frequency-markers branch from 4e1a940 to c5671f0 Compare August 29, 2024 14:08
@ripose-jp
Copy link
Owner

Looks good. My only request is that you squash all your changes into one commit. You can just git reset HEAD~3, recommit your changes, then force push.

I do have a quick question though. It looks like the only difference between rank and occurrence tags is the default value. Is that all it's supposed to be?

This commit adds support for 4 new markers:
1. {frequency-harmonic-rank} (Default: 9999999)
2. {frequency-harmonic-occurrence} (Default: 0)
3. {frequency-average-rank} (Default: 9999999)
4. {frequency-average-occurrence} (Default: 0)

These markers aggregate the term frequency information of multiple
dictionaries into a single numeric value, often used for sorting Anki
cards by frequency.
@precondition precondition force-pushed the aggregate-frequency-markers branch from c5671f0 to 6fb7b0e Compare August 30, 2024 09:43
@precondition
Copy link
Contributor Author

precondition commented Aug 30, 2024

I do have a quick question though. It looks like the only difference between rank and occurrence tags is the default value. Is that all it's supposed to be?

It is funny you say that because I wondered the same thing. When I asked the question in the #tmw-dev channel, they confirmed that this is how it is indeed supposed to be.

At the moment, it is expected that the user enables exclusively rank-based or occurrence-based dictionaries or else the measure will be totally wrong due to averaging numbers from different scales. A possible extension one can consider is to infer the frequency sorting mode (a simple heuristic checking whether the frequency of の is a single digit number or a multi-digit number would be sufficient I think) and automatically exclude dictionaries that are in a different scale from the computation.

@ripose-jp ripose-jp merged commit f3084f1 into ripose-jp:master Aug 31, 2024
3 checks passed
@ripose-jp
Copy link
Owner

A possible extension one can consider is to infer the frequency sorting mode

I think trusting the user to figure it out on their own is better than employing imperfect heuristics.

Everything looks good. Merging this.

@precondition precondition deleted the aggregate-frequency-markers branch August 31, 2024 10:57
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

Successfully merging this pull request may close these issues.

2 participants