Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cracktc/wordcloud
A C# word cloud generator
https://github.com/cracktc/wordcloud
Last synced: 2 months 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 (12 months ago)
- Default Branch: main
- Last Pushed: 2024-10-31T16:18:58.000Z (3 months ago)
- Last Synced: 2024-11-16T09:07:55.939Z (2 months ago)
- Language: C#
- Homepage:
- Size: 683 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)
![example](https://raw.githubusercontent.com/CrackTC/WordCloud/main/example/wordcloud.png)
## License
MIT