use std::cmp::max;
pub struct TokenUtils;
impl TokenUtils {
pub fn estimate_token_count(text: &str) -> usize {
let words = text.split_whitespace().count();
let estimate_one = Self::word_to_token_count(words);
let estimate_two = text.len() / 4;
max(estimate_one, estimate_two)
}
pub fn word_to_token_count(word_count: usize) -> usize {
(word_count * 4) / 3
}
}