Class: SentenceSplitter()
Parse text with a preference for complete sentences.
Extends
SentenceSplitter<
Options
>(nodes
,options
?):Promise
<BaseNode
<Metadata
>[]>
Parse text with a preference for complete sentences.
Type Parameters
• Options extends Record
<string
, unknown
>
Parameters
• options?: Options
Returns
Defined in
packages/core/dist/node-parser/index.d.ts:32
Constructors
new SentenceSplitter()
new SentenceSplitter(
params
?):SentenceSplitter
Parameters
• params?: object
& SplitterParams
Returns
Overrides
MetadataAwareTextSplitter
.constructor
Defined in
packages/core/dist/node-parser/index.d.ts:54
Properties
chunkOverlap
chunkOverlap:
number
The token overlap of each chunk when splitting.
Defined in
packages/core/dist/node-parser/index.d.ts:41
chunkSize
chunkSize:
number
The token chunk size for each chunk.
Defined in
packages/core/dist/node-parser/index.d.ts:37
id
id:
string
Inherited from
Defined in
packages/core/dist/schema/index.d.ts:171
includeMetadata
includeMetadata:
boolean
Inherited from
MetadataAwareTextSplitter
.includeMetadata
Defined in
packages/core/dist/node-parser/index.d.ts:6
includePrevNextRel
includePrevNextRel:
boolean
Inherited from
MetadataAwareTextSplitter
.includePrevNextRel
Defined in
packages/core/dist/node-parser/index.d.ts:7
paragraphSeparator
paragraphSeparator:
string
Separator between paragraphs.
Defined in
packages/core/dist/node-parser/index.d.ts:49
secondaryChunkingRegex
secondaryChunkingRegex:
string
Backup regex for splitting into sentences.
Defined in
packages/core/dist/node-parser/index.d.ts:53
separator
separator:
string
Default separator for splitting into words
Defined in
packages/core/dist/node-parser/index.d.ts:45
tokenSize()
tokenSize: (
text
) =>number
Parameters
• text: string
Returns
number
Defined in
packages/core/dist/node-parser/index.d.ts:58
Methods
_splitText()
_splitText(
text
,chunkSize
):string
[]
Parameters
• text: string
• chunkSize: number
Returns
string
[]
Defined in
packages/core/dist/node-parser/index.d.ts:57
getMetadataString()
protected
getMetadataString(node
):string
Parameters
Returns
string
Inherited from
MetadataAwareTextSplitter
.getMetadataString
Defined in
packages/core/dist/node-parser/index.d.ts:21
getNodesFromDocuments()
Parameters
• documents: TextNode
<Metadata
>[]
Returns
Inherited from
MetadataAwareTextSplitter
.getNodesFromDocuments
Defined in
packages/core/dist/node-parser/index.d.ts:11
parseNodes()
Parameters
Returns
Inherited from
MetadataAwareTextSplitter
.parseNodes
Defined in
packages/core/dist/node-parser/index.d.ts:22
postProcessParsedNodes()
protected
postProcessParsedNodes(nodes
,parentDocMap
):TextNode
<Metadata
>[]
Parameters
• parentDocMap: Map
<string
, TextNode
<Metadata
>>
Returns
Inherited from
MetadataAwareTextSplitter
.postProcessParsedNodes
Defined in
packages/core/dist/node-parser/index.d.ts:9
splitText()
splitText(
text
):string
[]
Parameters
• text: string
Returns
string
[]
Overrides
MetadataAwareTextSplitter
.splitText
Defined in
packages/core/dist/node-parser/index.d.ts:56
splitTextMetadataAware()
splitTextMetadataAware(
text
,metadata
):string
[]
Parameters
• text: string
• metadata: string
Returns
string
[]
Overrides
MetadataAwareTextSplitter
.splitTextMetadataAware
Defined in
packages/core/dist/node-parser/index.d.ts:55
splitTexts()
splitTexts(
texts
):string
[]
Parameters
• texts: string
[]
Returns
string
[]
Inherited from
MetadataAwareTextSplitter
.splitTexts
Defined in
packages/core/dist/node-parser/index.d.ts:15
splitTextsMetadataAware()
splitTextsMetadataAware(
texts
,metadata
):string
[]
Parameters
• texts: string
[]
• metadata: string
[]
Returns
string
[]
Inherited from
MetadataAwareTextSplitter
.splitTextsMetadataAware
Defined in
packages/core/dist/node-parser/index.d.ts:20