Пример #1
0
        /// <summary>
        ///     Check to see if the word is already in the list box.
        /// </summary>
        /// <param name="duplicate">The items from the list box.</param>
        /// ///
        /// <param name="addWord">The word to check for.</param>
        /// <returns>True if word is all ready in the list else false.</returns>
        /// <created>,5/10/2019</created>
        /// <changed>,5/10/2019</changed>
        public static bool CheckDuplicateWord(List <string> duplicate, string addWord)
        {
            MyMessagesClass.NameOfMethod = MethodBase.GetCurrentMethod().Name;

            if (!LoopThrewWordsList(duplicate, addWord))
            {
                return(false);
            }

            MyMessagesClass.InformationMessage = "The word entered is all ready in the list of spelling words. ";
            MyMessagesClass.ShowInformationMessageBox();

            return(true);
        }
Пример #2
0
        /// <summary>
        ///     Check spelling word for the correct spelling.
        ///     If incorrect spelling the get a list of possible correct spelling.
        /// </summary>
        /// <param name="word">The word to check spelling on.</param>
        /// <returns>True if word is spelled correctly else false.</returns>
        /// <created>art2m,5/10/2019</created>
        /// <changed>art2m,5/10/2019</changed>
        public static bool CheckWordSpelling(string word)
        {
            using (var hunspell = new Hunspell("en_us.aff", "en_us.dic"))
            {
                if (hunspell.Spell(word))
                {
                    return(true);
                }

                msw.AddItem(word);

                MyMessagesClass.InformationMessage = string.Concat("This word is not spelled correctly:  ", word);
                MyMessagesClass.ShowInformationMessageBox();

                CheckDictionary(word);

                return(false);
            }
        }