jieba尝鲜
作者:互联网
import jieba strings = '我工作在安徽的安徽师范大学,这个大学很美丽,在芜湖' # print(dir(jieba)) dic_strings = {} lst_strings = jieba.lcut(strings) for ci in lst_strings: # 对得到的分词进行汇总 dic_strings[ci] = lst_strings.count(ci) # 更改字典中单词出现的次数 print(dic_strings)
2020-05-25
标签:jieba,尝鲜,ci,dic,lst,print,strings 来源: https://www.cnblogs.com/hany-postq473111315/p/12957868.html