三国演义人物出场顺序统计(文本词频统计)
1.使用jieba库 对中文文本进行分词2.使用字典表达词频(与hamlet案例相似)import jiebatxt = open("threekingdoms.txt","r",encoding="utf-8").read()words = jieba.lcut(txt)counts = {}for word in words: if len(word) == 1: continue else: