Пример #1
0
        public static String InformationsCode(List <CodeInformationCell> list)
        {
            String answer = String.Empty;

            answer += Environment.NewLine + "Энтропия = " + FunctionsClass.Entropy().ToString();
            answer += Environment.NewLine + "Средняя длина = " + CodeInformationCell.MedLenghtList(list);
            answer += Environment.NewLine + "неравенство Крафта-Макмиллана : " + CodeInformationCell.CraftMacmillan(list);
            return(answer);
        }
Пример #2
0
        private async void btnCoding_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                String inputText = txtInput.Text;
                FunctionsClass.LoadFrequency(inputText);

                List <CodeInformationCell> haffmanCode = await Task.Factory.StartNew(HaffmanCoding.Code);

                String allInformation = HaffmanCoding.InformationsCode(haffmanCode);

                ChangeTextDocument(ListToString(haffmanCode), docHaffman);
                ChangeTextDocument(allInformation, docCommon);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"help: [email protected]" + Environment.NewLine + ex.StackTrace, ex.Message);
            }
        }