[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question for candidate Robinson



On Mon, Mar 07, 2005 at 01:46:58PM -0500, Branden Robinson wrote:
> It's worth considering the question of whether prominence equals extremism.
> To that end, I dashed off a quick Python script (attached) and fed it my
> debian-legal folder, which in its present state contains all the mails I've
> been sent from that list (I subscribe to it) since 1 January 2004.

True to form, I said I'd attach the script and forgot to do so.  Thanks to
Romain Francoise for pointing this out to me.

It's pretty trivial, and doesn't deserve the attention I am calling to it
by having to follow-up to myself just to supply it.  :)

Still, since I bandied about statistics, I figured it was only fair to
expose my method.

(This reads directly from a mailbox and come to think of it, the sorted()
call is not useful.  Here's how I processed the output for the "top ten
list":

$ ./countfrom <~/Mail/debian-legal | sort -n | tac | head

)

-- 
G. Branden Robinson                |    I'm reluctant to use fancy
Debian GNU/Linux                   |    polysyllables like "philosophy" to
branden@debian.org                 |    refer to what seems ordinary common
http://people.debian.org/~branden/ |    sense.              -- Noam Chomsky
#!/usr/bin/python2.4

import re
import sys

# Dictionary to hold unique From: lines.
index = { }

for line in sys.stdin:
    # We're only interested in From: header lines.
    expr = re.compile(r'^From: ')
    if expr.match(line):
        if line not in index.keys():
            index[line] = 1
        else:
            index[line] = index[line] + 1

for item in sorted(index.keys()):
    sys.stdout.write("%s\t%s" % (index[item], item))

# vim:set ai et sts=4 sw=4 tw=80:

Attachment: signature.asc
Description: Digital signature


Reply to: