|
|
|
@ -9,6 +9,7 @@ txt = f.read()
|
|
|
|
|
print(txt)
|
|
|
|
|
string = ''.join(jieba.lcut(txt))
|
|
|
|
|
print(string)
|
|
|
|
|
# 设置词云图格式
|
|
|
|
|
wc = wordcloud.WordCloud(
|
|
|
|
|
width=1000,
|
|
|
|
|
height=1000,
|
|
|
|
@ -17,5 +18,5 @@ wc = wordcloud.WordCloud(
|
|
|
|
|
font_path='msyh.ttc',
|
|
|
|
|
scale=15,
|
|
|
|
|
)
|
|
|
|
|
wc.generate(string)
|
|
|
|
|
wc.generate(string) # 生成
|
|
|
|
|
wc.to_file('弹幕词云.png')
|
|
|
|
|