refactoring

This commit is contained in:
2025-04-18 18:01:40 +02:00
parent d2d7733c35
commit 71adea9687
2 changed files with 2 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ test = processRawMessages(chat)
frequency_dictionary: dict[str, dict[str, int]] = {} frequency_dictionary: dict[str, dict[str, int]] = {}
for author in test.keys(): for author in test:
frequency_dictionary[author] = {} frequency_dictionary[author] = {}
messageList = test.get(author) messageList = test.get(author)
if messageList: if messageList:

View File

@@ -17,7 +17,7 @@ wordcloud = WordCloud(
contour_width=1, # For consistent layout between runs contour_width=1, # For consistent layout between runs
) )
for author in frequency_dictionary.keys(): for author in frequency_dictionary:
freq_dict = frequency_dictionary.get(author) freq_dict = frequency_dictionary.get(author)
image = wordcloud.generate_from_frequencies(freq_dict) # type: ignore image = wordcloud.generate_from_frequencies(freq_dict) # type: ignore
image.to_file(f"output/{author}.png") # type: ignore image.to_file(f"output/{author}.png") # type: ignore