Package sk.iway.iwcm.rag.indexing
Class SlidingWindowChunker
java.lang.Object
sk.iway.iwcm.rag.indexing.SlidingWindowChunker
Splits text into overlapping chunks using a sliding window approach.
This ensures context is preserved at chunk boundaries for better embedding quality.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SlidingWindowChunker
public SlidingWindowChunker()
-
-
Method Details
-
chunk
Split text into overlapping chunks.- Parameters:
text- the full text to split- Returns:
- list of text chunks
-
chunk
Split text into overlapping chunks with specified parameters. Chunk ends prefer paragraph, line, sentence, and whitespace boundaries before falling back to a hard character split.- Parameters:
text- the full text to splitchunkSize- maximum number of characters per chunkoverlap- number of characters to overlap between consecutive chunks- Returns:
- list of text chunks
-