chunker

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BreakpointChunker

type BreakpointChunker struct {
	TargetSize int // target chunk size in runes
	MinSize    int // minimum chunk size before emitting
}

BreakpointChunker splits sections using break-point scoring with distance decay.

func NewBreakpointChunker

func NewBreakpointChunker(targetSize int) *BreakpointChunker

func (*BreakpointChunker) Chunk

func (c *BreakpointChunker) Chunk(doc *parser.Document) []Chunk

type Chunk

type Chunk struct {
	Seq         int
	Text        string
	HeadingPath string
	Ordinal     int // byte offset in original document
}

Chunk is a unit of text to be indexed and embedded.

type Chunker

type Chunker interface {
	Chunk(doc *parser.Document) []Chunk
}

Chunker splits a parsed document into indexable chunks.

Jump to

Keyboard shortcuts

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