Quality Check on literature – A Software based approach
A quick python hack on to prove a point. To ‘just’ show how low people can stoop in the name of literature. Copy paste any boring text onto a file. Now run the following python script on the file.
import sys
import pprint
if len(sys.argv) < 2:
exit(1)
fd = file(sys.argv[1], ‘r’)
pp = pprint.PrettyPrinter()
lines = fd.readlines()
count = {}
for line in lines:
words = line.split(” “)
for word in words:
if not count.has_key(word):
count[word] = 1
else:
count[word] = count[word] + 1
pp.pprint(count)
The script returns a dictionary of words and word count. This python script is limited in its prowess, It can’t catch ‘em all. But don’t lose heart. Open source saves the day, and i give it with CYL (choose your license) license.
-
Archives
- September 2010 (2)
- December 2009 (1)
- September 2009 (1)
- May 2009 (2)
- March 2009 (1)
- February 2009 (1)
- December 2008 (2)
- November 2008 (1)
- October 2008 (1)
- September 2008 (1)
- July 2008 (3)
- June 2008 (5)
-
Categories
-
RSS
Entries RSS
Comments RSS
