chunkers

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package chunkers provides chunking strategies for various git outputs.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyLog = errors.New("log input is empty")

ErrEmptyLog is returned when the log input is empty.

Functions

This section is empty.

Types

type DiffChunker

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

DiffChunker splits unified diffs into logical chunks using semantic relationship clustering.

func NewDiffChunker

func NewDiffChunker() *DiffChunker

NewDiffChunker creates a new DiffChunker.

func (*DiffChunker) Chunk

func (c *DiffChunker) Chunk(diff string, maxChunkSize int) ([]domain.DiffChunk, error)

Chunk splits a unified diff into logical chunks.

type FileSymbols added in v1.4.2

type FileSymbols struct {
	Definitions map[string]bool
	References  map[string]bool
}

FileSymbols represents semantic information for a file.

type LanguageGrammar added in v1.4.2

type LanguageGrammar struct {
	DefRegex *regexp.Regexp // Matches function/class/interface definitions
	RefRegex *regexp.Regexp // Matches function calls or usages
}

LanguageGrammar defines how to find symbols in a specific language.

type LogChunker

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

LogChunker splits git log output into chunks based on commit count.

func NewLogChunker

func NewLogChunker(contextWindow int) *LogChunker

NewLogChunker creates a new LogChunker with the specified context window. It calculates commitsPerChunk as approximately contextWindow/200, with a minimum of 10 and maximum of 25.

func (*LogChunker) Chunk

func (c *LogChunker) Chunk(log string, commitsPerChunk int) ([]string, error)

Chunk splits a git log string into chunks of approximately commitsPerChunk commits.

Jump to

Keyboard shortcuts

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