INNER CODE UNIT · Python
sentences
wyounas/homer · homer/analyzer.py:133
def sentences(self):
return self._sentences
@property
def longest_sentence(self):
return max(self._sentences, key=lambda sentence: len(sentence))
@property
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