pub struct GuesstimationTokenizer;Expand description
A rough tokenizer that estimates ~4 characters per token.
Reasonable for English text but inaccurate for code, CJK, or other scripts. Use a proper tokenizer in production.
Trait Implementations§
Source§impl Tokenizer for GuesstimationTokenizer
impl Tokenizer for GuesstimationTokenizer
Source§fn estimate_tokens(&self, text: &str) -> usize
fn estimate_tokens(&self, text: &str) -> usize
Estimate the number of tokens in the given text.
Auto Trait Implementations§
impl Freeze for GuesstimationTokenizer
impl RefUnwindSafe for GuesstimationTokenizer
impl Send for GuesstimationTokenizer
impl Sync for GuesstimationTokenizer
impl Unpin for GuesstimationTokenizer
impl UnsafeUnpin for GuesstimationTokenizer
impl UnwindSafe for GuesstimationTokenizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more