Skip to main content

Tokenizer

Trait Tokenizer 

Source
pub trait Tokenizer:
    Send
    + Sync
    + 'static {
    // Required method
    fn count(&self, text: &str) -> usize;
}
Expand description

Counts approximate tokens for a string.

Required Methods§

Source

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

Returns the estimated token count.

Implementors§