fsrs

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 2 Imported by: 6

README

go-fsrs

Go Reference Go Report Card Go version

Go module implements Free Spaced Repetition Scheduler algorithm

Install

go get -u github.com/open-spaced-repetition/go-fsrs@latest

Usage

Please see GoDoc and Wiki for documents.

Contributing

Please feel free to submit any Pull Requests. Just be sure not to introduce any breaking changes and do not any functionality excess the scope of the algorithm implementation.

For algorithm problems or discussions, please go open-spaced-repetition/free-spaced-repetition-scheduler.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card added in v0.1.0

type Card struct {
	Due           time.Time `json:"Due"`
	Stability     float64   `json:"Stability"`
	Difficulty    float64   `json:"Difficulty"`
	ElapsedDays   uint64    `json:"ElapsedDays"`
	ScheduledDays uint64    `json:"ScheduledDays"`
	Reps          uint64    `json:"Reps"`
	Lapses        uint64    `json:"Lapses"`
	State         State     `json:"State"`
	LastReview    time.Time `json:"LastReview"`
}

func NewCard added in v0.1.0

func NewCard() Card

type Parameters added in v0.1.0

type Parameters struct {
	RequestRetention float64 `json:"RequestRetention"`
	MaximumInterval  float64 `json:"MaximumInterval"`
	W                Weights `json:"Weights"`
	Decay            float64 `json:"Decay"`
	Factor           float64 `json:"Factor"`
}

func DefaultParam added in v0.1.0

func DefaultParam() Parameters

func (*Parameters) Repeat added in v0.1.0

func (p *Parameters) Repeat(card Card, now time.Time) map[Rating]SchedulingInfo

type Rating added in v0.1.0

type Rating int8
const (
	Again Rating = iota + 1
	Hard
	Good
	Easy
)

func (Rating) String added in v0.1.0

func (s Rating) String() string

type ReviewLog added in v0.1.0

type ReviewLog struct {
	Rating        Rating    `json:"Rating"`
	ScheduledDays uint64    `json:"ScheduledDays"`
	ElapsedDays   uint64    `json:"ElapsedDays"`
	Review        time.Time `json:"Review"`
	State         State     `json:"State"`
}

type SchedulingInfo added in v0.1.0

type SchedulingInfo struct {
	Card      Card
	ReviewLog ReviewLog
}

type State added in v0.1.0

type State int8
const (
	New State = iota
	Learning
	Review
	Relearning
)

type Weights added in v1.0.0

type Weights [17]float64

func DefaultWeights added in v1.0.0

func DefaultWeights() Weights

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL