Commit b67f941f by BellCodeEditor

save project

parent 1c30a202
Showing with 2 additions and 2 deletions
......@@ -10,7 +10,7 @@ words = jieba.lcut(txt)
counts={}
chiyun=[]
for word in words:
if len(word)<2:
if len(word)<3:
continue
else:
counts[word]=counts.get(word,0)+1
......@@ -20,7 +20,7 @@ for i in range(len(items)):
word,counts=items[i]
chiyun.append(word)
print(chiyun)
maskph=np.array(Image.open('alice.png'))
maskph=np.array(Image.open('bell.png'))
text_cut='/'.join(chiyun)
wc=WordCloud(mask=maskph,background_color="white",max_words=2000,height=400,width=800,max_font_size=50,stopwords=" ",
font_path='simhei.ttf').generate(text_cut)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment