#NEWLINE# def _compute_significant_words( self , document , weight ) : #NEWLINE# #INDENT# words = map ( self . stem_word , document . words ) #NEWLINE# words = filter ( self . _is_bonus_word , words ) #NEWLINE# word_counts = Counter ( words ) #NEWLINE# word_frequencies = word_counts . values ( ) #NEWLINE# if ( not word_frequencies ) : #NEWLINE# #INDENT# return ( ) #NEWLINE# #UNINDENT# max_word_frequency = max ( word_frequencies ) #NEWLINE# return tuple ( ( word for ( word , frequency ) in word_counts . items ( ) if ( ( word_frequencies / max_word_frequency ) > weight ) ) )