码迷,mamicode.com
首页 > 其他好文 > 详细

Word frequency analysis

时间:2014-08-10 23:51:20      阅读:278      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   os   io   2014   ar   cti   

Write a program that reads a file, breaks each line into words, scripts whitespace and punctuation from the words, and converts them to lowercase. Modify the program to print the 20 most frequently-used words in the book.

First I downloaded the e-book ‘ELSIE‘S WINTER TRIP’ in the below dictionary:

  bubuko.com,布布扣                     

 

Scripts:

 

 bubuko.com,布布扣

bubuko.com,布布扣

 

from Thinking in Python

Word frequency analysis,布布扣,bubuko.com

Word frequency analysis

标签:style   blog   http   os   io   2014   ar   cti   

原文地址:http://www.cnblogs.com/ryansunyu/p/3903443.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!