fsrs

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 2 Imported by: 6

README

go-fsrs

Go Reference Go Report Card

Go module implements Free Spaced Repetition Scheduler algorithm

Usage

I'm developing a more useful module, the current module is only the algorithm implementation.

Please see GoDoc and Wiki for documents.

The Module Is in Very Early Stage, and It's Subject to Change

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
	MaximumInterval  float64
	EasyBonus        float64
	HardFactor       float64
	W                weights
}

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
	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 SchedulingCards added in v0.1.0

type SchedulingCards struct {
	Again Card
	Hard  Card
	Good  Card
	Easy  Card
}

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
)

Jump to

Keyboard shortcuts

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