static SimpleSubstitutionAnalyst()
        {
            alphabet = new List <char>(30);

            using (StreamReader reader = new StreamReader(file))
            {
                string s = reader.ReadLine();

                foreach (char c in s)
                {
                    alphabet.Add(c);
                }
            }

            int[] frequency = new int[alphabet.Count];

            using (StreamReader reader = new StreamReader(frequencyFile))
            {
                string s;
                int    i = 0;

                while ((s = reader.ReadLine()) != null)
                {
                    frequency[i++] = int.Parse(s);
                }
            }

            FreqComparer comparer = new FreqComparer(frequency);

            sortedAlphabet = new List <char>(alphabet);
            sortedAlphabet.Sort(comparer);
        }
        private List <char> FrequencySortedAlphabet(string text)
        {
            List <char> sorted = new List <char>(alphabet);

            int[] frequency = CountFrequencies(text);

            FreqComparer comparer = new FreqComparer(frequency);

            sorted.Sort(comparer);

            return(sorted);
        }