Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Finding Combinations of Pairs

by zod (Scribe)
on Jan 14, 2009 at 07:23 UTC ( #736151=note: print w/ replies, xml ) Need Help??


in reply to Re: Finding Combinations of Pairs
in thread Finding Combinations of Pairs

Thanks for the reply. I didn't consider combining the pairs into a single value. Next time I will. Thanks.


Comment on Re^2: Finding Combinations of Pairs
Re^3: Finding Combinations of Pairs
by andye (Curate) on Jan 14, 2009 at 23:14 UTC
    BTW - and being serious now - you don't actually need to combine them into a single value.

    If you do something like:

    $h->{$word1}->{$word2}++
    instead of
    $h->{"$word1 $word2"}++
    in the centre of the loops, then you end up with a useful tree-like structure, which gives you a quick index of, for each word, how many times each other word appears in combination with it.

    Try it and use Data::Dumper to print the output, and you'll see what I mean.

    Although I appreciate that may not be what the homework called for. <grin>

    Best wishes, andy.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2014-12-27 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (177 votes), past polls