1.文本处理,分割单词,去除标点符号
txt = '''The autumn, with its ripening fruits, and waving harvest, is now with us. We
see on every hand the results of the farmer's toil and forecast in the springtime.
Then it was that he broke up the soil, sowed the seed, pruned his trees, and
guarded the tender plants. Now we see the ripening crops. The trees are bending
with golden fruit, and abundance rewards farmer's toil.The'''
txt = txt.lower()
for ch in ',.?/\{]}[";:':
txt
python实现英文词频统计
最新推荐文章于 2024-06-08 22:19:22 发布