|Just another Perl shrine|
Calculating "similarity"by Anonymous Monk
|on Mar 02, 2003 at 01:02 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
HI, I have some problems in doing the a perl program about similarity. See if anyone helps. thanks
Similiarity contains a formula to calculate liks this:
Similiarity = 2 x ( intersection/ total)
I tried to solve the problem, however i'm stuck in the middle. Since when i write the program, i need to run a stoplist in the program and fliter some words out from the stoplist before calculating the rest of the words in the files. The main point is to use one files and compare with the rest of the files.
However, when i was doing it, i do not know how to convert some command from hash to array or vice versa, therefore, i am stuck.
here's my script, i hope if anyone can help me.:
I just did until here, starting to fliter the words, then i am stuck in here since i do not know how to change the cammand into array.. here it is:
I am sure that this part needs to have some changes, however, I really do not understand. I hope there has people can help me to solve it thanks.