Beispiel #1
0
            private static void writeCorrections(string response, LanguageLearningChatBotCore.ResponseAnalysis analysis)
            {
                int resIndex = 0;

                foreach (LanguageLearningChatBotCore.Correction correction in analysis.Corrections)
                {
                    if (correction.Offset > 0)
                    {
                        Console.Write(response.Substring(resIndex, correction.Offset - resIndex));
                    }
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.Write(correction.Corrected);
                    Console.ResetColor();

                    resIndex = correction.Offset + correction.Original.Length;
                }
                if (resIndex < response.Length - 1)
                {
                    Console.Write(response.Substring(resIndex));
                }
                Console.WriteLine();
            }
Beispiel #2
0
 private static void showTranslations(LanguageLearningChatBotCore.ResponseAnalysis analysis)
 {
     Console.ForegroundColor = ConsoleColor.Cyan;
     Console.WriteLine(analysis.Prompt.PrimaryText);
     Console.ResetColor();
 }