Tuesday, 28 May 2013

Ne m'accusez pas...

A little earlier this evening I was shamefully accused of having a thing for bacon. Now don't get me wrong, I like bacon, but it's not a thing, it's a food and I talk about other things far more...

But how to prove it? You see, the problem is my friend Ray is obviously unhinged as he believes he's right when we all know it's *me* that's right. Or sometimes my flatmate. Actually she's usually right as well.

So I decided the best thing was download all 21,454 tweets to that point and do a little simple analysis.

First up, some code. Yep, the actual day job being used to settle a question of my wordy honour.

#!/usr/bin/perl -w
use strict;
use warnings;
use Text::CSV;

my $csv = Text::CSV->new ( { binary => 1 } ) or die "Cannot use CSV: ".Text::CSV->error_diag ();
open my $fh, "getline( $fh ) )
        my $t=$row->[7];
        my @w=split(/\s+/,lc($t));
        foreach (@w)
                $words{$_}=0 if !defined $words{$_};
$csv->eof or $csv->error_diag();close $fh;

foreach (sort { $words{$a} <=> $words{$b} } keys %words){X("$_: $words{$_}");}
sub X{print join(' ',@_,"\n");}

So if you happen to have a handy perl interpreter and your downloaded tweets you can do the same.
I ran the code
./annoyRayWithMyPedantry.pl > r.txt
And then had a look for teh baconz...
victoria@victoriaDev:~/tweets# grep bacon r.txt
bacongate: 1
baconsandwich: 1
baconz: 23
bacon: 29
So let's add these up. 54. Yep, in 21,454 tweets I mentioned bacon 54 times. And some of those will be in the same tweets. Hmm. What other things did I mention 54 times, let me see now...

victoria@victoriaDev:~/tweets# grep ': 54\s$' r.txt
@seismicshed: 54
note: 54
wear: 54
called: 54
either: 54
possibly: 54
lady: 54
conversation: 54
needed: 54
room: 54

Well that wasn't very interesting. So here are some other things I'm known for:

  • Cocktails: 71
  • Champagne 102
  • Wine 124
  • Pie 64
  • Bread 175
  • Vodka 34
  • Tea 150
  • Boss 82 (I knowz!)
  • Knowz 35 ;-)
At the same time I've snorked 190 times, giggled 368 times and only been shocked 98 times.

But, and this is no shocker, I've written face 1,223 times. And a bit. Hold on a minute though, where does the accuser fit in? Well, it turns out, not badly: 806 times. Or, in my world, he's 15 times more "popular" than bacon. Though not as popular as my two best friends ;-)

So there we have it, bacon is not a thing. Got that?

No comments:

Post a Comment