Skip to main content

Class: abstract TextSplitter()

Extends

Extended by

abstract TextSplitter<Options>(nodes, options?): Promise<BaseNode<Metadata>[]>

Type Parameters

Options extends Record<string, unknown>

Parameters

nodes: BaseNode<Metadata>[]

options?: Options

Returns

Promise<BaseNode<Metadata>[]>

Defined in

packages/core/node-parser/dist/index.d.ts:13

Constructors

new TextSplitter()

new TextSplitter(): TextSplitter

Returns

TextSplitter

Inherited from

NodeParser.constructor

Defined in

packages/core/node-parser/dist/index.d.ts:8

Properties

id

id: string

Inherited from

NodeParser.id

Defined in

packages/core/schema/dist/index.d.ts:171


includeMetadata

includeMetadata: boolean

Inherited from

NodeParser.includeMetadata

Defined in

packages/core/node-parser/dist/index.d.ts:6


includePrevNextRel

includePrevNextRel: boolean

Inherited from

NodeParser.includePrevNextRel

Defined in

packages/core/node-parser/dist/index.d.ts:7

Methods

getNodesFromDocuments()

getNodesFromDocuments(documents): TextNode<Metadata>[]

Parameters

documents: TextNode<Metadata>[]

Returns

TextNode<Metadata>[]

Inherited from

NodeParser.getNodesFromDocuments

Defined in

packages/core/node-parser/dist/index.d.ts:11


parseNodes()

protected parseNodes(nodes): TextNode<Metadata>[]

Parameters

nodes: TextNode<Metadata>[]

Returns

TextNode<Metadata>[]

Overrides

NodeParser.parseNodes

Defined in

packages/core/node-parser/dist/index.d.ts:16


postProcessParsedNodes()

protected postProcessParsedNodes(nodes, parentDocMap): TextNode<Metadata>[]

Parameters

nodes: TextNode<Metadata>[]

parentDocMap: Map<string, TextNode<Metadata>>

Returns

TextNode<Metadata>[]

Inherited from

NodeParser.postProcessParsedNodes

Defined in

packages/core/node-parser/dist/index.d.ts:9


splitText()

abstract splitText(text): string[]

Parameters

text: string

Returns

string[]

Defined in

packages/core/node-parser/dist/index.d.ts:14


splitTexts()

splitTexts(texts): string[]

Parameters

texts: string[]

Returns

string[]

Defined in

packages/core/node-parser/dist/index.d.ts:15