Documentation
¶
Index ¶
- func NewTextPlugin(logger *slog.Logger) schema.ParserPlugin
- type TextPlugin
- func (p *TextPlugin) CanHandle(path string, info fs.FileInfo) bool
- func (p *TextPlugin) Chunk(content string, path string, opts *model.CodeChunkingOptions) ([]model.CodeChunk, error)
- func (p *TextPlugin) Extensions() []string
- func (p *TextPlugin) ExtractMetadata(content string, path string) (schema.FileMetadata, error)
- func (p *TextPlugin) Name() string
- type TextSection
- type TextStructure
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
Click to show internal directories.
Click to hide internal directories.