Documentation
¶
Index ¶
- type PycodeStreamParser
- func (p *PycodeStreamParser) GetSupportedTypes() []string
- func (p *PycodeStreamParser) Parse(ctx context.Context, content []byte, metadata map[string]any) (*core.Document, error)
- func (p *PycodeStreamParser) ParseStream(ctx context.Context, r io.Reader, metadata map[string]any) (<-chan *core.Document, error)
- func (p *PycodeStreamParser) SetChunkOverlap(overlap int)
- func (p *PycodeStreamParser) SetChunkSize(size int)
- func (p *PycodeStreamParser) SetExtractClasses(extract bool)
- func (p *PycodeStreamParser) SetExtractComments(extract bool)
- func (p *PycodeStreamParser) SetExtractFunctions(extract bool)
- func (p *PycodeStreamParser) Supports(contentType string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PycodeStreamParser ¶
type PycodeStreamParser struct {
// contains filtered or unexported fields
}
PycodeStreamParser implements the core.Parser interface for Python code files
func DefaultPycodeStreamParser ¶ added in v1.1.3
func DefaultPycodeStreamParser() *PycodeStreamParser
DefaultPycodeStreamParser creates a new Python code stream parser
func (*PycodeStreamParser) GetSupportedTypes ¶
func (p *PycodeStreamParser) GetSupportedTypes() []string
GetSupportedTypes returns the supported formats
func (*PycodeStreamParser) Parse ¶
func (p *PycodeStreamParser) Parse(ctx context.Context, content []byte, metadata map[string]any) (*core.Document, error)
Parse implements core.Parser interface.
func (*PycodeStreamParser) ParseStream ¶
func (p *PycodeStreamParser) ParseStream(ctx context.Context, r io.Reader, metadata map[string]any) (<-chan *core.Document, error)
ParseStream parses Python code from a reader and returns a channel of documents
func (*PycodeStreamParser) SetChunkOverlap ¶
func (p *PycodeStreamParser) SetChunkOverlap(overlap int)
SetChunkOverlap sets the chunk overlap
func (*PycodeStreamParser) SetChunkSize ¶
func (p *PycodeStreamParser) SetChunkSize(size int)
SetChunkSize sets the chunk size
func (*PycodeStreamParser) SetExtractClasses ¶
func (p *PycodeStreamParser) SetExtractClasses(extract bool)
SetExtractClasses sets whether to extract classes
func (*PycodeStreamParser) SetExtractComments ¶
func (p *PycodeStreamParser) SetExtractComments(extract bool)
SetExtractComments sets whether to extract comments
func (*PycodeStreamParser) SetExtractFunctions ¶
func (p *PycodeStreamParser) SetExtractFunctions(extract bool)
SetExtractFunctions sets whether to extract functions
func (*PycodeStreamParser) Supports ¶
func (p *PycodeStreamParser) Supports(contentType string) bool
Click to show internal directories.
Click to hide internal directories.