INNER CODE UNIT · Python
total_words
wyounas/homer · homer/analyzer.py:141
def total_words(self):
return sum([len(sentence) for sentence in self.sentences])
@property
def total_and_words(self):
return sum([sentence.total_and_words for sentence in self.sentences if sentence.total_and_words])
@property
def avg_words_per_sentence(self):
round_to_two_digits = 2
return round(self.total_words / len(self), round_to_two_digits)
def is_long(self):
return len(self) >= MAX_SENTENCES_IN_PARAGRAPH
def get_flesch_reading_score(self):
return FleschReading(self.paragraph).grade()