roughTokenCountEstimation function

int roughTokenCountEstimation(
  1. String text
)

Rough token count estimation using ~4 chars per token.

Implementation

int roughTokenCountEstimation(String text) {
  return (text.length / 4).ceil();
}