Author Topic: Tag compare  (Read 13650 times)

Stephan Ritscher

  • Guest
Tag compare
« on: November 13, 2007, 14:12:29 »
Hi,
it would be nice, if tag compare was more configurable. I don't even know whether all tags are compare or simply some special.
And - if "compare only tags" is chosen in the options, only tags should be scanned (is much faster than also scanning file contents).

surbaniak

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Tag compare
« Reply #1 on: May 08, 2009, 21:45:43 »
To be perfectly honest I don't understand the % values in the   %tag column at all.
I am looking at a song that is 98% identical in content, and all the song tags shown on screen only differ by 3chars in the song title.  (there are about 75chars in the displayed tags)
And yet it reports only 63%   in the  %tag   column. Why ?

Can you throw some light on that %tag calculation ?

Seb

Admin

  • Administrator
  • Hero Member
  • *****
  • Posts: 624
    • View Profile
    • http://www.smilarityapp.com
Tag compare
« Reply #2 on: May 09, 2009, 00:26:43 »
its not secret (because its dummy)
WordsSimilarity - function what returns float in [0...1], 0-words not similar anywhere, 1 - duplicates

float f1=WordsSimilarity(md1.title,   md2.title);
float f2=WordsSimilarity(md1.artist,  md2.artist);
float tf1=WordsSimilarity(md1.title,  md2.artist);
float tf2=WordsSimilarity(md1.artist, md2.title);
if(tf1>=f1 && tf2>=f2) { f1=tf1; f2=tf2; }
//---
if(md1.title.empty())  f1=(max)(f1, WordsSimilarity(md1.filename, md2.title));
if(md2.title.empty())  f1=(max)(f1, WordsSimilarity(md1.title, md2.filename));
if(md1.artist.empty()) f2=(max)(f2, WordsSimilarity(md1.filename, md2.artist));
if(md2.artist.empty()) f2=(max)(f2, WordsSimilarity(md1.artist, md2.filename));
//---
float f3=WordsSimilarity(md1.filename, md2.filename);
float f4=WordsSimilarity(md1.album, md2.album);
//---
float max_k=0.0f;
if(f1!=0.0f || (md1.title.empty()==false && md2.title.empty()==false))       max_k+=0.4f;
if(f2!=0.0f || (md1.artist.empty()==false && md2.artist.empty()==false))     max_k+=0.3f;
if(f3!=0.0f || (md1.filename.empty()==false && md2.filename.empty()==false)) max_k+=0.15f;
if(f4!=0.0f || (md1.album.empty()==false || md2.album.empty()==false))       max_k+=0.15f;
if(max_k>0.0f) value_k=(f1*0.4f+f2*0.3f+f3*0.15f+f4*0.15f)/max_k;

after if (value_k>m_sensitivity) they similar by tag (m_sensitivity=0.75 in option dialog)
result % = ((max)((value_k-m_sensitivity)/(1.0f-m_sensitivity), 0.0f))*100.0f