['试管', '排行榜', '苏州', '试管', '苏州', '苏州', '苏州试管', '医院', '排名', '医院']
1.去除重复的
2.顺序不变
3.去除 子项是另外一个子项的部分被包含
比如上面这个
def clean_son_word(word_list):
word_list = sorted(list(set(word_list)), key=word_list.index)
for i in word_list:
for j in word_list:
if len(j) < len(i) and j in i:
word_list.remove(j)
return word_list
['试管', '排行榜', '苏州', '试管', '苏州', '苏州', '苏州试管', '医院', '排名', '医院']
这样应该可以了!