Rag.Chunker.Character (rag v0.3.4)
View SourceFixed-size chunking with overlap and smart boundaries.
Attempts to break at sentence boundaries, falls back to word boundaries, then to exact character positions.
Options
max_chars- Maximum characters per chunk (default: 500)overlap- Characters to overlap between chunks (default: 50)
Summary
Functions
Split text into character-based chunks.
Returns default options for the character chunker.
Types
@type t() :: %Rag.Chunker.Character{ max_chars: pos_integer(), overlap: non_neg_integer() }
Functions
@spec chunk(t(), String.t(), keyword()) :: [Rag.Chunker.Chunk.t()]
Split text into character-based chunks.
@spec default_opts() :: keyword()
Returns default options for the character chunker.