Commit 187fee14 authored by 张彦钊's avatar 张彦钊

change test file

parent ce377adc
......@@ -93,12 +93,30 @@ def tag_boost(cid_str, tag_list=[15,21,22,85,86]):
tmp = i[1].split(",")
tag_cids[i[0]] = tmp
left_cids.extend(tmp)
print(tag_cids)
left_cids = list(set(left_cids))
right_cids = [i for i in cids if i not in left_cids]
print(len(left_cids))
print(len(right_cids))
print(len(cids))
tag_cids["right"] = right_cids
tag_list.append("right")
sort_cids = []
while True:
for i in tag_list:
if i in tag_cids.keys():
n = 0
if len(tag_cids[i]) > 0:
sort_cids.append(tag_cids[i][0])
value = tag_cids[i]
value.pop(0)
tag_cids[i] = value
if len(value) == 0 and i != "right":
n = n + 1
else:
n = n +1
if n == len(tag_cids)-1:
if len(tag_cids["right"]) > 0:
sort_cids.extend(tag_cids["right"])
return sort_cids
else:
return cid_str
......
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 to comment