import re
with open("text.txt") as f:
#读取文件中的字符串
txt = f.read()
#去除字符串中的标点、数字等
txt = re.sub('[,\.()":;!@#$%^&*\d]|\'s|\'', ''
用python统计英文文章词频
最新推荐文章于 2024-05-09 05:18:01 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
import re
with open("text.txt") as f:
#读取文件中的字符串
txt = f.read()
#去除字符串中的标点、数字等
txt = re.sub('[,\.()":;!@#$%^&*\d]|\'s|\'', ''