# Forne Learning Methods
This diretory defines all the learning methods in Forne. Because this is a tool designed to have many more learning methods implemented rapidly in the future, and to make that as easy as possible, both for Git merge conflicts and for developers writing new methods, we allow all methods to be written in Rhai, a very capable and extensible scripting language for Rust.
Each method script defines a few things: a constant called `RESPONSES`, which should be a list of all the responses a user can choose from after they've seen the answer to a question (e.g. `y/n`, `1/2/3/4/5`, `great/good/bad`); a function called `get_weight` that takes in the *method state* for the current term and produces a weighting for it; and an `adjust_card` function that takes in the user's response (which will be one of the elements in `RESPONSES`) and adjusts the method state for that particular card. Note that the filename of the script will be used as its method name, which can be specified on the command line (e.g. `--method <name>`). This does not include the `.rhai` extension.
Essentially, Forne operates by having methods store some arbitrary state for each term in a set, which is then stored in the set file, and the method script is later used to determine the weightings of each term in the set. **The weight of a term determines how likely it is to be presented to the user when the system next needs to choose a term to present.** In general, method state should be kept as lightweight as possible to minimise the burden of storing a method state for every single term for large files (which may incur both storage and I/O penalties for the user).
This project has a general policy of accepting all new methods that are useful, as we want to give people a large choice of what method they use for their own personal learning. Some methods will be intended for cramming, others for longer-term learning, etc. It should be completely possible to implement the full gamut of scientific research on spaced repetition and learning methods through Forne, all in Rhai! If you would like to submit a new method, please open a [pull request](https://github.com/arctic-hen7/forne/pulls) and tell us about it! If you'd like to try out a new method, you can write the Rhai script for it and pass that file to Forne as a method, and it will happily run it, letting you tweak your method to find the best implementation.