Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Coding in Python

Name: Anonymous 2011-09-18 20:34

Hi guys.

It's clear that I don't know shit about programming, so let's get that out of the way.

I'm trying to define a python (2.x) function that'll loop through a number of texts, get the relative frequency of a certain word in each of those texts (number of times the word is used / total words * 100), and then sort the frequencies and tell me which text has the highest one and what the frequency for that text is.

I made a list with the texts as elements, and then I used a for-loop to go through the list. Getting and sorting the frequencies isn't hard if I stick them in a list, but I can't figure out how to keep the right texts associated with the sorted frequencies. If I make a list with pairs like '0.071203, <Text: Moby Dick by Herman Melville 1851>' , I can't sort the frequencies. If I make a list with just the frequencies, I don't know which texts they belong to.

Is there a simple way to do this?

Name: Anonymous 2011-09-19 0:49

>>10
hello, ``Redditor''

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List