You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
1 year ago | |
---|---|---|
src | 1 year ago | |
LICENSE | 1 year ago | |
README.md | 1 year ago | |
cow-wordcloud.png | 1 year ago | |
poetry.lock | 1 year ago | |
pyproject.toml | 1 year ago | |
setup.cfg | 1 year ago | |
wordcloud.png | 1 year ago |
README.md
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:
$ 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:
$ 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:
$ src/masked.py
This code is based on examples/masked.py
in the word_cloud
project.
Acknowledgements
- List of stop words for English: stopwords-iso/stopwords-en
- Using amueller's Python word_cloud package and example code
- Cow image used in mask from: all-free-download.com
License
MIT