-
Notifications
You must be signed in to change notification settings - Fork 53
src/anki/notebuilder: allow filtering only lowest frequency #286
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change overall, but one thing you're overlooking is that not all frequency dictionaries encode numbers or integers. For example, VNFreq encodes floating points from 0 to 100. Testing this out, this isn't support by Memento, but it should be, so I'll fix that later. An older edition of this dictionary used strings with 1 to 5 star characters. I don't really care how you handle these cases, but you should make a conscious choice.
Also make sure to document your markers on the UI help page.
@ripose-jp
I converted the method to use double values so it could support future updates for memento and other dictionaries that don't use integers only. regarding
I couldn't find the older version of this dictionary in shoui dictionary collection the VNFreq is V2 which uses int values from 1 to 35k similar to JPDB and others I would say that I created an helper function that tries to parse the string value of the frequency to double and if it fails it gives a default value of 1000.0. but when the export happens, I use the original string value of the dictionary |
This feature extends the ``{frequencies}`` marker with the extended marker syntax and adds two new options: ``min-value`` which allows to export only the lowest value frequency out of all the options and ``value-only`` which strips the dictionary name and html list format to keep only raw numbers. This allow memento to support card format that rely on raw frequency values to sort their cards.
I made an update to your branch. I found that returning 1000 for unusable values caused some problems. Particularly JPDB includes 1451 and 271907㋕ for 口を開けて. If |
I'm perplexed how you spotted that edge case(s). Honestly I don't think I have anything on top of my head that could be help improve it, I'm not really knowledgeable on the wide variety of dictionaries. |
Just dumb luck skipping around Spirited Away. I can't think of any other problems with this PR, so I'm merging it. |
Closes #202
This feature extends the
{frequencies}
marker with the extended marker syntax and adds two new options:min-value
which allows to export only the lowest value frequency out of all the options andvalue-only
which strips the dictionary name and html list format to keep only raw numbers.This allow memento to support card format that rely on raw frequency values to sort their cards.
Example of results:

{frequencies}
or{frequencies:min-value=false,value-only=false}
{frequencies:min-value=true,value-only=false}
{frequencies:min-value=false,value-only=true}
(note: values are separated by\n
){frequencies:min-value=true,value-only=true}
Edit: I would add that this essentially serves the same end result of
{frequency-harmonic-rank}
andfrequency-average-rank
, to sort anki cards base on frequency values, but by having different values. So this might not bring any novel/unique features to memento but allow for users to have more variety on some of the values/fields