Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: please reply

by karlgoethebier (Vicar)
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 lurking in the Monastery: (4)
As of 2015-07-06 05:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls