标签:pil eve mic ever 采集 dal odi inf 帮助
import re # 月亮与六便士共7313词 # 傲慢与偏见加上面这本书共这么多词10781 s="I‘m a father." with open("EnglishNovels/pride.txt", "r", encoding=‘utf8‘) as f: pattern=re.compile("[A-Za-z‘’]+") words=pattern.findall(f.read()) a=dict() for i in words: if i not in a: a[i]=1 else: a[i]+=1
print(len(a)) print(sorted(a.items(),key = lambda x:x[1],reverse = True))
python 关于词频统计的程序 打印出的高频率单词把他们用便利贴记下来帮助自己学英语(统计小说,或者爬虫采集英文小说)
标签:pil eve mic ever 采集 dal odi inf 帮助
原文地址:https://www.cnblogs.com/bestzj/p/12818763.html