mirror of
https://github.com/StefBuwalda/whatsapp-wordcloud.git
synced 2025-10-30 11:19:57 +00:00
refactoring
This commit is contained in:
@@ -21,7 +21,7 @@ test = processRawMessages(chat)
|
||||
|
||||
frequency_dictionary: dict[str, dict[str, int]] = {}
|
||||
|
||||
for author in test.keys():
|
||||
for author in test:
|
||||
frequency_dictionary[author] = {}
|
||||
messageList = test.get(author)
|
||||
if messageList:
|
||||
|
||||
@@ -17,7 +17,7 @@ wordcloud = WordCloud(
|
||||
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)
|
||||
image = wordcloud.generate_from_frequencies(freq_dict) # type: ignore
|
||||
image.to_file(f"output/{author}.png") # type: ignore
|
||||
Reference in New Issue
Block a user