analyze static method
Implementation
static TextStats analyze(String text) {
final words = Tokenizer.tokenize(text);
final sentences =
RegExp(r'[.!?]+').allMatches(text).length;
return TextStats(
wordCount: words.length,
sentenceCount: sentences,
characterCount: text.length,
);
}