mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Update to latest FSRS
This commit is contained in:
parent
3713c86373
commit
c67f510b9a
8 changed files with 14 additions and 10 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1457,7 +1457,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fsrs"
|
name = "fsrs"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/open-spaced-repetition/fsrs-rs.git?rev=67163045ba9916e8a41f384fdb5ea414773139bd#67163045ba9916e8a41f384fdb5ea414773139bd"
|
source = "git+https://github.com/open-spaced-repetition/fsrs-rs.git?rev=96ae7fca09f17723ec514a1d633d36c3a09779f4#96ae7fca09f17723ec514a1d633d36c3a09779f4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"burn",
|
"burn",
|
||||||
"itertools 0.11.0",
|
"itertools 0.11.0",
|
||||||
|
|
|
@ -36,7 +36,7 @@ rev = "184b2ca50ed39ca43da13f0b830a463861adb9ca"
|
||||||
|
|
||||||
[workspace.dependencies.fsrs]
|
[workspace.dependencies.fsrs]
|
||||||
git = "https://github.com/open-spaced-repetition/fsrs-rs.git"
|
git = "https://github.com/open-spaced-repetition/fsrs-rs.git"
|
||||||
rev = "67163045ba9916e8a41f384fdb5ea414773139bd"
|
rev = "96ae7fca09f17723ec514a1d633d36c3a09779f4"
|
||||||
# path = "../../../fsrs-rs"
|
# path = "../../../fsrs-rs"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
|
|
|
@ -330,6 +330,8 @@ deck-config-which-deck = Which deck would you like to display options for?
|
||||||
deck-config-updating-cards = Updating cards: { $current_cards_count }/{ $total_cards_count }...
|
deck-config-updating-cards = Updating cards: { $current_cards_count }/{ $total_cards_count }...
|
||||||
deck-config-invalid-weights = Parameters must be either left blank to use the defaults, or must be 17 comma-separated numbers.
|
deck-config-invalid-weights = Parameters must be either left blank to use the defaults, or must be 17 comma-separated numbers.
|
||||||
deck-config-not-enough-history = Insufficient review history to perform this operation.
|
deck-config-not-enough-history = Insufficient review history to perform this operation.
|
||||||
|
deck-config-unable-to-determine-desired-retention =
|
||||||
|
Unable to determine an optimal retention.
|
||||||
deck-config-must-have-1000-reviews =
|
deck-config-must-have-1000-reviews =
|
||||||
{ $count ->
|
{ $count ->
|
||||||
[one] Only { $count } review was found.
|
[one] Only { $count } review was found.
|
||||||
|
@ -352,6 +354,7 @@ deck-config-fsrs-on-all-clients =
|
||||||
not work correctly if one of your clients is older.
|
not work correctly if one of your clients is older.
|
||||||
deck-config-estimated-retention = Estimated retention: { $num }
|
deck-config-estimated-retention = Estimated retention: { $num }
|
||||||
deck-config-complete = { $num }% complete.
|
deck-config-complete = { $num }% complete.
|
||||||
|
deck-config-iterations = Iteration: { $count }...
|
||||||
deck-config-reschedule-cards-on-change = Reschedule cards on change
|
deck-config-reschedule-cards-on-change = Reschedule cards on change
|
||||||
deck-config-fsrs-tooltip =
|
deck-config-fsrs-tooltip =
|
||||||
The Free Spaced Repetition Scheduler (FSRS) is an alternative to Anki's legacy SuperMemo 2 (SM2) scheduler.
|
The Free Spaced Repetition Scheduler (FSRS) is an alternative to Anki's legacy SuperMemo 2 (SM2) scheduler.
|
||||||
|
|
|
@ -43,6 +43,7 @@ impl AnkiError {
|
||||||
AnkiError::InvalidMethodIndex
|
AnkiError::InvalidMethodIndex
|
||||||
| AnkiError::InvalidServiceIndex
|
| AnkiError::InvalidServiceIndex
|
||||||
| AnkiError::FsrsWeightsInvalid
|
| AnkiError::FsrsWeightsInvalid
|
||||||
|
| AnkiError::FsrsUnableToDetermineDesiredRetention
|
||||||
| AnkiError::FsrsInsufficientData => Kind::InvalidInput,
|
| AnkiError::FsrsInsufficientData => Kind::InvalidInput,
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
AnkiError::WindowsError { .. } => Kind::OsError,
|
AnkiError::WindowsError { .. } => Kind::OsError,
|
||||||
|
|
|
@ -115,6 +115,7 @@ pub enum AnkiError {
|
||||||
InvalidServiceIndex,
|
InvalidServiceIndex,
|
||||||
FsrsWeightsInvalid,
|
FsrsWeightsInvalid,
|
||||||
FsrsInsufficientData,
|
FsrsInsufficientData,
|
||||||
|
FsrsUnableToDetermineDesiredRetention,
|
||||||
SchedulerUpgradeRequired,
|
SchedulerUpgradeRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,6 +175,9 @@ impl AnkiError {
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
AnkiError::WindowsError { source } => format!("{source:?}"),
|
AnkiError::WindowsError { source } => format!("{source:?}"),
|
||||||
|
AnkiError::FsrsUnableToDetermineDesiredRetention => tr
|
||||||
|
.deck_config_unable_to_determine_desired_retention()
|
||||||
|
.into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ impl From<FSRSError> for AnkiError {
|
||||||
fn from(err: FSRSError) -> Self {
|
fn from(err: FSRSError) -> Self {
|
||||||
match err {
|
match err {
|
||||||
FSRSError::NotEnoughData => AnkiError::FsrsInsufficientData,
|
FSRSError::NotEnoughData => AnkiError::FsrsInsufficientData,
|
||||||
|
FSRSError::OptimalNotFound => AnkiError::FsrsUnableToDetermineDesiredRetention,
|
||||||
FSRSError::Interrupted => AnkiError::Interrupted,
|
FSRSError::Interrupted => AnkiError::Interrupted,
|
||||||
FSRSError::InvalidWeights => AnkiError::FsrsWeightsInvalid,
|
FSRSError::InvalidWeights => AnkiError::FsrsWeightsInvalid,
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ impl Collection {
|
||||||
|ip| {
|
|ip| {
|
||||||
anki_progress
|
anki_progress
|
||||||
.update(false, |p| {
|
.update(false, |p| {
|
||||||
p.total = ip.total as u32;
|
|
||||||
p.current = ip.current as u32;
|
p.current = ip.current as u32;
|
||||||
})
|
})
|
||||||
.is_ok()
|
.is_ok()
|
||||||
|
|
|
@ -180,10 +180,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
optimalRetentionRequest.search = `preset:"${state.getCurrentName()}"`;
|
optimalRetentionRequest.search = `preset:"${state.getCurrentName()}"`;
|
||||||
const resp = await computeOptimalRetention(optimalRetentionRequest);
|
const resp = await computeOptimalRetention(optimalRetentionRequest);
|
||||||
optimalRetention = resp.optimalRetention;
|
optimalRetention = resp.optimalRetention;
|
||||||
if (computeRetentionProgress) {
|
computeRetentionProgress = undefined;
|
||||||
computeRetentionProgress.current =
|
|
||||||
computeRetentionProgress.total;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
(progress) => {
|
(progress) => {
|
||||||
if (progress.value.case === "computeRetention") {
|
if (progress.value.case === "computeRetention") {
|
||||||
|
@ -217,11 +214,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
function renderRetentionProgress(
|
function renderRetentionProgress(
|
||||||
val: ComputeRetentionProgress | undefined,
|
val: ComputeRetentionProgress | undefined,
|
||||||
): String {
|
): String {
|
||||||
if (!val || !val.total) {
|
if (!val) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
const pct = ((val.current / val.total) * 100).toFixed(0);
|
return tr.deckConfigIterations({ count: val.current });
|
||||||
return tr.deckConfigComplete({ num: pct });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function estimatedRetention(retention: number): String {
|
function estimatedRetention(retention: number): String {
|
||||||
|
|
Loading…
Reference in a new issue