text

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TextStreamParser

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

TextStreamParser is a true streaming parser that reads text/markdown files. It complies with the Single Responsibility Principle by only extracting content into Document entities and leaving chunking to the Chunker.

func NewTextStreamParser

func NewTextStreamParser(maxReadBytes int) *TextStreamParser

NewTextStreamParser creates a new parser optimized for raw text.

func (*TextStreamParser) GetSupportedTypes

func (p *TextStreamParser) GetSupportedTypes() []string

GetSupportedTypes returns the MIME types or extensions this parser can handle.

func (*TextStreamParser) ParseStream

func (p *TextStreamParser) ParseStream(ctx context.Context, r io.Reader, metadata map[string]any) (<-chan *entity.Document, error)

ParseStream reads the incoming io.Reader and yields chunks of the document via a channel.

Jump to

Keyboard shortcuts

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