示例#1
0
        private static void AnalysisLogic(string diretoryPath, OutputMaster outputMaster)
        {
            List <AnnotationItem> annotationList = GetAnnotationsFromAllDb(diretoryPath);

            var bookMenu = annotationList.Select(a => a.BookTittle).Distinct().ToList();

            bookMenu.Add("All");
            MenuMaster bookMenuMaster = new MenuMaster(bookMenu);

            string bookAnswer = bookMenuMaster.GetAnswer("Choice book for analysis", true);

            if (bookAnswer != "All")
            {
                annotationList = FilterByBook(annotationList, bookAnswer);
            }

            string bookShortName = GetShortName(bookAnswer);



            var uniq = UniqAnnotaion(annotationList);

            outputMaster.Save(uniq, "UniqAnnotaion" + "_" + bookShortName);

            var words = WordsAddings(annotationList);

            outputMaster.Save(words, "WordsRepeat" + "_" + bookShortName);

            var pages = PagesPerDay(annotationList);

            outputMaster.Save(pages, "PagesPerDay" + "_" + bookShortName);


            for (int i = 3; i <= 6; i++)
            {
                var sameRoot = SameRoot(annotationList, i);
                outputMaster.Save(sameRoot, $"SameRoot_len{i}");
            }
        }
示例#2
0
        static void Main(string[] args)
        {
            try
            {
                var          profile      = BookProfile.GetProfile();
                var          l            = new LionSupporter();
                OutputMaster outputMaster = new OutputMaster(@"C:\AllHarry\");

                MenuMaster mainMenu = new MenuMaster(new string[] {
                    "Get new annotation",
                    "Copy annotation to PC",
                    "Analysis annotation",
                    "Print Lingualeo Dictionary"
                });

                mainMenu.GetAnswer("", true);
                if (mainMenu.Answer == "Get new annotation")
                {
                    List <string> importResult = ImportLogic(profile, l.Words);
                    string        timeString   = DateTime.Now.ToString("dd-MM-yy_hh-mm");

                    outputMaster.Print(importResult);
                    List <string> resultData = HtmlMaster.GetHtmlList(importResult);
                    outputMaster.Save(resultData, timeString);
                }

                if (mainMenu.Answer == "Copy annotation to PC")
                {
                    MenuMaster.GetConfidentAnswer();
                }

                if (mainMenu.Answer == "Analysis annotation")
                {
                    AnalysisLogic(@"C:\AllHarry\", outputMaster);
                }

                if (mainMenu.Answer == "Print Lingualeo Dictionary")
                {
                    //int h = Console.LargestWindowHeight;
                    //int wi = Console.LargestWindowWidth;
                    //Console.BackgroundColor = ConsoleColor.Black;
                    //Console.ForegroundColor = ConsoleColor.DarkGreen;
                    //Console.SetWindowSize(wi, h);

                    //Console.Clear();
                    //Console.WriteLine("99");
                    //for (int i = 0; i < h - 3; i++)
                    //{
                    //    string temp = "";
                    //    for (int y = 0; y < wi - 4; y++)
                    //    {
                    //        temp += "-";
                    //    }
                    //    Console.WriteLine(temp);
                    //}
                    //Console.ReadLine();



                    outputMaster.Print(l.Words.Where(w => w.CleanWord.Contains(' ')).Take(10).ToList());
                    outputMaster.Save(l.Words, "dict");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + " " + ex.StackTrace);
            }
            Console.WriteLine("All done!!!!!");
            Console.ReadLine();
        }