Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/typo: schduler -> scheduler #123

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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