if i have to list of concepts and i want to find the similarity between these list how can i find how much two list similar? as an example if i have two list that describe book attribute list1(author, brand , isbn, category, amount) list2(author , price , brand)
+1
A:
The easiest way is probably to calculate the edit distance between each of the elements of the list.
Ignacio Vazquez-Abrams
2010-03-06 11:10:51
yes i will use edit distance to caculate the similarity betwwen concept names but also i want to calculate the percent of similarity between two lists i saw this function similarity= n/m where n is the number of matched concepts and m is the smaller cardinality of two lists i dont know if it is correct i see that m must be the list with more number of concepts do you agree me??
aman
2010-03-06 11:18:10
i wait for you responce
aman
2010-03-06 11:41:08
A:
Perl
Use this module , for comparing two lists elements. Compare # Compare elements of two or more lists
List::Compare ;
use Data::Dumper ;
use lib "specify the path ";
use List::Compare;
@Llist= ( 1,2,3,4,6) ;
@Rlist=(101,3,4,5,20,30) ;
$lc = List::Compare->new( \@Llist, \@Rlist);
print Dumper \$lc->get_intersection();
pavun_cool
2010-03-06 11:12:26
I have given you the example perl code for your requirement. go through and get to know.
pavun_cool
2010-03-06 12:45:45