Rough token estimation (~4 chars per token for English/code)
(text: &str)
| 225 | |
| 226 | /// Rough token estimation (~4 chars per token for English/code) |
| 227 | fn estimate_tokens(text: &str) -> usize { |
| 228 | text.len() / 4 |
| 229 | } |
| 230 | |
| 231 | // ============================================================================ |
| 232 | // Tests |