// compute frequencies of bonus words in document
word_counts = Counter(words)
word_frequencies = word_counts.values()
// no frequencies means no significant words
if not word_frequencies:
return ()
After Change
def _compute_significant_words(self, document, weight):
// keep only stems contained in bonus words
words = map(self.stem_word, document.words)
words = filter(self._is_bonus_word, words)
// compute frequencies of bonus words in document
word_counts = Counter(words)
word_frequencies = word_counts.values()