publicstringProcessArticle(stringArticleText,stringArticleTitle,intwikiNamespace,outstringSummary,outboolSkip){Skip=false;Summary="";stringmyRedirectTarget="";// Skip if title doesn't contain the whole word "Organi[sz]ation(s)"MatchtitleCheck=Regex.Match(ArticleTitle,@"^(.*?\b[oO]rgani)([sz])(ations?\b.*)$");if(!titleCheck.Success){Skip=true;returnArticleText;}// First see if this page is OrganiSations (i.e. spelt with a "S")titleCheck=Regex.Match(ArticleTitle,@"^(.*?\b[oO]rgani)s(ations?\b.*)$");if(titleCheck.Success){// create the new title by relacing S with ZmyRedirectTarget=Regex.Replace(ArticleTitle,@"^(.*?\b[oO]rgani)s(ations?\b.*)$","$1z$2");if(myRedirectTarget==ArticleTitle){// Something went wrong. The redirect target is the same as the page title.// We don't want a self-redirect, so skip this pageSkip=true;returnArticleText;}Summary=makeEditSummary(myRedirectTarget);returnmakeRedirectMarkup(myRedirectTarget);}// Now see if this page is OrganiZations (i.e. spelt with an "Z")titleCheck=Regex.Match(ArticleTitle,@"^(.*?\b[oO]rgani)z(ations?\b.*)$");if(titleCheck.Success){// create the new title by relacing Z with SmyRedirectTarget=Regex.Replace(ArticleTitle,@"^(.*?\b[oO]rgani)z(ations?\b.*)$","$1s$2");if(myRedirectTarget==ArticleTitle){// Something went wrong. The redirect target is the same as the page title.// We don't want a self-redirect, so skip this pageSkip=true;returnArticleText;}Summary=makeEditSummary(myRedirectTarget);returnmakeRedirectMarkup(myRedirectTarget);}// If we get here, something weird has happened, so skip this pageSkip=true;returnArticleText;}publicstringmakeRedirectMarkup(strings){return"{{Category redirect|"+s+"|bot=BHGbot}}";}publicstringmakeEditSummary(strings){return"[[WP:BHGbot 7]]: create soft category redirect to [[:"+s+"]] ... to resolve the s/z [[WP:ENGVAR]] variation in the spelling of "organisation"/"organization"";}