定制 devdch/fsrs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

devdch/fsrs

Composer 安装命令:

composer require devdch/fsrs

包简介

Free Spaced Repetition Scheduler (FSRS) algorithm implementation in PHP.

关键字:

README 文档

README

Free Spaced Repetition Scheduler (FSRS) algorithm implementation in PHP

More info about FSRS here: https://github.com/open-spaced-repetition/awesome-fsrs

Example:

use Fsrs\Config\Config;
use Fsrs\DTO\Card;
use Fsrs\Enum\RatingEnum;
use Fsrs\Enum\StateEnum;
use Fsrs\Scheduler;

// All params are optional (default config will be used).
$scheduler = new Scheduler(config: new Config(
    weights: [
        0.40255,
        1.18385,
        3.173,
        15.69105,
        7.1949,
        0.5345,
        1.4604,
        0.0046,
        1.54575,
        0.1192,
        1.01925,
        1.9395,
        0.11,
        0.29605,
        2.2698,
        0.2315,
        2.9898,
        0.51655,
        0.6621,
    ],
    desiredRetention: 0.9,
    learningSteps: [60, 600,],
    relearningSteps: [600,],
    maximumInterval: 36500,
    enableFuzzing: true,
));

$card = new Card();

$card = $scheduler->reviewCard(
    card: $card,
    rating: RatingEnum::Good,
    reviewDatetime: new DateTimeImmutable('now', Config::getTimezone())
)->card;

统计信息

  • 总下载量: 279
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-13