Esempio n. 1
0
 public BetIdentifier(string sport, string league, IEnumerable <string> contrahents)
 {
     Sport              = RecognizeSport(sport.ToLower());
     League             = league;
     Contrahents        = contrahents.ToList();
     ContrahentsSoundex = Contrahents.Select(name => Soundex.Generate(name)).ToList();
 }
Esempio n. 2
0
        private static string RecognizeSport(string sport)
        {
            var sportSoundex = Soundex.Generate(sport);

            return(knownSports.FirstOrDefault(knownSport => Soundex.Generate(knownSport) == sportSoundex) ?? "unidentified");
        }