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

Re^2: hash comparison

by sarvan (Sexton)
on Jul 25, 2011 at 07:47 UTC ( #916498=note: print w/replies, xml ) Need Help??

in reply to Re: hash comparison
in thread hash comparison

Hi, Thanks for the reply

And here is the doubt. suppose a word in the candidate that is not at all present in the reference, in such case it gives me the count as 1.(since 1 time it appeared in $cand). But, i expect it to be zero. because it dint appear in $ref..

An Example sentences: $candidate="it is not probable that it is the end"; $reference="it is unlikely that it is the end";

Replies are listed 'Best First'.
Re^3: hash comparison
by choroba (Cardinal) on Jul 25, 2011 at 13:29 UTC
    It is trivial to change the code I provided to give the expected result (in fact, you did not specify what to do if the term does not occur in the $reference, so I assumed you wanted to see the value from $candidate). Just remove 9 characters and add 5 somewhere :) (YMMW)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2023-09-25 10:17 GMT
Find Nodes?
    Voting Booth?

    No recent polls found