chunker

package
v0.0.0-beta.18 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 2 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 {
	Index   int
	Content string
	Tokens  int
}

Chunk is a piece of text from a document.

type Chunker

type Chunker struct {
	ChunkSize    int
	ChunkOverlap int
	// contains filtered or unexported fields
}

Chunker splits text into overlapping chunks.

func New

func New(chunkSize, chunkOverlap int) *Chunker

New creates a recursive character text splitter.

func (*Chunker) Split

func (c *Chunker) Split(text string) []Chunk

Split splits text into chunks, returning them with indices.

Jump to

Keyboard shortcuts

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