Python进行词频统计
基础python统计词频,未考虑到删除停用词# 词频统计def getText():#处理文件 txt=open("English.txt","r").read() txt = txt.lower()#将英文全部变为小写 for ch in '!"#$&*+,-./:;<=>?@[\\]^_{}|': txt = txt.replace(ch," ") return txtmyTxt = getText()words = myT
原创
2020-06-29 21:08:16 ·
8222 阅读 ·
0 评论