nodes: 0, module; 1, function_definition; 2, function_name:remove_fewwords_paragraphs; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, comment:"""\
          remove paragraphs that have less than x number of words,
          would indicate that it's some sort of link
          """; 11, assignment; 12, call; 13, identifier:el; 14, identifier:all_nodes; 15, block; 16, identifier:all_nodes; 17, call; 18, attribute; 19, argument_list; 20, expression_statement; 21, expression_statement; 22, expression_statement; 23, if_statement; 24, attribute; 25, argument_list; 26, identifier:all_nodes; 27, identifier:reverse; 28, assignment; 29, assignment; 30, assignment; 31, boolean_operator; 32, block; 33, comment:# TODO; 34, comment:# check if it is in the right place; 35, else_clause; 36, attribute; 37, identifier:getElementsByTags; 38, call; 39, list; 40, identifier:tag; 41, call; 42, identifier:text; 43, call; 44, identifier:stop_words; 45, call; 46, boolean_operator; 47, line_continuation:\; 48, comparison_operator:len(self.parser.getElementsByTag(el, tag='embed')) == 0; 49, expression_statement; 50, block; 51, identifier:self; 52, identifier:parser; 53, attribute; 54, argument_list; 55, string; 56, attribute; 57, argument_list; 58, attribute; 59, argument_list; 60, attribute; 61, argument_list; 62, boolean_operator; 63, line_continuation:\; 64, comparison_operator:len(self.parser.getElementsByTag(el, tag='object')) == 0; 65, call; 66, integer:0; 67, call; 68, expression_statement; 69, if_statement; 70, identifier:self; 71, identifier:get_top_node; 72, string_content:*; 73, attribute; 74, identifier:getTag; 75, identifier:el; 76, attribute; 77, identifier:getText; 78, identifier:el; 79, call; 80, identifier:get_stopword_count; 81, identifier:text; 82, parenthesized_expression; 83, comparison_operator:stop_words.get_stopword_count() < 3; 84, call; 85, integer:0; 86, identifier:len; 87, argument_list; 88, attribute; 89, argument_list; 90, assignment; 91, boolean_operator; 92, block; 93, identifier:self; 94, identifier:parser; 95, identifier:self; 96, identifier:parser; 97, attribute; 98, argument_list; 99, boolean_operator; 100, call; 101, integer:3; 102, identifier:len; 103, argument_list; 104, call; 105, attribute; 106, identifier:remove; 107, identifier:el; 108, identifier:trimmed; 109, call; 110, call; 111, call; 112, expression_statement; 113, identifier:self; 114, identifier:stopwords_class; 115, keyword_argument; 116, comparison_operator:tag != 'br'; 117, comparison_operator:text != '\\r'; 118, attribute; 119, argument_list; 120, call; 121, attribute; 122, argument_list; 123, identifier:self; 124, identifier:parser; 125, attribute; 126, argument_list; 127, attribute; 128, argument_list; 129, attribute; 130, argument_list; 131, call; 132, identifier:language; 133, call; 134, identifier:tag; 135, string; 136, identifier:text; 137, string; 138, identifier:stop_words; 139, identifier:get_stopword_count; 140, attribute; 141, argument_list; 142, attribute; 143, identifier:getElementsByTag; 144, identifier:el; 145, keyword_argument; 146, attribute; 147, identifier:getText; 148, identifier:el; 149, identifier:trimmed; 150, identifier:startswith; 151, string:"("; 152, identifier:trimmed; 153, identifier:endswith; 154, string:")"; 155, attribute; 156, argument_list; 157, attribute; 158, argument_list; 159, string_content:br; 160, string_content; 161, attribute; 162, identifier:getElementsByTag; 163, identifier:el; 164, keyword_argument; 165, identifier:self; 166, identifier:parser; 167, identifier:tag; 168, string; 169, identifier:self; 170, identifier:parser; 171, attribute; 172, identifier:remove; 173, identifier:el; 174, identifier:self; 175, identifier:get_language; 176, escape_sequence:\\; 177, identifier:self; 178, identifier:parser; 179, identifier:tag; 180, string; 181, string_content:embed; 182, identifier:self; 183, identifier:parser; 184, string_content:object
code: def remove_fewwords_paragraphs(self):
          """\
          remove paragraphs that have less than x number of words,
          would indicate that it's some sort of link
          """
          all_nodes = self.parser.getElementsByTags(self.get_top_node(), ['*'])
          all_nodes.reverse()
          for el in all_nodes:
              tag = self.parser.getTag(el)
              text = self.parser.getText(el)
              stop_words = self.stopwords_class(language=self.get_language()).get_stopword_count(text)
              if (tag != 'br' or text != '\\r') and stop_words.get_stopword_count() < 3 \
                  and len(self.parser.getElementsByTag(el, tag='object')) == 0 \
                  and len(self.parser.getElementsByTag(el, tag='embed')) == 0:
                  self.parser.remove(el)
              # TODO
              # check if it is in the right place
              else:
                  trimmed = self.parser.getText(el)
                  if trimmed.startswith("(") and trimmed.endswith(")"):
                      self.parser.remove(el)