Just another Perl shrine | |
PerlMonks |
string similarity by using a function sort_by_similarity()by roopa (Initiate) |
on Nov 08, 2009 at 08:46 UTC ( [id://805738]=perlquestion: print w/replies, xml ) | Need Help?? |
roopa has asked for the wisdom of the Perl Monks concerning the following question:
hello,
I am trying to compare string similarity based on the function sort_by_similarity().The strings are stored as array of hashes,I am unable to understand the way to get the sorted strings by similarity.
I tried it in this way.
Here $inputsubs$x{'sequence'} gives the input string and this is compared with the strings in @querysubs. Ex:-If the input string is It gets divided into abc bcd cde def according to 3 as the windowsize. If the query sequence is abcefg It even gets divided into abc bce cef efg I need to compare each of the strings in the inputsubs with the querysubs and get the best matching string for each of these strings using the function sort_by_similarity(),but I am unable to understand the value returned by the function and unable to access the values and print them. Please help me in solving out this problem.Regards, Roopa 20091109 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
Back to
Seekers of Perl Wisdom
|
|