text

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTextPlugin

func NewTextPlugin(logger *slog.Logger) schema.ParserPlugin

NewTextPlugin creates a new text file parser plugin

Types

type TextPlugin

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

TextPlugin implements model.ParserPlugin for plain text files

func (*TextPlugin) CanHandle

func (p *TextPlugin) CanHandle(path string, info fs.FileInfo) bool

CanHandle determines if this plugin can process the given file

func (*TextPlugin) Chunk

func (p *TextPlugin) Chunk(content string, path string, opts *model.CodeChunkingOptions) ([]model.CodeChunk, error)

Chunk breaks text into semantic chunks based on paragraphs and sections

func (*TextPlugin) Extensions

func (p *TextPlugin) Extensions() []string

Extensions returns file extensions for text files

func (*TextPlugin) ExtractMetadata

func (p *TextPlugin) ExtractMetadata(content string, path string) (schema.FileMetadata, error)

ExtractMetadata extracts metadata from text content

func (*TextPlugin) Name

func (p *TextPlugin) Name() string

Name returns "text" as the language name

type TextSection

type TextSection struct {
	Title     string
	Content   string
	LineStart int
	LineEnd   int
	Type      string // heading, paragraph, list, code_block
}

TextSection represents a logical section in the text

type TextStructure

type TextStructure struct {
	Type      string
	Sections  []TextSection
	HasTitles bool
	HasLists  bool
}

TextStructure represents the analyzed structure of a text document

Jump to

Keyboard shortcuts

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