Bobby_1234
January 3rd, 2009, 07:00 PM
Hi,
I am writing a program that stores lists of a type of object called 'Fixture'. Each Fixture object has members string team1, string team 2, to identify it. However I'm running into problems when trying to search through these lists for specific fixtures, e.g. a Fixture might have team1="A Villa", team2="West Brom", or another list may have team1="Aston Villa", team2="W Brom".
I need my code to recognise that these two things are actually the same fixture. The standard functions like '.Contains()' don't really do it. Anyone got any ideas? I was using some algorithm called the Levenshtein distance to gauge the similarity of two strings, and it's ok, but it also matches things that aren't the same sometimes, which is a pain.
Cheers
I am writing a program that stores lists of a type of object called 'Fixture'. Each Fixture object has members string team1, string team 2, to identify it. However I'm running into problems when trying to search through these lists for specific fixtures, e.g. a Fixture might have team1="A Villa", team2="West Brom", or another list may have team1="Aston Villa", team2="W Brom".
I need my code to recognise that these two things are actually the same fixture. The standard functions like '.Contains()' don't really do it. Anyone got any ideas? I was using some algorithm called the Levenshtein distance to gauge the similarity of two strings, and it's ok, but it also matches things that aren't the same sometimes, which is a pain.
Cheers