Learned

object Learned(source)

The learned-rule store: one canonical JSON file, learned.json, in a directory the user names. It holds rules in the schema of rules/, each checked by RuleCompiler on every read. A learned rule never replaces a shipped one, so an id that a shipped rule already uses is refused.

Properties

Link copied to clipboard
const val FILE: String

Functions

Link copied to clipboard
fun add(text: String?, rule: Rule): String

The store text with rule added, or replaced when its id is already there.

Link copied to clipboard
fun parse(text: String): List<Rule>

Every rule of the store text; throws RuleException on the first problem.

Link copied to clipboard
fun path(dir: String): String

The store file inside dir.