context

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const RunContextFolderPrefix = "seru_reduction_"

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgorithmConfig

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

func NewAlgorithmConfig

func NewAlgorithmConfig(useIsolation bool, reducer syntactic.Reducer, activeStrategies *collection.Set) *AlgorithmConfig

func (AlgorithmConfig) String

func (a AlgorithmConfig) String() string

type RunContext

type RunContext struct {
	Metrics *metrics.Iterations
	// contains filtered or unexported fields
}

RunContext holds all data necessary for reduction

func NewRunContext

func NewRunContext(givenLanguage, inputFilePath, testScriptPath string, algorithmConfig AlgorithmConfig) (*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) GetStrategyNames

func (ctx *RunContext) GetStrategyNames() []string

func (*RunContext) IncrementSemanticStrategy

func (ctx *RunContext) IncrementSemanticStrategy()

func (*RunContext) InputDir

func (ctx *RunContext) InputDir() string

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) ShouldSkipStrategy

func (ctx *RunContext) ShouldSkipStrategy(strategyIndex int) bool

func (*RunContext) Sizes

func (ctx *RunContext) Sizes() SizeContext

func (*RunContext) StartTimeFormatted

func (ctx *RunContext) StartTimeFormatted() string

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
}

Jump to

Keyboard shortcuts

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