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(); }
private static string RecognizeSport(string sport) { var sportSoundex = Soundex.Generate(sport); return(knownSports.FirstOrDefault(knownSport => Soundex.Generate(knownSport) == sportSoundex) ?? "unidentified"); }