Expand description
Code-aware chunking strategy.
Chunks code at function/class/method boundaries using pattern matching. Supports Rust, Python, JavaScript, TypeScript, Go, Java, and C/C++.
StructsΒ§
- Code
Boundary π - A code boundary (start of a function/class/method).
- Code
Chunker - Code-aware chunker that splits at function/class boundaries.
EnumsΒ§
- Boundary
Kind π - Language π
- Supported programming languages.
FunctionsΒ§
- calculate_
byte_ πrange - Calculate byte range for a line range.
- chunk_
by_ πlines - Chunk by lines when no code boundaries are found.
- create_
chunks_ πfrom_ boundaries - Create chunks from detected boundaries.
- detect_
boundary π - Detect if a line starts a code boundary.
- detect_
c_ πboundary - Detect C/C++ code boundaries.
- detect_
go_ πboundary - Detect Go code boundaries.
- detect_
java_ πboundary - Detect Java code boundaries.
- detect_
js_ πboundary - Detect JavaScript/TypeScript code boundaries.
- detect_
python_ πboundary - Detect Python code boundaries.
- detect_
rust_ πboundary - Detect Rust code boundaries.
- extract_
after_ πkeyword - extract_
c_ πfn_ name - extract_
const_ πfn_ name - extract_
go_ πfn_ name - extract_
go_ πmethod_ name - extract_
java_ πmethod_ name - extract_
js_ πfn_ name - extract_
python_ πfn_ name - extract_
rust_ πfn_ name - find_
code_ πboundaries - Find code boundaries (functions, classes, etc.) in source code.
- split_
large_ πchunk - Split a chunk thatβs too large.