org.llm4s.chunking.SimpleChunker
See theSimpleChunker companion object
class SimpleChunker extends DocumentChunker
Simple character-based chunker wrapping legacy ChunkingUtils.
Provides compatibility with existing code while conforming to the new DocumentChunker interface. Splits text into fixed-size chunks without semantic awareness.
Use this chunker when:
- You need maximum compatibility with existing code
- Content has no clear sentence structure
- Performance is more important than quality
For better quality chunks, consider:
- SentenceChunker: Respects sentence boundaries
- MarkdownChunker: Preserves markdown structure
- SemanticChunker: Uses embedding similarity
Usage:
val chunker = SimpleChunker()
val chunks = chunker.chunk(text, ChunkingConfig(targetSize = 800, overlap = 150))
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
In this article