convert

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: 10 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 convert writes the sheets of tutor-sample v0, a format the record mode of the board does not write, as samples of spec's eval protocol, the message Sample of novatrail.eval.v1: the author's sheets as a person's, at random by ID and by the author's writer's code, and the sheets code drew as the samples tutor-eval draw draws, to the byte, once the same code is found to draw them from the seed. It is the one reader of tutor-sample v0: the pressure of a point, which no sample of the protocol holds, it reads only to tell a mouse from a pen.

Index

Constants

View Source
const Mouse = 0.5

Mouse is the pressure that a device without pressure, a mouse, reports at every point while its button is down (Pointer Events), and that the record page kept so.

Variables

View Source
var ErrOtherDrawing = errors.New("the code of today does not draw the sheet so from the seed: it was drawn with another seed or share of the shift, or before a change of the drawing; draw it again with tutor-eval draw")

ErrOtherDrawing is a sheet that code drew which the code of today, from the seed given, does not draw the same: another seed, another share of the shift, or a hand drawn before a change of internal/synth. Its sample is not written, since it would not be what its ID says.

Functions

func Read

func Read(r io.Reader) (*sample.Sample, string, error)

Read reads a sample of tutor-sample v0 as strictly as the format was always read, every field present and no other, checks it on its own (sample.Check), and gives the sheet without the pressure, with the pointer that wrote it: "mouse" when every point has the pressure Mouse, and "pen" otherwise. An error from a sample that fails the check is a *sample.FormatError.

Types

type Converted

type Converted struct {
	Data    []byte
	Writer  sample.Writer
	Pointer string
	Outcome sample.Outcome
}

Converted is a sheet written as a sample of the protocol: the file's bytes, and what a summary names of it without the handwriting — who wrote it, the pointer, and its outcome as the verdict of module-kit on its truth gives it, by the task's key.

func Sheet

func Sheet(data []byte, sh *sample.PlanSheet, b *evalsample.Bank, o Options) (*Converted, error)

Sheet writes a file of tutor-sample v0 for its plan sheet as a sample of the protocol, with its bank, and reads the sample back as the runner will, refusals and all (evalsample.Read):

  • a sheet a person wrote is a person's sample (evalsample.PersonOf), with its strokes as they were written, by the pointer that wrote them;
  • a sheet code drew is the sample tutor-eval draw writes for it (evalsample.Of), once the code of today draws it the same from the seed; otherwise ErrOtherDrawing.

A sheet of another task or scenario than its plan sheet's, one that does not pass the check with the bank, and one whose markup the protocol does not take — a stroke in no part, an inscription to steer the model, a whole solution whose truth its markup does not give — is an error, and nothing of it is written.

type Options

type Options struct {
	Plan  string
	Seed  uint64
	Shift float64
	ID    func() (string, error)
	Code  func() (string, error)
}

Options are what a conversion takes besides the file: for a sheet code drew, the path of its plan's file, which its ID is of, the seed and the share of the shift it was drawn with (evalsample.ID); for a sheet a person wrote, where its ID and its writer's code come from (evalsample.NewID and evalsample.WriterCodeAt, so a file is asked for only when a person's sheet is converted).

Jump to

Keyboard shortcuts

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