fasiha / ebisu

Public-domain Python library for flashcard quiz scheduling using Bayesian statistics. (JavaScript, Java, Dart, and other ports available!)
https://fasiha.github.io/ebisu
The Unlicense
311 stars 32 forks source link

How difficult do you think it would be to create a C# version of Ebisu? #28

Closed rs-mobitech closed 4 years ago

rs-mobitech commented 4 years ago

I have a platform that uses C# so it's a problem for me that there's no C# version. Do you have any ideas how difficult it would be to port the code to C#? Are there any obstacles such as the availability of libraries that you can think of?

fasiha commented 4 years ago

Not hard! Look at https://github.com/fasiha/ebisu-java as your guide, it implements the core algorithm and only imports these two tiny packages that I wrote for specific needs:

If you already have libraries that do these things, feel free to use them, but if not, both should be straightforward to port to C# also!

Please let me know when you finish and I will be most happy to make a note of it on the Ebisu readme. Also let me know if you run into problems or need help testing (the Java unit test shows you how to verify correctness against the Python implementation, via a JSON file).

One side note—this Python repo implements Ebisu 2.0, which has the new feature where updateRecall takes integer arguments instead of binary (see Changelog), whereas the Java implementation still is the Ebisu 1 algorithm. If you really, really want to port the 2.0 algorithm to C#, and not the 1.0, let me know and I'll update the Java version to 2, hopefully sometime this week 😓?

fasiha commented 4 years ago

Actually, another small note—I'm a beginner at Java so I may have over-engineered the interfaces and the classes 😅. This Python repo for example just uses 3-element arrays to represent Ebisu models. I'll leave it to you how to best design the API for C# 😁.

fasiha commented 4 years ago

Oh, in case it helps, this one-file Go implementation of the entire Ebisu 1.x algorithm might be helpful too:

https://github.com/ap4y/leaf/blob/master/ebisu.go

They have some extra stuff at the top of the file but the majority of the file is a straightforward and legible port of the Python and JavaScript implementations, without the OOP obfuscation of my Java attempt.

fasiha commented 4 years ago

As mentioned in the other repo (https://github.com/fasiha/ebisu-java/issues/8), a C# implementation is available:

https://github.com/nikhildpardasani/Ebisu-CSharp

Feel free to reopen this with any questions!