text

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

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

Parser implements a simple text parser

func NewParser

func NewParser() *Parser

NewParser creates a new text parser

func (*Parser) Parse

func (p *Parser) Parse(ctx context.Context, r io.Reader) ([]core.Chunk, error)

Parse parses text into chunks

func (*Parser) ParseWithCallback added in v0.6.0

func (p *Parser) ParseWithCallback(ctx context.Context, r io.Reader, callback func(core.Chunk) error) error

ParseWithCallback parses text and calls the callback for each chunk

func (*Parser) SupportedFormats

func (p *Parser) SupportedFormats() []string

SupportedFormats returns supported formats

type SemanticParser added in v0.6.0

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

SemanticParser implements semantic chunking based on sentence boundaries and semantic similarity

func NewSemanticParser added in v0.6.0

func NewSemanticParser(embedder embedding.Provider) *SemanticParser

NewSemanticParser creates a new semantic parser

func (*SemanticParser) Parse added in v0.6.0

func (p *SemanticParser) Parse(ctx context.Context, r io.Reader) ([]core.Chunk, error)

Parse parses text into semantically meaningful chunks

func (*SemanticParser) SupportedFormats added in v0.6.0

func (p *SemanticParser) SupportedFormats() []string

SupportedFormats returns supported formats

type StreamingParser added in v0.6.0

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

func NewStreamingParser added in v0.6.0

func NewStreamingParser() *StreamingParser

NewStreamingParser creates a new streaming text parser

func (*StreamingParser) Parse added in v0.6.0

func (p *StreamingParser) Parse(ctx context.Context, r io.Reader) ([]core.Chunk, error)

Parse parses text into chunks using streaming processing

func (*StreamingParser) SupportedFormats added in v0.6.0

func (p *StreamingParser) SupportedFormats() []string

SupportedFormats returns supported formats

Jump to

Keyboard shortcuts

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