static void Main(string[] args) { List<Album> albums = GetAlbums(@""); Distance dist = new Distance(); for (int i = 0; i < albums.Count - 1; i++) { for (int j = i + 1; j < albums.Count; j++) { string artistA = albums[i].Artist; string artistB = albums[j].Artist; string albumA = albums[i].AlbumName; string albumB = albums[j].AlbumName; int yearA = albums[i].Year; int yearB = albums[j].Year; if (artistA == artistB && albumA == albumB && yearA != yearB) { Console.WriteLine(albums[i].ToString()); Console.WriteLine(albums[j].ToString()); break; } string a = albums[i].ToString(); string b = albums[j].ToString(); float large = Math.Max(a.Length, b.Length); float diff = (1 - (dist.LD(a, b) / large)) * 100; if (diff > 75) { Console.WriteLine(a); Console.WriteLine(b); Console.WriteLine("-- " + diff + "% similar."); } } } Console.WriteLine(albums.Count.ToString()); Console.WriteLine(trackCount); Console.ReadLine(); }
static void Main(string[] args) { /* string a = "Final Fantasy VI (OST) (Disc 1)"; string b = "Final Fantasy VII Advent Children (OST) (Disc 1)"; float longer = 0; if (a.Length > b.Length) { longer = a.Length; } else { longer = b.Length; } Distance dist = new Distance(); float diff = dist.LD(a, b); float percent = diff / longer; float result = (1 - percent) * 100; Console.WriteLine(dist.LD(a,b)); Console.WriteLine(result.ToString()); Console.ReadLine(); */ List<Album> albums = GetAlbums(@"K:\Uber\DL"); Distance dist = new Distance(); for (int i = 0; i < albums.Count - 1; i++) { for (int j = i + 1; j < albums.Count; j++) { string artistA = albums[i].Artist; string artistB = albums[j].Artist; string albumA = albums[i].AlbumName; string albumB = albums[j].AlbumName; int yearA = albums[i].Year; int yearB = albums[j].Year; if (artistA == artistB && albumA == albumB && yearA != yearB) { Console.WriteLine(albums[i].ToString()); Console.WriteLine(albums[j].ToString()); break; } string a = albums[i].ToString(); string b = albums[j].ToString(); float large = Math.Max(a.Length, b.Length); float diff = (1 - (dist.LD(a, b) / large)) * 100; if (diff > 75) { Console.WriteLine(a); Console.WriteLine(b); Console.WriteLine("-- " + diff + "% similar."); } } } Console.WriteLine(albums.Count.ToString()); Console.WriteLine(trackCount); Console.ReadLine(); }