TextChunker
AgentPrism.Core.dllSplits text into fixed-length chunks with overlap.
public static class TextChunkerInheritance
Section titled “Inheritance”Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”It is intentionally simple. Intelligent chunking based on headings or semantics is outside the library boundary. Consumers can send their own chunks directly.
Methods
Section titled “Methods”Split(string, int, int)
Section titled “ Split(string, int, int)”Splits text into chunks with overlap.
public static IReadOnlyList<string> Split(string text, int chunkSize, int chunkOverlap)Parameters
Section titled “Parameters”text string
The text to split.
chunkSize int
The chunk length in characters. It must be positive.
chunkOverlap int
The overlap length between consecutive chunks, in characters. It must be less
than chunkSize; otherwise, the method cannot progress.
Returns
Section titled “Returns”The chunk text in order, or an empty list for empty text.
Exceptions
Section titled “Exceptions”chunkSize is zero or negative, or chunkOverlap
is negative or greater than or equal to chunkSize.