Skip to content

Commit

Permalink
Merge pull request #19 from astralcai/master
Browse files Browse the repository at this point in the history
解决span和class成为个性签名中高频词的问题以及用空白头像代替无头像的好友
  • Loading branch information
yangxuanxc authored Jul 29, 2018
2 parents 351465a + 9e19f96 commit 10322ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#author:微信公众号:大数据前沿
#查看代码讲解,视频教程,请微信添加好友搜索公众号[大数据前沿]查看历史消息获取。
import json
import re
from pyecharts import Bar
from pyecharts import Grid
from pyecharts import WordCloud
Expand Down Expand Up @@ -101,6 +102,7 @@ def counter2list(_counter):
return name_list,num_list

def get_tag(text,cnt):
text = re.sub(r"<span.*><span>", "", text)
print ('正在分析句子:',text)
tag_list = jieba.analyse.extract_tags(text)
for tag in tag_list:
Expand All @@ -122,13 +124,16 @@ def mergeImage():
for root, dirs, files in os.walk(dirName):
for file in files:
if "jpg" in file and os.path.getsize(os.path.join(root, file)) > 0:
photo_path_list.append(os.path.join(root, file))
photo_path_list.append(os.path.join(root, file))
elif "jpg" in file and os.path.getsize(os.path.join(root, file)) == 0:
photo_path_list.append(os.path.join("./source", "empty.jpg"))

#print(photo_path_list)
pic_num = len(photo_path_list)
#每行每列显示图片数量
line_max = int(math.sqrt(pic_num))
row_max = int(math.sqrt(pic_num))
print(line_max, row_max, pic_num)

if line_max > 20:
line_max = 20
Expand Down
Binary file added source/empty.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 10322ee

Please sign in to comment.