types.ChunkerLike

Structural type for any chunker raghilda can use.

Usage

Source

types.ChunkerLike()

A ChunkerLike provides chunk(document) returning a ChunkedDocument and chunk_text(text) returning a sequence of Chunks. raghilda’s own MarkdownChunker satisfies this, as do third-party chunkers such as chonkie’s, so they can be used wherever raghilda expects a chunker.

Methods

Name Description
chunk() Chunk a document into a ChunkedDocument.
chunk_text() Chunk raw text into a sequence of Chunk objects.

chunk()

Chunk a document into a ChunkedDocument.

Usage

Source

chunk(document)

chunk_text()

Chunk raw text into a sequence of Chunk objects.

Usage

Source

chunk_text(text)