MediaPipeTasksRetrieval Framework Reference

DefaultTextChunker

class DefaultTextChunker: NSObject, TextChunker

A default text chunking implementation using native C++ word-based chunking with overlap or character sliding window.

  • Initializes the default text chunker with a chunk size, chunk overlap, and chunking mode.

    Declaration

    Swift

    init(chunkSize: Int, chunkOverlap: Int, mode: ChunkingMode) throws
  • Initializes the default text chunker with a chunk size, chunk overlap, word threshold, and chunking mode.

    Declaration

    Swift

    init(chunkSize: Int, chunkOverlap: Int, wordThreshold: Int, mode: ChunkingMode) throws
  • The chunk overlap to use for text chunking. Used only in character-based chunking.

    Declaration

    Swift

    var chunkOverlap: Int { get }
  • The chunk size to use for text chunking. For character-based chunking, this is the character count per chunk. For word-based chunking, this is the target word count per chunk.

    Declaration

    Swift

    var chunkSize: Int { get }
  • Mode for text chunking.

    Declaration

    Swift

    var mode: ChunkingMode { get }
  • The word threshold to use for text chunking. Used only in word-based chunking.

    Declaration

    Swift

    var wordThreshold: Int { get }