Anki VN Sorter
Hi I vibe coded this addon
it's a sorting addon for new flashcards in anki.
Other sorting algorithms:
- Go by frequency alone, so similar kanji aren't bundled up together
this addon uses an advanced algorithm (I actually wrote it, but the AI implemented it. No idea if it's the most optimal, but I was going back and forth and double checking my new card order and this one looks like it works)
The idea is:
Reduce the struggle. Words with all Kanji known or only kana appear first, UNLESS there is a super high frequency word you are missing
Basically, if you know all the kanji the word is super easy so you should see it first.
it also works for other things not just visual novels
Algorithm
- Candidate selection: The default query is
note:Kiku is:new -is:suspended. Review and learning cards are ignored. - Known-kanji extraction: The add-on searches mature cards using
matureQueryor the generatedmatureDaysquery. It reads theExpressionfield from those mature Kiku notes and extracts kanji characters. If a kanji appears there, it counts as known. - Frequency source selection: The active list comes from
jitenFrequencyListId. The default isglobal. The add-on tries to use:- the fresh cache for the selected list
- the live Jiten export API for the selected list
- the stale cache for the selected list
- the bundled
Globalsnapshot when the selected list isglobal - Kiku
FreqSortonly if no Jiten data is available
- Per-card features: For each candidate card, the add-on reads:
Expression- extracted kanji count
- known kanji count
- Jiten rank from the selected list
- Kiku
FreqSortrank as fallback
- Blended scoring: The default score is:This means:
- absolute frequency score from Jiten, or
FreqSortas fallback - multiplied by a readability adjustment:
all_kanji_known:1.00kana_only:0.92- unknown kanji:
1 - min(0.18 * unknown_kanji_count, 0.54)
- plus a small partial-known bonus:
0.04 * coverage_scorefor cards that still have unknown kanji
- absolute frequency score from Jiten, or
- similar-frequency known-kanji cards usually beat kana-only cards
- super common kana-only cards can still rise early
- super common one-unknown-kanji cards can outrank weaker easy cards
- harder unknown-kanji cards still sink unless their frequency is very strong
- Final ordering: Cards are sorted by:The older
easy_first_tiered_v1mode still exists if you want strict buckets.- higher blended score
- then better raw rank
- then shorter expression length when
preferShorterExpressions = true - then current due
- then card template order
- then card id
- Repositioning: The add-on calls Anki’s internal new-card reposition API. It starts from the minimum due among the eligible cards and only reorders the matching new cards. Non-matching cards are left alone as much as possible.
There are also optional strategies, easy_first_tiered_v1 and balanced_ease_v1, but the default and recommended path is frequency_first_soft_v1.