From ba9fa37cfa51e31e222eed1249df8ae78b35f7c8 Mon Sep 17 00:00:00 2001 From: Jarrett Ye Date: Fri, 13 Sep 2024 12:56:15 +0800 Subject: [PATCH] Fix/typo: schduler -> scheduler (#123) --- __tests__/impl/abstract_scheduler.test.ts | 2 +- ...chduler.test.ts => basic_scheduler.test.ts} | 4 ++-- ...ler.test.ts => long-term_scheduler.test.ts} | 4 ++-- ...tract_schduler.ts => abstract_scheduler.ts} | 0 src/fsrs/fsrs.ts | 18 +++++++++--------- .../{basic_schduler.ts => basic_scheduler.ts} | 2 +- ...term_schduler.ts => long_term_scheduler.ts} | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) rename __tests__/impl/{basic_schduler.test.ts => basic_scheduler.test.ts} (97%) rename __tests__/impl/{long-term_schduler.test.ts => long-term_scheduler.test.ts} (98%) rename src/fsrs/{abstract_schduler.ts => abstract_scheduler.ts} (100%) rename src/fsrs/impl/{basic_schduler.ts => basic_scheduler.ts} (99%) rename src/fsrs/impl/{long_term_schduler.ts => long_term_scheduler.ts} (99%) diff --git a/__tests__/impl/abstract_scheduler.test.ts b/__tests__/impl/abstract_scheduler.test.ts index 8d15ba8..22693da 100644 --- a/__tests__/impl/abstract_scheduler.test.ts +++ b/__tests__/impl/abstract_scheduler.test.ts @@ -6,7 +6,7 @@ import { Rating, } from '../../src/fsrs' -describe('basic schduler', () => { +describe('basic scheduler', () => { const now = new Date() it('[Symbol.iterator]', () => { diff --git a/__tests__/impl/basic_schduler.test.ts b/__tests__/impl/basic_scheduler.test.ts similarity index 97% rename from __tests__/impl/basic_schduler.test.ts rename to __tests__/impl/basic_scheduler.test.ts index cc1ac34..c12bb68 100644 --- a/__tests__/impl/basic_schduler.test.ts +++ b/__tests__/impl/basic_scheduler.test.ts @@ -5,9 +5,9 @@ import { Grade, Rating, } from '../../src/fsrs' -import BasicScheduler from '../../src/fsrs/impl/basic_schduler' +import BasicScheduler from '../../src/fsrs/impl/basic_scheduler' -describe('basic schduler', () => { +describe('basic scheduler', () => { const params = generatorParameters() const algorithm = new FSRSAlgorithm(params) const now = new Date() diff --git a/__tests__/impl/long-term_schduler.test.ts b/__tests__/impl/long-term_scheduler.test.ts similarity index 98% rename from __tests__/impl/long-term_schduler.test.ts rename to __tests__/impl/long-term_scheduler.test.ts index ee31c84..2301eb3 100644 --- a/__tests__/impl/long-term_schduler.test.ts +++ b/__tests__/impl/long-term_scheduler.test.ts @@ -8,7 +8,7 @@ import { State, } from '../../src/fsrs' -describe('Long-term schduler', () => { +describe('Long-term scheduler', () => { const w = [ 0.4197, 1.1869, 3.0412, 15.2441, 7.1434, 0.6477, 1.0007, 0.0674, 1.6597, 0.1712, 1.1178, 2.0225, 0.0904, 0.3025, 2.1214, 0.2498, 2.9466, 0.4891, @@ -225,7 +225,7 @@ describe('Long-term schduler', () => { ]) }) - test('[State.(Re)Learning]switch long-term schduler', () => { + test('[State.(Re)Learning]switch long-term scheduler', () => { // Good(short)->Good(long)->Again(long)->Good(long)->Good(short)->Again(short) const ivl_history: number[] = [] const s_history: number[] = [] diff --git a/src/fsrs/abstract_schduler.ts b/src/fsrs/abstract_scheduler.ts similarity index 100% rename from src/fsrs/abstract_schduler.ts rename to src/fsrs/abstract_scheduler.ts diff --git a/src/fsrs/fsrs.ts b/src/fsrs/fsrs.ts index 3910dbf..00c5594 100644 --- a/src/fsrs/fsrs.ts +++ b/src/fsrs/fsrs.ts @@ -16,15 +16,15 @@ import { import type { int, IPreview } from './types' import { FSRSAlgorithm } from './algorithm' import { TypeConvert } from './convert' -import BasicScheduler from './impl/basic_schduler' -import LongTermScheduler from './impl/long_term_schduler' +import BasicScheduler from './impl/basic_scheduler' +import LongTermScheduler from './impl/long_term_scheduler' export class FSRS extends FSRSAlgorithm { - private Schduler + private Scheduler constructor(param: Partial) { super(param) const { enable_short_term } = this.parameters - this.Schduler = enable_short_term ? BasicScheduler : LongTermScheduler + this.Scheduler = enable_short_term ? BasicScheduler : LongTermScheduler } protected override params_handler_proxy(): ProxyHandler { @@ -40,7 +40,7 @@ export class FSRS extends FSRSAlgorithm { Number(value) ) } else if (prop === 'enable_short_term') { - _this.Schduler = value === true ? BasicScheduler : LongTermScheduler + _this.Scheduler = value === true ? BasicScheduler : LongTermScheduler } Reflect.set(target, prop, value) return true @@ -111,8 +111,8 @@ export class FSRS extends FSRSAlgorithm { now: DateInput, afterHandler?: (recordLog: IPreview) => R ): R { - const Schduler = this.Schduler - const instace = new Schduler(card, now, this satisfies FSRSAlgorithm) + const Scheduler = this.Scheduler + const instace = new Scheduler(card, now, this satisfies FSRSAlgorithm) const recordLog = instace.preview() if (afterHandler && typeof afterHandler === 'function') { return afterHandler(recordLog) @@ -181,8 +181,8 @@ export class FSRS extends FSRSAlgorithm { grade: Grade, afterHandler?: (recordLog: RecordLogItem) => R ): R { - const Schduler = this.Schduler - const instace = new Schduler(card, now, this satisfies FSRSAlgorithm) + const Scheduler = this.Scheduler + const instace = new Scheduler(card, now, this satisfies FSRSAlgorithm) const g = TypeConvert.rating(grade) if (g === Rating.Manual) { throw new Error('Cannot review a manual rating') diff --git a/src/fsrs/impl/basic_schduler.ts b/src/fsrs/impl/basic_scheduler.ts similarity index 99% rename from src/fsrs/impl/basic_schduler.ts rename to src/fsrs/impl/basic_scheduler.ts index f56b53c..5d3447e 100644 --- a/src/fsrs/impl/basic_schduler.ts +++ b/src/fsrs/impl/basic_scheduler.ts @@ -1,4 +1,4 @@ -import { AbstractScheduler } from '../abstract_schduler' +import { AbstractScheduler } from '../abstract_scheduler' import { TypeConvert } from '../convert' import { type Card, diff --git a/src/fsrs/impl/long_term_schduler.ts b/src/fsrs/impl/long_term_scheduler.ts similarity index 99% rename from src/fsrs/impl/long_term_schduler.ts rename to src/fsrs/impl/long_term_scheduler.ts index 3941164..95703ee 100644 --- a/src/fsrs/impl/long_term_schduler.ts +++ b/src/fsrs/impl/long_term_scheduler.ts @@ -1,4 +1,4 @@ -import { AbstractScheduler } from '../abstract_schduler' +import { AbstractScheduler } from '../abstract_scheduler' import { TypeConvert } from '../convert' import { type Card,