ankitects / ankitects/anki

Add a prop:forgotten-rate search key to filter cards by lapse ratio

オープン
#5,401 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
30.5k
フォーク
3.2k
PR マージ指標
PR 指標を取得中

説明

## Problem

Anki already offers `prop:reps` and `prop:lapses`, but there is no way to search for cards *proportionally* forgotten. The absolute `lapses` count is misleading: a card that lapsed once out of 1 review is far more problematic than one that lapsed once out of 100 reviews, yet both match `prop:lapses>0`.

Users who want to surface "problem cards" for targeted relearning (e.g. to catch cards that repeatedly lapse relative to how often they have been seen) currently have to export data or reason about it manually.

## Proposed feature

Add a `prop:forgotten-rate` property search key, computed as:

```
forgotten-rate = lapses / reps
```

Examples:

- `prop:forgotten-rate>0.3` — cards where more than 30% of all reviews ended in a lapse
- `prop:forgotten-rate<=0.5` — cards where at most half of all reviews ended in a lapse
- `prop:forgotten-rate=0` — cards that have never lapsed

Cards with `reps = 0` (never reviewed) are excluded from results, since their rate is undefined.

A short alias `prop:fr` is provided as an exact equivalent of `prop:forgotten-rate`, so `prop:fr>0.3` behaves identically to `prop:forgotten-rate>0.3`.

## Implementation notes

- `rslib/src/search/parser.rs`: adds `PropertyKind::ForgottenRate(f32)` and parses both `forgotten-rate` and the `fr` alias.
- `rslib/src/search/sqlwriter.rs`: emits `(reps > 0 and (1.0 * lapses / reps) )`; the `1.0 *` forces floating-point division instead of SQLite's integer division.
- `rslib/src/search/writer.rs`: normalizes `fr` to `forgotten-rate` on write, so saved searches and sorting stay consistent regardless of which form is typed.
- `docs-site/manual/searching.mdx`: documents the key and its alias.
- `pylib/tests/test_find.py` plus Rust unit tests: cover end-to-end behavior for both forms and several operators.

## Open questions for discussion

- Is the `prop:fr` alias desirable, or is the full name sufficient?
- Should the forgotten rate also be exposed in the Browse screen UI (e.g. as a column)?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。