A simple wrapper of "jieba" and "wordcloud" in Python 3.

Xi Ruoyao e8f3041ad2 Add .gitignore %!s(int64=7) %!d(string=hai) anos
.gitignore e8f3041ad2 Add .gitignore %!s(int64=7) %!d(string=hai) anos
README.md 6dc0837f23 Add license %!s(int64=7) %!d(string=hai) anos
example.in 04a6c9fa1a Initial commit %!s(int64=7) %!d(string=hai) anos
pos.txt c320792de3 Add Part of Speech table %!s(int64=7) %!d(string=hai) anos
wordfreq.py 5577ddb988 Do not output debug info by default %!s(int64=7) %!d(string=hai) anos

README.md

Wordfreq script

Prerequisites

  • Python 3
  • Python 3 modules: wordcloud, PIL, matplotlib, numpy, and jieba
  • The TTF/OTF file of the font you want to use

Example

wget https://bf.mengyan1223.wang/assets/fonts/{SourceHanSans.ttc,ttc2ttf.py}
python3 ttc2ttf.py SourceHanSans.ttc
./wordfreq.py -i example.in -o example.png -p n,ne -f SourceHanSans10.ttf -t 60

You should use Source Han Sans font under the terms of SIL Open Font License 1.1.

Parts of speech

See pos.txt, origin gist by hscspring.

Acknowlegement

And, special thanks to Lao She who authors example.in (Mr. Breeches, 1933).