Example #1
0
        /** Searches through the document for words it thinks might be an acronym. **/
        private void GetAllAcronymsInDocument()
        {
            //Stopwatch stopWatch = new Stopwatch();
            //stopWatch.Start();

            frm.SetMainText("Checking all words in document.");


            int allWords    = doc.Words.Count;
            int currentItem = 0;

            foreach (Word.Range word in doc.Words)
            {
                SetNumber(currentItem++, allWords);

                if (IsValidWordFirstCheck(word.Text))
                {
                    if (!app.CheckSpelling(word.Text.ToLower()))
                    {
                        found.Add(word.Text.Trim());
                        if (!notAcronyms.Contains(word.Text))
                        {
                            if (IsValidWordFirstCheck(word.Text))
                            {
                                if (!app.CheckSpelling(word.Text.ToLower()))
                                {
                                    found.Add(word.Text.Trim());
                                }
                                else
                                {
                                    notAcronyms.Add(word.Text);
                                }
                            }
                            else
                            {
                                notAcronyms.Add(word.Text);
                            }
                        }
                    }

                    //stopWatch.Stop();
                    //Debug.Print(stopWatch.ElapsedMilliseconds.ToString());
                }
            }
        }