diff --git a/tagger.py b/tagger.py index f3889d3..6ff8010 100644 --- a/tagger.py +++ b/tagger.py @@ -43,12 +43,12 @@ class FileScanner(HTMLParser): if len(word) <= 3: score //= 2 upper_letters_count = len(upper_check.findall(tag_name)) - score *= upper_letters_count + score += upper_letters_count * 5 if word not in words_with_usage: words_with_usage[word] = Tag(name=tag_name, score=score) else: words_with_usage[word].score += score - sorted_list = sorted(words_with_usage.values(), key=lambda tag: tag.score, reverse=False) + sorted_list = sorted(words_with_usage.values(), key=lambda tag: tag.score, reverse=True) display_result(sorted_list) def handle_starttag(self, tag, attrs):