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

Re^2: hash comparison

by sarvan (Sexton)
on Jul 25, 2011 at 07:47 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found