chunker

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chunk

type Chunk struct {
	StartByte int
	EndByte   int
	Length    int
	StartLine int
	Content   string
	FilePath  string
	Language  string
}

Chunk represents a code chunk

type Chunker

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

Chunker wraps the C chunker

Chunker must have Close called to release memory.

func NewChunkerSize

func NewChunkerSize(maxChunkSize, chunkOverlap int) (*Chunker, error)

func NewChunkerSplitCode

func NewChunkerSplitCode(maxChunkSize int) (*Chunker, error)

func NewChunkerSplitCodeSimple

func NewChunkerSplitCodeSimple(maxChunkSize int) (*Chunker, error)

func (*Chunker) AddFile

func (c *Chunker) AddFile(filePath, sourceCode string)

func (*Chunker) ChunkFiles

func (c *Chunker) ChunkFiles() error

func (*Chunker) Chunks

func (c *Chunker) Chunks() iter.Seq[Chunk]

Chunks returns an iterator of all chunks found.

func (*Chunker) Clear

func (c *Chunker) Clear()

Clear removes all files and chunks but keeps allocated memory for reuse

func (*Chunker) Close

func (c *Chunker) Close()

Close frees all chunker memory including files and chunks

Jump to

Keyboard shortcuts

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