0.1.2 • Published 5 years ago

@byem.io/sm2 v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Implementation of SuperMemo 2 algorithm

Check this article for detail: https://www.supermemo.com/english/ol/sm2.htm

Install

npm i @byem.io/sm2

Usage

import { ScheduleTrainer, Input } from './index';

const input: Input = {
    currentRepetition: 0, // the current repetition counter
    lastEasinessFactor: 2.5, // the easiness factor (E-Factor) used in last calculation
    lastInterval: 0, // the last interval amount 
    qualityAssessment: 4 // the quality of review [0-5] -> worst to best
};

new ScheduleTrainer().train(input)
    .then(result => {
        // result:         
        // {
        //     repetition: number; // the repetition counter (will be reseted in failures)
        //     interval: number; // the interval amount until next review
        //     easiness: number; // the easiness factor (E-Factor) that next be used in the next training
        //     repeat: boolean; // if is true the item must be reviewed until the quality assesment isn't not less than four
        // }
    })
    .catch(console.error);
0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago