Anki VN Sorter

Anki VN Sorter
Photo by Sung Jin Cho / Unsplash

Hi I vibe coded this addon

GitHub - bee-san/anki_sorter: Anki add-on for prioritizing new Kiku cards with VN-focused new-card sorting.
Anki add-on for prioritizing new Kiku cards with VN-focused new-card sorting. - bee-san/anki_sorter

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

  1. Candidate selection: The default query is note:Kiku is:new -is:suspended. Review and learning cards are ignored.
  2. Known-kanji extraction: The add-on searches mature cards using matureQuery or the generated matureDays query. It reads the Expression field from those mature Kiku notes and extracts kanji characters. If a kanji appears there, it counts as known.
  3. Frequency source selection: The active list comes from jitenFrequencyListId. The default is global. 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 Global snapshot when the selected list is global
    • Kiku FreqSort only if no Jiten data is available
  4. 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 FreqSort rank as fallback
  5. Blended scoring: The default score is:This means:
    • absolute frequency score from Jiten, or FreqSort as fallback
    • multiplied by a readability adjustment:
      • all_kanji_known: 1.00
      • kana_only: 0.92
      • unknown kanji: 1 - min(0.18 * unknown_kanji_count, 0.54)
    • plus a small partial-known bonus:
      • 0.04 * coverage_score for cards that still have unknown kanji
    • 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
  6. Final ordering: Cards are sorted by:The older easy_first_tiered_v1 mode 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
  7. 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.