fromJson

fun fromJson(name: String, json: String): GuardCorpus

Loads a corpus from JSON of the shape kmemo's own corpora use.

{ "pairs": [ { "a": "...", "b": "...", "shouldMatch": false, "category": "dosage" } ] }

category is optional. Anything else in the file is ignored, so a corpus may carry provenance fields of its own without this refusing to read it.