Documentation
¶
Index ¶
- type JavacodeStreamParser
- func (p *JavacodeStreamParser) GetSupportedTypes() []string
- func (p *JavacodeStreamParser) Parse(ctx context.Context, content []byte, metadata map[string]any) (*core.Document, error)
- func (p *JavacodeStreamParser) ParseStream(ctx context.Context, r io.Reader, metadata map[string]any) (<-chan *core.Document, error)
- func (p *JavacodeStreamParser) SetChunkOverlap(overlap int)
- func (p *JavacodeStreamParser) SetChunkSize(size int)
- func (p *JavacodeStreamParser) SetExtractClasses(extract bool)
- func (p *JavacodeStreamParser) SetExtractComments(extract bool)
- func (p *JavacodeStreamParser) SetExtractMethods(extract bool)
- func (p *JavacodeStreamParser) Supports(contentType string) bool
- type Parser
- func (p *Parser) Parse(ctx context.Context, r io.Reader) ([]core.Chunk, error)
- func (p *Parser) ParseWithCallback(ctx context.Context, r io.Reader, callback func(core.Chunk) error) error
- func (p *Parser) SetChunkOverlap(overlap int)
- func (p *Parser) SetChunkSize(size int)
- func (p *Parser) SetExtractClasses(extract bool)
- func (p *Parser) SetExtractComments(extract bool)
- func (p *Parser) SetExtractMethods(extract bool)
- func (p *Parser) SupportedFormats() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JavacodeStreamParser ¶
type JavacodeStreamParser struct {
// contains filtered or unexported fields
}
func DefaultJavacodeStreamParser ¶ added in v1.1.3
func DefaultJavacodeStreamParser() *JavacodeStreamParser
DefaultJavacodeStreamParser creates a new Java code stream parser
func (*JavacodeStreamParser) GetSupportedTypes ¶
func (p *JavacodeStreamParser) GetSupportedTypes() []string
GetSupportedTypes returns the supported file formats
func (*JavacodeStreamParser) Parse ¶
func (p *JavacodeStreamParser) Parse(ctx context.Context, content []byte, metadata map[string]any) (*core.Document, error)
Parse implements core.Parser interface.
func (*JavacodeStreamParser) ParseStream ¶
func (p *JavacodeStreamParser) ParseStream(ctx context.Context, r io.Reader, metadata map[string]any) (<-chan *core.Document, error)
ParseStream implements the core.Parser interface
func (*JavacodeStreamParser) SetChunkOverlap ¶
func (p *JavacodeStreamParser) SetChunkOverlap(overlap int)
SetChunkOverlap sets the chunk overlap
func (*JavacodeStreamParser) SetChunkSize ¶
func (p *JavacodeStreamParser) SetChunkSize(size int)
SetChunkSize sets the chunk size
func (*JavacodeStreamParser) SetExtractClasses ¶
func (p *JavacodeStreamParser) SetExtractClasses(extract bool)
SetExtractClasses sets whether to extract classes
func (*JavacodeStreamParser) SetExtractComments ¶
func (p *JavacodeStreamParser) SetExtractComments(extract bool)
SetExtractComments sets whether to extract comments
func (*JavacodeStreamParser) SetExtractMethods ¶
func (p *JavacodeStreamParser) SetExtractMethods(extract bool)
SetExtractMethods sets whether to extract methods
func (*JavacodeStreamParser) Supports ¶
func (p *JavacodeStreamParser) Supports(contentType string) bool
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser implements a Java code parser
func DefaultParser ¶ added in v1.1.3
func DefaultParser() *Parser
DefaultParser creates a new Java parser
func (*Parser) ParseWithCallback ¶
func (p *Parser) ParseWithCallback(ctx context.Context, r io.Reader, callback func(core.Chunk) error) error
ParseWithCallback parses Java code and calls the callback for each chunk
func (*Parser) SetChunkOverlap ¶
SetChunkOverlap sets the chunk overlap
func (*Parser) SetChunkSize ¶
SetChunkSize sets the chunk size
func (*Parser) SetExtractClasses ¶
SetExtractClasses sets whether to extract classes
func (*Parser) SetExtractComments ¶
SetExtractComments sets whether to extract comments
func (*Parser) SetExtractMethods ¶
SetExtractMethods sets whether to extract methods