Skip to content

Commit

Permalink
Fix/typo: schduler -> scheduler (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
L-M-Sherlock authored Sep 13, 2024
1 parent 01e9a56 commit ba9fa37
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion __tests__/impl/abstract_scheduler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Rating,
} from '../../src/fsrs'

describe('basic schduler', () => {
describe('basic scheduler', () => {
const now = new Date()

it('[Symbol.iterator]', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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[] = []
Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions src/fsrs/fsrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<FSRSParameters>) {
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<FSRSParameters> {
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AbstractScheduler } from '../abstract_schduler'
import { AbstractScheduler } from '../abstract_scheduler'
import { TypeConvert } from '../convert'
import {
type Card,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AbstractScheduler } from '../abstract_schduler'
import { AbstractScheduler } from '../abstract_scheduler'
import { TypeConvert } from '../convert'
import {
type Card,
Expand Down

0 comments on commit ba9fa37

Please sign in to comment.