45 lines
1.0 KiB
Python
45 lines
1.0 KiB
Python
import heurams.services.timer as timer
|
|
from typing import TypedDict
|
|
|
|
class BaseAlgorithm:
|
|
algo_name = "BaseAlgorithm"
|
|
|
|
class AlgodataDict(TypedDict):
|
|
efactor: float
|
|
real_rept: int
|
|
rept: int
|
|
interval: int
|
|
last_date: int
|
|
next_date: int
|
|
is_activated: int
|
|
last_modify: float
|
|
|
|
defaults = {
|
|
'real_rept': 0,
|
|
'rept': 0,
|
|
'interval': 0,
|
|
'last_date': 0,
|
|
'next_date': 0,
|
|
'is_activated': 0,
|
|
'last_modify': timer.get_timestamp()
|
|
}
|
|
|
|
@classmethod
|
|
def revisor(cls, algodata: dict, feedback: int = 5, is_new_activation: bool = False) -> None:
|
|
"""迭代记忆数据"""
|
|
pass
|
|
|
|
@classmethod
|
|
def is_due(cls, algodata) -> int:
|
|
"""是否应该复习"""
|
|
return 1
|
|
|
|
@classmethod
|
|
def rate(cls, algodata) -> str:
|
|
"""获取评分信息"""
|
|
return ""
|
|
|
|
@classmethod
|
|
def nextdate(cls, algodata) -> int:
|
|
"""获取下一次记忆时间戳"""
|
|
return -1 |