context

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const RunContextFolderPrefix = "seru_reduction_"

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgorithmContext

type AlgorithmContext struct {
	// contains filtered or unexported fields
}

func NewAlgorithmContext

func NewAlgorithmContext(useIsolation bool) *AlgorithmContext

type RunContext

type RunContext struct {
	// contains filtered or unexported fields
}

RunContext holds all data necessary for reduction TODO add metrics like test script count

func NewRunContext

func NewRunContext(givenLanguage, inputFilePath, testScriptPath string, algoContext AlgorithmContext) (*RunContext, error)

func (*RunContext) BestResult

func (ctx *RunContext) BestResult() *candidate.CandidateWithSize

func (*RunContext) CountTokens

func (ctx *RunContext) CountTokens(bytes []byte) int

func (*RunContext) CurrentSemanticStrategy

func (ctx *RunContext) CurrentSemanticStrategy() int

func (*RunContext) ExhaustedSemanticStrategies

func (ctx *RunContext) ExhaustedSemanticStrategies() bool

func (*RunContext) GetHash

func (ctx *RunContext) GetHash() [16]byte

func (*RunContext) GetStrategyName

func (ctx *RunContext) GetStrategyName(index int) string

func (*RunContext) IncrementSemanticStrategy

func (ctx *RunContext) IncrementSemanticStrategy()

func (*RunContext) InputFilename

func (ctx *RunContext) InputFilename() string

func (*RunContext) Language

func (ctx *RunContext) Language() string

func (*RunContext) ReductionDir

func (ctx *RunContext) ReductionDir() string

func (*RunContext) SemanticApplicationMethod

func (ctx *RunContext) SemanticApplicationMethod() SemanticApplicationMethod

func (*RunContext) SemanticReduce

func (ctx *RunContext) SemanticReduce(bytes []byte) ([][]byte, error)

func (*RunContext) SemanticReduceWithStrategy

func (ctx *RunContext) SemanticReduceWithStrategy(bytes []byte, strategyIndex int) ([][]byte, error)

func (*RunContext) SemanticStrategiesTotal

func (ctx *RunContext) SemanticStrategiesTotal() int

func (*RunContext) SetExhaustedSemanticStrategies

func (ctx *RunContext) SetExhaustedSemanticStrategies()

func (*RunContext) Sizes

func (ctx *RunContext) Sizes() SizeContext

func (*RunContext) SyntacticReducer

func (ctx *RunContext) SyntacticReducer() syntactic.Functions

func (*RunContext) TestFilename

func (ctx *RunContext) TestFilename() string

func (*RunContext) UpdateCurrent

func (ctx *RunContext) UpdateCurrent(candidatePath string, candidateSize int) error

type RunContextErr

type RunContextErr struct {
	// contains filtered or unexported fields
}

func NewRunContextErr

func NewRunContextErr(err error) *RunContextErr

func (*RunContextErr) Error

func (e *RunContextErr) Error() string

type SemanticApplicationMethod

type SemanticApplicationMethod string
const (
	ApplyFirstOnly   SemanticApplicationMethod = "ApplyFirstOnly"
	ApplyAllCombined SemanticApplicationMethod = "ApplyAllCombined"
)

type SizeContext

type SizeContext struct {
	StartSizeInTokens int
	BestSizeInTokens  int
}

func (SizeContext) AsPercent

func (s SizeContext) AsPercent() string

Jump to

Keyboard shortcuts

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