Esempio n. 1
0
        /// <summary>
        /// Fix spelling mistakes
        /// </summary>
        /// <param name="RegexTypos">A RegExTypoFix object</param>
        /// <param name="SkipIfNoChange">True if the article should be skipped if no changes are made</param>
        public void PerformTypoFixes(RegExTypoFix RegexTypos, bool SkipIfNoChange)
        {
            string strTemp = RegexTypos.PerformTypoFixes(mArticleText, out noChange, out mPluginEditSummary, mName);

            if (noChange && SkipIfNoChange)
            {
                Trace.AWBSkipped("No typo fixes");
            }
            else if (!noChange)
            {
                AWBChangeArticleText(mPluginEditSummary, strTemp, false);
                AppendPluginEditSummary();
            }
        }
Esempio n. 2
0
        private string FixTypos(string articleText, string articleTitle)
        {
            if (Retf == null)
            {
                if (Typos.Count == 0)
                {
                    throw new Exception("You forgot to provide a list of typos!");
                }
                Retf = new RegExTypoFix(false, new TypoList(Typos));
            }

            bool noChange;

            return(Retf.PerformTypoFixes(articleText, out noChange, out Summary, articleTitle));
        }