Hello all. I am asking this for my wikipedia editing. I am not from the background of computer science but I edit wikipedia a lot.
I am using a software called as auto wiki browser to edit:
brief intro to AWB - Wikipedia[
^] AWB is a very powerful tool. It also supports modules.
Wikipedia:AutoWikiBrowser/Custom Modules - Wikipedia[
^] also regex.
I am running a find and replace task using awb. I wants to add some rules for skipping.
My exact problem in short: on wikipedia there are many pages called as disambiguation page for example:
Robert Abel - Wikipedia[
^]
This Robert Abel page lists all the persons named Robert Abel and nothing else. Ideally no wiki page should link to Robert Abel. The pages should link to particular Roberts. For example
Robert Abel (animator)[
^] or Robert Abel (footballer).
What I wants to do is: AWB makes a list of all the pages linking to Robert Abel (base page). I wants to search for Robert Abel and replace it with Robert Abel (animator). But if the text is "Robert Abel (footballer)" or "Robert Abel (racing driver)" then I wants to skip it.
What I have tried:
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
Skip = false;
Summary = "test";
ArticleText = ArticleText.Replace("Robert Abel", "Robert Abel (animator)");
return ArticleText;
}
I tried the above code in AWB module. But it addings "Robert Abel (animator) (animator)" if there is already "Robert Abel (animator)" in the article. I tried to add else parameter but it giving compilation error. This is faulty code:
public string ProcessArticle(string ArticleText, string ArticleTitle, int wikiNamespace, out string Summary, out bool Skip)
{
Skip = false;
Summary = "test";
ArticleText = ArticleText.Replace("Robert Abel", "Robert Abel (animator)");
if ArticleText = "Robert Abel (animator)" {
Skip = true;
} else {
ArticleText.Replace("Robert Abel", "Robert Abel (animator)");
}
return ArticleText;
}
I wants to add few different rules. example: skip if "A", "B" or "C" is present. If D is present then change it to E. If "F" is present then change it to "G".
Please help me.