# -*- coding: utf-8 -*-
import jieba
txt = open('gaopin.txt','r').read()
words = jieba.lcut(txt)
print(words)
counts = {}
for word in words:
if len(word) == 1:
continue
else:
counts[word] = counts.get(word,0) + 1
print(counts)
jieguo=[]
jieguo=sorted(counts.items(),key=lambda x:x[1],reverse=True)
print(jieguo)