示例#1
0
        public static void Count2()
        {
            Alphabet        russian = new RussianAlphabet();
            AlphabetCounter counter = new AlphabetCounter(russian);

            CountInFile(counter, PATH + "Шифр.txt", "");

            string message = File.ReadAllText(PATH + "Шифр.txt");
            //Chiper caesar = new CaesarChiper(10, alphabets);
            Chiper caesar = new CaesarChiper(16, alphabets);
            string res    = caesar.Encode(message);

            Console.WriteLine(res);
            Console.ReadLine();
        }
示例#2
0
        public static void Counting()
        {
            Alphabet        russian = new RussianAlphabet();
            AlphabetCounter counter = new AlphabetCounter(russian);

            counter.Add(SAMPLE_TEXT);

            Console.WriteLine(counter);
            Console.WriteLine(
                new DataPresenter().ToDiagram(counter));
            counter.Clear();
            Console.ReadLine();

            CountInFile(counter, RAVEN_TXT, RAVEN_ANNOUNCE);
            CountInFile(counter, CS_TYPES, CS_TYPES_ANNOUNCE);
            CountInFile(counter, PARABLE, PARABEL_ANNOUNCE);
        }
        public string CreateIndexTest()
        {
            var      alphabet = new RussianAlphabet();
            var      time     = new Stopwatch();
            IIndexer indexer  = StaticVariables.Container.Resolve <IIndexer>(new ResolverOverride[] {
                new ParameterOverride("alphabet", alphabet)
            });

            ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
            using (ExcelPackage excelPackage = new ExcelPackage())
            {
                //Set some properties of the Excel document
                excelPackage.Workbook.Properties.Author  = "VDWWD";
                excelPackage.Workbook.Properties.Title   = "Title of Document";
                excelPackage.Workbook.Properties.Subject = "EPPlus demo export data";
                excelPackage.Workbook.Properties.Created = DateTime.Now;

                //Create the WorkSheet
                ExcelWorksheet worksheet = excelPackage.Workbook.Worksheets.Add("Sheet 1");

                //Add some text to cell A1
                worksheet.Cells["A1"].Value = "My first EPPlus spreadsheet!";
                try
                {
                    for (int i = 0; i < 100; i++)
                    {
                        var startup = new Stopwatch();
                        startup.Start();
                        indexer.CreateIndex(StaticVariables.Dictionary);
                        startup.Stop();
                        Console.WriteLine("Search: " + startup.ElapsedMilliseconds.ToString());
                        worksheet.Cells[i + 1, 1].Value = startup.ElapsedMilliseconds.ToString();
                    }
                }
                catch (Exception exc)
                { }
                //Save your file
                FileInfo fi = new FileInfo(@"C:\Users\Pasha\Documents\AutoCorrection\Index.xlsx");
                excelPackage.SaveAs(fi);
            }
            return(null);
        }
示例#4
0
        public static void Alphabet()
        {
            Alphabet russian = new RussianAlphabet();

            for (int i = 0; i < russian.AlphabetSize; i++)
            {
                char c   = russian.GetChar(i, true);
                int  pos = russian.GetPosition(c);
                Console.WriteLine("{0} ({1})", c, pos);
            }

            string upperCase = russian.Symbols;

            Console.WriteLine(upperCase);
            string lowerCase = upperCase.ToLower();

            Console.WriteLine(lowerCase);

            Console.ReadLine();
        }