Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: please reply

by karlgoethebier (Curate)
on Jan 06, 2013 at 13:20 UTC ( #1011883=note: print w/ replies, xml ) Need Help??


in reply to please reply

"explain this code"

No.

Best regards, Karl

Update:... doesn't this look better...?

#!/usr/bin/perl + @bigrams = (); while (<>) { chomp; push @words, split( /\s+/, $_ ); } for ( $i = 0 ; $i < $#words ; $i++ ) { $bigram = $words[$i] . $words[ $i + 1 ]; $found = -1; for ( $index = 0 ; $index <= $#bigrams ; $index++ ) { { if ( $bigrams[$index] eq $bigram ) { $found = $index; } } } if ( $found > -1 ) { $bigramfrequency[$found]++; } else { push( @bigrams, $bigram ); $bigramfrequency[$#bigrams]++; } } print "Bigrams\n"; for ( $index = 0 ; $index < @bigrams ; $index++ ) { print "$bigrams[$index] : $bigramfrequency[$index]\n"; }

Update2:... and your data...?

Please see the recommendations above how to continue...

«The Crux of the Biscuit is the Apostrophe»


Comment on Re: please reply
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1011883]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-08-30 18:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls