Skip to content

text_stats_analyzer

Module for analyzing text statistics.

TextStatsAnalyzer

Bases: IAnalyzer

Analyzer that computes word count, character count, sentence count, and average word length.

analyze

analyze(content: str) -> AnalysisResult

Analyze the provided text and return its statistics.

Parameters:

Name Type Description Default
content str

The text to be analyzed.

required

Returns:

Name Type Description
AnalysisResult AnalysisResult

An object containing an output dictionary with the following keys: - word_count (int): Total number of words. - character_count (int): Total number of characters. - sentence_count (int): Total number of sentences. - average_word_length (float): Average length of words in characters.