diff --git a/tagger.py b/tagger.py index 78586a7..7c1db31 100644 --- a/tagger.py +++ b/tagger.py @@ -46,8 +46,9 @@ class FileScanner(HTMLParser): continue if word in title_words: score *= 4 - if len(word) <= 3: - score //= 2 + word_length = len(word) + if word_length <= 3: + score = int(score * word_length / 4) upper_letters_count = len(UPPER_CHECK.findall(tag_name)) score += upper_letters_count * 5 if word not in words_with_usage: