Beispiel #1
0
        public void Enter(NewWordsService service)
        {
            var allWords = service.GetAll();

            RenderKnowledgeHistogram(allWords);
            Console.WriteLine();
            Console.WriteLine();
            RenderAddingTimeLine(allWords);
            RenderExamsTimeLine(service.GetAllExams());

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
            Console.WriteLine();

            Console.WriteLine($"Context phrases count = {service.GetContextPhraseCount()}");
            Console.WriteLine($"Words count = {allWords.Count(w=>!w.OriginWord.Contains(' '))}");
            Console.WriteLine($"Words and sentences count = {allWords.Length}");


            var groups = allWords
                         .GroupBy(s => s.State)
                         .OrderBy(s => (int)s.Key)
                         .Select(s => new { state = s.Key, count = s.Count() });

            var doneCount = allWords.Count(a => a.PassedScore >= PairModel.MaxExamScore);

            Console.WriteLine($"Done: {doneCount} words  ({(doneCount * 100 / allWords.Length)}%)");
            Console.WriteLine($"Unknown: {allWords.Length - doneCount} words");
            Console.WriteLine();
            var learningRate = GetLearningRate(allWords);

            Console.WriteLine("Score is " + learningRate);
            if (learningRate < 100)
            {
                Console.WriteLine("You has to add more words!");
            }
            else if (learningRate < 200)
            {
                Console.WriteLine("It's time to add new words!");
            }
            else if (learningRate < 300)
            {
                Console.WriteLine("Zen!");
            }
            else if (learningRate < 400)
            {
                Console.WriteLine("Let's do some exams");
            }
            else
            {
                Console.WriteLine("Exams exams exams!");
                Console.WriteLine($"You have to make at least {(learningRate-300)/10} more exams");
            }
        }