Ejemplo 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();
 }
Ejemplo n.º 2
0
        private static string RecognizeSport(string sport)
        {
            var sportSoundex = Soundex.Generate(sport);

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