def get_siblings_score(self, top_node):
base = <NUM_LIT><EOL>paragraphs_number = <NUM_LIT:0><EOL>paragraphs_score = <NUM_LIT:0><EOL>nodes_to_check = self.parser.getElementsByTag(top_node, tag='<STR_LIT:p>')<EOL>for node in nodes_to_check:<EOL><INDENT>text_node = self.parser.getText(node)<EOL>word_stats = self.stopwords_class(language=self.get_language()).get_stopword_count(text_node)<EOL>high_link_density = self.is_highlink_density(node)<EOL>if word_stats.get_stopword_count() > <NUM_LIT:2> and not high_link_density:<EOL><INDENT>paragraphs_number += <NUM_LIT:1><EOL>paragraphs_score += word_stats.get_stopword_count()<EOL><DEDENT><DEDENT>if paragraphs_number > <NUM_LIT:0>:<EOL><INDENT>base = paragraphs_score // paragraphs_number<EOL><DEDENT>return base<EOL>
we could have long articles that have tons of paragraphs
so if we tried to calculate the base score against
the total text score of those paragraphs it would be unfair.
So we need to normalize the score based on the average scoring
of the paragraphs within the top node.
For example if our total score of 10 paragraphs was 1000
but each had an average value of 100 then 100 should be our base.