lets-hack / hack-a-day

for our hack-a-day stuff
1 stars 0 forks source link

hamlet word count #2

Open gsharp opened 9 years ago

gsharp commented 9 years ago

hamlet word count

the output of your program will produce a word count for hamlet's lines.

sort the output starting from the most frequent to least frequent word.

example:

$ ./hamlet.py
the: 26
hello: 11
world: 5
cat: 2

here's a text file of the entire work for reference:

http://www.seanplusplus.com/hamlet.txt

Rules

jesse - the script can be in the language of your choice. glen - the script can not be in python or ruby.

gsharp commented 9 years ago

that’s so rad

there is a lot of script noise in there..as in names and [stuff] should that be omitted in the counts?

gsharp commented 9 years ago

from Sean:

i only want a word count for hamlet's lines.

thinking that your regex would start on any line after the string "Ham." and then end when someone else's line starts ... but dunno for sure haven't coded this yet!

screenshot

gsharp commented 9 years ago

I somewhat enjoy the irony of a writer who does lit support for a living doing e-discovery on a piece of literature by Shakespeare :)