https://github.com/cracktc/wordcloud
A C# word cloud generator
https://github.com/cracktc/wordcloud
Last synced: 7 days ago
JSON representation
A C# word cloud generator
- Host: GitHub
- URL: https://github.com/cracktc/wordcloud
- Owner: CrackTC
- License: mit
- Created: 2024-02-09T13:56:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-07T04:33:23.000Z (7 months ago)
- Last Synced: 2025-05-14T02:33:34.535Z (2 months ago)
- Language: C#
- Homepage:
- Size: 702 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A C# word cloud generator, algorithm based on this [blog post](https://peekaboo-vision.blogspot.com/2012/11/a-wordcloud-in-python.html), with minor improvements.
---
## Usage
```csharp
using var cloud = new WordCloudBuilder()
.WithSize(800, 600)
.WithPadding(5)
.Build()var dict = File.ReadAllText("path/to/your/text/file.txt")
.Split(' ', StringSplitOptions.RemoveEmptyEntries)
.Where(w => w.All(char.IsLetter))
.GroupBy(w => w)
.ToDictionary(g => g.Key, g => g.Count());using var image = cloud.GenerateImage(dict);
using var stream = File.OpenWrite("path/to/your/output/image.png");
image.Encode().SaveTo(stream);
```## Example
see [example](https://github.com/CrackTC/WordCloud/tree/main/example)

## License
MIT