in reply to Re: Re: How keep the count...
in thread How keep the count...

Anonymous Monk,
Your insistence on using a hash strengthens my feeling that this is a homework problem. While I do not mind homework problems nearly as much as other monks, if this is homework you should state: Now to answer your questions, there is no need to use a hash. you could change:
# push @offsets, $_ - $first + 1; # to push @offesets, [ $line , $_ - $first + 1 ]; # and # print "$_\n" for @offsets; # to print "$_->[0] : $_->[1]\n" for @offsets;
Cheers - L~R

Replies are listed 'Best First'.
Re: Re: Re: Re: How keep the count...
by Anonymous Monk on Mar 03, 2004 at 18:47 UTC
    This is not a "homework", is a project in language generation. There are not specific requirements, we have to find ways to generate natural phrases, idioms, expressions etc. This was one of the ideas: train a large file and find those sentences where the co-occurrence of n words occur in n specific gap. Find the most frequent offset and retrieve the sentence to check in which context they appear. The insistence of hashes is dumb, I just wanted to prove my point... somebody that validate my idea that hash was the only solution..:-(
    Sorry that I did not provide more information before, I only wanted to keep it simple. Thanks