Esempio n. 1
0
        private static string[] AdjustAndFilterWords(string[] Words)
        {
            List <string> FilterdWords = new List <string>();


            foreach (var word in Words)
            {
                //in case choice is space or null or , or "and"
                // word then we continue without doing any thing.
                if (string.IsNullOrEmpty(word) ||
                    string.IsNullOrWhiteSpace(word) ||
                    word == "and" ||
                    word.IndexOf(" ") != -1 ||
                    word.IndexOf(",") != -1 ||
                    word.Length < 3)
                {
                    continue;
                }
                else
                {
                    string ReturnWord = spellChecker.Correct(word);
                    if (!string.IsNullOrEmpty(ReturnWord))
                    {
                        FilterdWords.Add(ReturnWord);
                    }
                }
            }



            return(FilterdWords.ToArray());
        }
Esempio n. 2
0
        public void Dictionary_IsInitialized()
        {
            var word         = "теменужка";
            var correctWords = spellChecker.Correct(word, "bg");

            Assert.AreEqual(1, correctWords.Count);
        }