![]() |
|
Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
hi there,
I have a hash map %result(). which has key,value pair. The key is $val(which has list of floating point values like 0.45458427 and value is $url which has list of urls I use this hash map to print the url which the highest value in $val(i.e key). my Question now is, when this $val has two or more values same i.e {value1:0.456234,val2:0.642323,val3:0.456234,val4:0.456234). what happens it prints the val4's url instead of val1's url. since val1,val3,val4 has the same score, I want it to go in order 1,2,3 like that. But it directly prints 4th. What can be the suggestion..??My code is this. i cant include the content of @file_content,because it very big. it has title,url,snippet for googles top 10 result. And "jaccard($tit,$title) is a funtion returns floating point value. since its also big i dint include. lets say $val has the following floating point values: 1-> 0.0588235294117647 2-> 0.0555555555555556 3-> 0.0588235294117647 4-> 0.0588235294117647 5-> 0 6-> 0.0555555555555556 7-> 0.0588235294117647 8-> 0.0555555555555556 here i expect the url of 2nd but getting url of 6th.. In reply to hash map to give preference to 1st match by sarvan
|
|