gen

package
v0.1.74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gen builds the synthetic sets of the extended measurement: pages of the workbook in the format tutor-workbook and essays in the format tutor-essays, as many as a run needs, each with its truth by construction. A page's numbers are drawn at random, and every box is written as its scenario says; an essay is put together from sentences written here, and each criterion it does not meet comes from a change made to it on purpose. No model writes a word of them, so that the program, and not a model's word, holds whether an essay keeps to its topic and spells its words right. The same seed builds the same set again, on any machine.

Index

Constants

View Source
const (
	CorrectNotes        = 10
	CorrectNoTechniques = 10
)

CorrectNotes is how many sheets of the set carry a note at the side: two of each kind of note, one in Russian and one in English. CorrectNoTechniques is how many of the other sheets are of a task that names no technique: a task of a module may name none.

View Source
const (
	WordsNotes   = 10
	WordsNoFound = 10
)

WordsNotes is how many sheets of the set carry a note at the side: two of each kind of note, one in Russian and one in English. WordsNoFound is how many of the other sheets have no trap found: the program finds the trap of a cell only when the learner's value is one of its trap values.

Variables

View Source
var ErrTasks = errors.New("gen: a plan holds at least one task and at most sample.MaxSheets sheets")

ErrTasks is the error of a number of tasks the generator does not make: none, or more than a plan holds, sample.MaxSheets, since the name of a sheet's file holds its number in two digits. More sheets go into several plans, each with its own seed and prefix.

Functions

func Correct added in v0.1.34

func Correct(plan *sample.Plan, bank *sample.Bank, planFile string, seed uint64) (*sample.Plan, *correct.Cases, error)

Correct is the set of the words after a correct answer of a plan of lines and its bank, from the seed: a plan of parts of every sheet of the plan whose answer is right, its lines the parts of the main column, in their order, and then CorrectNotes of its sheets of the scenario correct, with no erasure, once more, each with a note at the side after its last line, two of each kind, one in Russian and one in English; and the cases on it, named for the plan's file:

  • a case in each language with the work on every sheet without a note;
  • a case without the work, as for a task whose answer slots are bound choice alone, on every sheet without a note, in Russian and English in turn;
  • a case in each language on every sheet with a note.

The techniques are those of the task's kind (techniques), but none on CorrectNoTechniques of the sheets without a note. The same seed gives the same set.

func Essays

func Essays(essays int, seed uint64) (*sample.Essays, error)

Essays builds essays on the rubric of eval/essays.json, from the seed: the first devCount of them for the development, and the rest for the test. In each part the essays leave unmet one criterion in a quarter of the essays each, a fifth of them none and the rest one to three (unmetSets), and the topics come by turns, each once before any comes again. An essay is put together from the sentences of its topic, and changed for each criterion it does not meet (essayOf). The essays pass their check, or Essays returns an error.

func NearSheets

func NearSheets(tasks int, seed uint64, prefix string) (*sample.Bank, *sample.Plan, error)

NearSheets is a bank of generated tasks whose keys end in a digit of a pair, each with its near key — the key with that digit replaced by its pair's — as its false key, and a plan of two sheets a task in the scenario similar-digits: the correct sheet, which a reading reads with the near key, and the sheet whose answer is the near key, which it reads with the right one. The answer's last digit of either leans toward its pair as far as draw is told.

func Paper added in v0.1.59

func Paper(n int, seed uint64) (*paperset.Set, error)

Paper builds the set of a task from paper from the seed: n cases, the kinds in turn — an expression, an equation, a word problem, a choice, an open task and several tasks, 2 to 4 equations under one instruction —, and the work of each task in turn right, wrong and blank, an open task's blank and unchecked, since no key judges a line. The key of a formula is the solver's on it, so the set holds no answer a program did not compute; the key of a word problem and of a choice is built with it. The first devCount cases go to the development.

func Sheets

func Sheets(tasks int, seed uint64, prefix string) (*sample.Bank, *sample.Plan, error)

Sheets is a bank of generated tasks and a plan of their sheets, the truth of each by construction: six sheets a task — correct, an error of each of two traps, a mistake erased and written right, a right step erased and written wrong, and a second correct solution, shorter for a chain and with a check after the answer for an equation. Of ten tasks, that is 14 correct sheets, 20 with an error, 10 of each erasure and 6 with the answer not last, against 12, 12, 7 and 2 of 40 in eval/sheets.json. The tasks are chains and equations, in turn, with numbers drawn from the seed: the same seed gives the same bank and plan. Their IDs begin with prefix.

func Words added in v0.1.19

func Words(plan *sample.Plan, bank *sample.Bank, planFile string, seed uint64) (*sample.Plan, *hint.Cases, error)

Words is the set of the words of a plan of lines and its bank, from the seed: a plan of parts of every sheet with a mistake of the plan, its lines the parts of the main column, in their order, and then WordsNotes of its sheets of the scenario error once more, each with a note at the side after its last line, two of each kind, one in Russian and one in English; and the cases on it, named for the plan's file:

  • a case of each rung in each language with the work on every sheet without a note, the questions of the rungs below asked;
  • the rung put another way, without the work, at every rung on every sheet without a note, in Russian and English in turn, the question of the rung itself asked too;
  • a case of each rung in each language on every sheet with a note.

The trap found is the sheet's planned trap, but on WordsNoFound of the sheets without a note. The same seed gives the same set.

func WordsCases added in v0.1.20

func WordsCases(plan *sample.Plan, bank *sample.Bank, planFile string, seed uint64) (*hint.Cases, error)

WordsCases are the cases of the words on the sheets with a mistake of a plan whose sheets are written already, such as the author's: no note and no plan of their own, but for each sheet with a mistake a case of each rung in each language with the work, the questions of the rungs below asked, and the rung put another way at every rung, in Russian and English in turn, the question of the rung itself asked too. The trap found is the sheet's planned trap, none when it has none; the plan may be of lines or of parts. The cases are named for the plan's file, and the same seed gives the same cases.

func Workbook

func Workbook(pages int, seed uint64) (*sample.Workbook, error)

Workbook builds the pages of a workbook, each of the ten items of eval/workbook.json with numbers of its own and its eleven boxes written as pageScenarios says, from the seed. The first pages go to the development, devCount of them, and the rest to the test. A fraction is written stacked or inline by turns, box after box across the workbook, as in eval/workbook.json. The workbook passes its check and its layout, or Workbook returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL