예제 #1
0
 static void Main()
 {
     Console.Write("enter sentence to split: ");
     try
     {
         var result = new WordFrequency().GetWordFrequency(Console.ReadLine());
         foreach (var item in result)
         {
             Console.WriteLine($"{item.Key}:{item.Value}");
         }
     }
     catch (NullReferenceException ex)
     {
         PrintException(ex);
     }
     catch (ArgumentException ex)
     {
         PrintException(ex);
     }
     catch (FormatException ex)
     {
         PrintException(ex);
     }
     catch (Exception ex)
     {
         PrintException(ex);
     }
 }
예제 #2
0
        static void Main()
        {
            Console.Write("enter sentence to split: ");
            var result = new WordFrequency().GetWordFrequency(Console.ReadLine());

            foreach (var item in result)
            {
                Console.WriteLine($"{item.Key}:{item.Value}");
            }
        }