fix: correct title keywords extraction to return proper word-frequency pairs

Co-authored-by: aider (ollama_chat/qwen3-coder:30b) <aider@aider.chat>
This commit is contained in:
Mark Eaton
2026-08-16 19:51:23 -04:00
co-authored by aider
parent 3c5939e4f6
commit 272b4c0909
+2 -3
View File
@@ -83,13 +83,12 @@ def extract_title_keywords(data):
re_word = re.sub(r"[^a-zA-Z\-]", "", word.lower())
if re_word not in stop_words and re_word != "":
title_keywords.append(re_word)
return title_keywords
return Counter(title_keywords).most_common(30)
def print_title_keywords(data):
title_keywords = extract_title_keywords(data)
count_title_words = Counter(title_keywords).most_common(30)
pprint(count_title_words)
pprint(title_keywords)
def histogram(data):