mirror of
				https://github.com/StefBuwalda/whatsapp-wordcloud.git
				synced 2025-10-30 19:29:57 +00:00 
			
		
		
		
	refactoring
This commit is contained in:
		| @@ -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: | ||||||
|   | |||||||
| @@ -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 | ||||||
		Reference in New Issue
	
	Block a user