Skip to main content

Class: abstract MetadataAwareTextSplitter()

Extends

Extended by

abstract MetadataAwareTextSplitter<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/dist/node-parser/index.d.ts:18

Constructors

new MetadataAwareTextSplitter()

new MetadataAwareTextSplitter(): MetadataAwareTextSplitter

Returns

MetadataAwareTextSplitter

Inherited from

TextSplitter.constructor

Defined in

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

Properties

id

id: string

Inherited from

TextSplitter.id

Defined in

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


includeMetadata

includeMetadata: boolean

Inherited from

TextSplitter.includeMetadata

Defined in

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


includePrevNextRel

includePrevNextRel: boolean

Inherited from

TextSplitter.includePrevNextRel

Defined in

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

Methods

getMetadataString()

protected getMetadataString(node): string

Parameters

node: TextNode<Metadata>

Returns

string

Defined in

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


getNodesFromDocuments()

getNodesFromDocuments(documents): TextNode<Metadata>[]

Parameters

documents: TextNode<Metadata>[]

Returns

TextNode<Metadata>[]

Inherited from

TextSplitter.getNodesFromDocuments

Defined in

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


parseNodes()

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

Parameters

nodes: TextNode<Metadata>[]

Returns

TextNode<Metadata>[]

Overrides

TextSplitter.parseNodes

Defined in

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


postProcessParsedNodes()

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

Parameters

nodes: TextNode<Metadata>[]

parentDocMap: Map<string, TextNode<Metadata>>

Returns

TextNode<Metadata>[]

Inherited from

TextSplitter.postProcessParsedNodes

Defined in

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


splitText()

abstract splitText(text): string[]

Parameters

text: string

Returns

string[]

Inherited from

TextSplitter.splitText

Defined in

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


splitTextMetadataAware()

abstract splitTextMetadataAware(text, metadata): string[]

Parameters

text: string

metadata: string

Returns

string[]

Defined in

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


splitTexts()

splitTexts(texts): string[]

Parameters

texts: string[]

Returns

string[]

Inherited from

TextSplitter.splitTexts

Defined in

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


splitTextsMetadataAware()

splitTextsMetadataAware(texts, metadata): string[]

Parameters

texts: string[]

metadata: string[]

Returns

string[]

Defined in

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