예제 #1
0
 //=========================================================================================
 /// <summary>Разобрать текст "keywords" на слова и указать, что эти ключевые слова должны отображаться в указанном стиле.</summary>
 protected void LoadKeywordsToGroup(Dictionary <string, TextStyle> dictionary, TextStyle style, string keywords)
 {
     foreach (string sWord in TextSplitter.GetWordsFromText(keywords))
     {
         //if (dictionary.ContainsKey(sWord))
         //    Console.WriteLine(sWord);
         //else
         dictionary.Add(sWord, style);
     }
 }
        public void GetKeywordsFromText()
        {
            string        sText = " GO\tя12\r\n\tANY ";
            List <string> words = new List <string>();

            foreach (string sWord in TextSplitter.GetWordsFromText(sText))
            {
                words.Add(sWord);
            }
            Assert.That(words, Is.EquivalentTo(new string[] { "GO", "я12", "ANY" }));
        }