Example #1
0
        static void Main(string[] args)
        {
            _scrabble = new Scrabble();
            _word     = new WordFrequencyCountOne();

            IDictionary <string, int> words    = _word.FrequencyWordsCount(filePath);
            IDictionary <string, int> dicScore = new Dictionary <string, int>();

            WordProcessor(words, out maxValue, out keyOfMaxValue, out most7CharWord, out key7OfMaxValue);
            IOrderedEnumerable <KeyValuePair <string, int> > sorteddicScore = SortedDict(words, dicScore);

            int highestScore    = sorteddicScore.FirstOrDefault().Value;
            var highestdicScore = sorteddicScore.Where(c => c.Value == highestScore).ToDictionary(x => x.Key, x => x.Value);

            Console.WriteLine($"Most frequent word: { keyOfMaxValue} occurred { maxValue } times");
            Console.WriteLine($"Most frequent 7 - character word: { key7OfMaxValue} occurred { most7CharWord} times");
            Console.WriteLine($"Highest scoring word(s) (according to Scrabble):");
            foreach (var item in highestdicScore)
            {
                Console.WriteLine($"{item.Key} with a score of {item.Value}");
            }
            Console.ReadKey();
        }
Example #2
0
 public void TestInit()
 {
     _scrabble = new Scrabble();
 }