Skip to main content

Class: SentenceWindowNodeParser()

Extends

SentenceWindowNodeParser<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/node-parser/index.d.ts:75

Constructors

new SentenceWindowNodeParser()

new SentenceWindowNodeParser(params?): SentenceWindowNodeParser

Parameters

params?

params.originalTextMetadataKey?: string

params.windowMetadataKey?: string

params.windowSize?: number

Returns

SentenceWindowNodeParser

Overrides

NodeParser.constructor

Defined in

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

Properties

id

id: string

Inherited from

NodeParser.id

Defined in

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


idGenerator()

idGenerator: () => string

Returns

string

Defined in

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


includeMetadata

includeMetadata: boolean

Inherited from

NodeParser.includeMetadata

Defined in

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


includePrevNextRel

includePrevNextRel: boolean

Inherited from

NodeParser.includePrevNextRel

Defined in

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


originalTextMetadataKey

originalTextMetadataKey: string

Defined in

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


sentenceSplitter

sentenceSplitter: TextSplitterFn

Defined in

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


windowMetadataKey

windowMetadataKey: string

Defined in

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


windowSize

windowSize: number

Defined in

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


DEFAULT_ORIGINAL_TEXT_METADATA_KEY

static DEFAULT_ORIGINAL_TEXT_METADATA_KEY: string

Defined in

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


DEFAULT_WINDOW_METADATA_KEY

static DEFAULT_WINDOW_METADATA_KEY: string

Defined in

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


DEFAULT_WINDOW_SIZE

static DEFAULT_WINDOW_SIZE: number

Defined in

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

Methods

buildWindowNodesFromDocuments()

buildWindowNodesFromDocuments(documents): TextNode<Metadata>[]

Parameters

documents: Document<Metadata>[]

Returns

TextNode<Metadata>[]

Defined in

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


getNodesFromDocuments()

getNodesFromDocuments(documents): TextNode<Metadata>[]

Parameters

documents: TextNode<Metadata>[]

Returns

TextNode<Metadata>[]

Inherited from

NodeParser.getNodesFromDocuments

Defined in

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


parseNodes()

parseNodes(nodes, showProgress?): TextNode<Metadata>[]

Parameters

nodes: TextNode<Metadata>[]

showProgress?: boolean

Returns

TextNode<Metadata>[]

Overrides

NodeParser.parseNodes

Defined in

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


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/node-parser/index.d.ts:9