dank

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 6 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DFAState

type DFAState struct {
	ID      int
	NFAIDs  []int // sorted for key
	Trans   map[byte]int
	IsFinal bool
}

DFAState represents a DFA state (subset of NFA states).

type DankEncoder

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

DankEncoder is the main struct matching Python's C++ backend.

func NewDankEncoder

func NewDankEncoder(regexStr string, fixedSlice int) *DankEncoder

NewDankEncoder initializes and builds the automaton using C++ algorithm.

func (*DankEncoder) GenerateAtFixedLength

func (d *DankEncoder) GenerateAtFixedLength(fixedLen int) []string

GenerateAtFixedLength returns all strings of exactly fixedLen

func (*DankEncoder) NumNFAStates

func (d *DankEncoder) NumNFAStates() int

NumNFAStates returns the number of NFA states (for debugging)

func (*DankEncoder) NumStates

func (d *DankEncoder) NumStates() int

NumStates returns the number of DFA states

func (*DankEncoder) NumWords

func (d *DankEncoder) NumWords(minLen, maxLen int) int64

NumWords counts accepted strings using DP

type NFAState

type NFAState struct {
	ID      int
	Trans   map[byte]map[int]bool // byte -> set of state IDs
	IsFinal bool
}

NFAState represents a state in the Thompson NFA (C++ style).

Jump to

Keyboard shortcuts

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