文件方式实现完整的英文词频统计实例

4.排除语法型词汇html exp={'','to','have','a'} keys=set(words)-exp#出现过单词的集合,字典的key. 5.排序post for i in keys: d[i]=words.count(i) #print(d) wc=list(d.items()) wc.sort(key=lambda x:x[1],reverse=True)#排序 prin
相关文章
相关标签/搜索