Java中间隔重复算法的开源实现 [英] Open Source implementation of a Spaced Repetition Algorithm in Java
问题描述
我从事的项目中,间隔重复是必不可少的,但是我不是该主题的专家,所以我害怕重新发明方形齿轮。我的研究为我指出了两个不同的系统,即Leitner系统和SM系列算法。
我还没有决定哪种系统最适合我的项目。如果我要学习SM,我想我会尝试实现类似于 Anki使用的方法。 / p>
我最好的选择是使用现有的Java库。可能很简单,我只需要计算下一次重复的时间即可。
有人听说过这样的倡议吗?
基本上像这样
public static void calcuateInterval(Card card){
if(card.getEFactor()< 3){
card.setCount(1);
}
int count = card.getCount();
int间隔= 1;
if(count == 2){
interval = 6;
}否则,如果(count> 2){
interval = Math.round(card.getInterval()* card.getEFactor());
}
card.setInterval(interval);
}
如果您真的想要Anki的算法,请查看 Android的Anki可在Github中获得。虽然是GPL,所以您可能需要购买许可证。
I work on a project where Spaced Repetition is essential, however I am not a specialist on the subject and I am afraid to reinvent the square wheel. My research pointed me two different systems, namely the Leitner system and the SM family of algorithms.
I haven't decided yet which system would best fit into my project. If I was to take a SM orientation, I guess I would try to implement something similar to what Anki uses.
My best option would be to use an existing Java library. It could be quite simple, all I need is to compute the time for the next repetition.
Has anyone heard of such an initiative ?
I haven't looked at Anki's implementation but have you seen this one? quiz-me an SRS in Java.
Basically it goes like this
public static void calcuateInterval(Card card) {
if (card.getEFactor() < 3) {
card.setCount(1);
}
int count = card.getCount();
int interval = 1;
if (count == 2) {
interval = 6;
} else if (count > 2) {
interval = Math.round(card.getInterval() * card.getEFactor());
}
card.setInterval(interval);
}
If you really want Anki's algorithm, look through the source of Anki in Android available in Github. It is GPL though so you might need to buy a license.
这篇关于Java中间隔重复算法的开源实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!