Skip to content

Commit

Permalink
Feat/get retrievability
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock committed Sep 12, 2024
1 parent 3c34707 commit 8babacb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fsrs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ func (f *FSRS) Repeat(card Card, now time.Time) RecordLog {
func (f *FSRS) Next(card Card, now time.Time, grade Rating) SchedulingInfo {
return f.scheduler(card, now).Review(grade)
}

func (f *FSRS) GetRetrievability(card Card, now time.Time) float64 {
if card.State == New {
return 0
} else {
elapsedDays := now.Sub(card.LastReview).Hours() / 24
retrievability := f.Parameters.forgettingCurve(elapsedDays, card.Stability)
return retrievability
}
}

0 comments on commit 8babacb

Please sign in to comment.