Initial commit
This commit is contained in:
32
README.md
Normal file
32
README.md
Normal file
@ -0,0 +1,32 @@
|
||||
# Wordcloud of my ILRI Work
|
||||
|
||||
## Generate
|
||||
Concatenate text files together, put every word on its own line, and do some minor replacements to remove HTML tags, Markdown, and normalize some technical terms:
|
||||
|
||||
```console
|
||||
$ cat changelog/*.txt ~/src/git/cgspace-notes/content/posts/* | tr -s '[:blank:]' '\n' | sed -f src/replacements.sed | fgrep -vwf src/stopwords-en.txt > src/work.txt
|
||||
```
|
||||
|
||||
Then create a normal wordcloud:
|
||||
|
||||
```console
|
||||
$ wordcloud_cli --text src/work.txt --stopwords src/stopwords-en.txt --fontfile /usr/share/fonts/TTF/CascadiaCode.ttf --height 1080 --width 1920 --imagefile wordcloud.png
|
||||
```
|
||||
|
||||
And create the cow-shaped wordcloud:
|
||||
|
||||
```console
|
||||
$ src/masked.py
|
||||
```
|
||||
|
||||
This code is based on [`examples/masked.py`](https://github.com/amueller/word_cloud/blob/master/examples/masked.py) in the `word_cloud` project.
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
- List of stop words for English: [stopwords-iso/stopwords-en](https://github.com/stopwords-iso/stopwords-en)
|
||||
- Using [amueller's Python word_cloud package and example code](https://github.com/amueller/word_cloud)
|
||||
- Cow image used in mask from: [all-free-download.com](https://all-free-download.com/free-vector/download/farm-cow-icon-colored-cartoon-sketch_6843157.html)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
Reference in New Issue
Block a user