Class TokenTextSplitter
java.lang.Object
org.springframework.ai.transformer.splitter.TextSplitter
org.springframework.ai.transformer.splitter.TokenTextSplitter
A
TextSplitter
that splits text into chunks of a target size in tokens.- Author:
- Raphael Yu, Christian Tzolov, Ricken Bazolo
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTokenTextSplitter
(boolean keepSeparator) TokenTextSplitter
(int chunkSize, int minChunkSizeChars, int minChunkLengthToEmbed, int maxNumChunks, boolean keepSeparator) -
Method Summary
Methods inherited from class org.springframework.ai.transformer.splitter.TextSplitter
apply, isCopyContentFormatter, setCopyContentFormatter, split, split
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.document.DocumentTransformer
transform
-
Constructor Details
-
TokenTextSplitter
public TokenTextSplitter() -
TokenTextSplitter
public TokenTextSplitter(boolean keepSeparator) -
TokenTextSplitter
public TokenTextSplitter(int chunkSize, int minChunkSizeChars, int minChunkLengthToEmbed, int maxNumChunks, boolean keepSeparator)
-
-
Method Details
-
builder
-
splitText
- Specified by:
splitText
in classTextSplitter
-
doSplit
-