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)