Skip to main content

ChunkTokenizer

Trait ChunkTokenizer 

Source
pub trait ChunkTokenizer {
    // Required methods
    fn count_tokens(&self, text: &str) -> usize;
    fn max_tokens(&self) -> usize;
}
Expand description

Token counting for HybridChunker — docling’s BaseTokenizer.

Required Methods§

Source

fn count_tokens(&self, text: &str) -> usize

Number of tokens in text (no special tokens).

Source

fn max_tokens(&self) -> usize

The chunk budget (docling’s max_tokens, e.g. 256 for MiniLM).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§