Wikipedia:Bots/Requests for approval/WikiCleanerBot 3


 * The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was

WikiCleanerBot 3
Operator:

Time filed: 09:40, Tuesday, April 2, 2019 (UTC)

Function overview: To fix some simple cases of square brackets without correct beginning.

Automatic, Supervised, or Manual: Automatic

Programming language(s): Java (WPCleaner)

Source code available: On Github (and especially algorithm 46)

Links to relevant discussions (where appropriate): Maintenance task for

Edit period(s): Twice a month, preceding the dump analysis that I already perform, see Bots/Requests for approval/WikiCleanerBot.

Estimated number of pages affected: Probably a few hundreds (estimation, as only simple cases will be fixed in the list) for the first complete run (pages with such problems are listed in Check Wiki #46, which currently contains a list of 2420 pages), and probably no more than a few dozen after that on each run given the evolution of the number of pages in the list.

Namespace(s): Main namespace

Exclusion compliant (Yes/No): No, cases that will be fixed are simple enough to fix them in each article.

Function details: The function will fix simple cases of problems detected by Check Wiki #46 (Square brackets without correct beginning). The cases identified so far are the following situations: You can tell me if it would be ok to add other fixes for #46 later if I find other cases where I'm sure of the fix.
 * an external link ending with 2 square brackets, provided that it doesn't fall in the one of the following situations: remove the extra square bracket
 * it starts by 2 square brackets
 * it contains another square bracket
 * there's a stray opening square bracket before in the line
 * an internal link or a category ending with 4 square brackets : remove the extra 2 square brackets

I already ran this fix on frwiki (with eventually additional modifications), results can be seen in WikiCleanerBot's contributions ("Lien interne mal ouvert" is the French translation for this problem). For enwiki, I don't plan to have additional modifications (unless you think it's better to also fix some additional CW errors in the process).

For the test run, I can stop WPCleaner after a few modifications to let you check what the results are.

For the first articles in the list provided by Check Wiki #46, WPCleaner should do the following:
 * 1 John 5: nothing, not a simple case
 * 10 nanometer: removing the extra square bracket by replacing  by
 * 11AM (TV program): nothing, not a simple case, but it may be a candidate for more ways of fixing ( replaced by  ) in a later version
 * 12 Scorpii: nothing, not a simple case
 * 16-cell: nothing, not a simple case, and it would be a cosmetic fix only to remove a false positive
 * 1746 English cricket season: nothing, not a simple case
 * 185th Air Refueling Wing: nothing, not a simple case
 * 1970 Law on dangerousness and social rehabilitation: removing the extra square bracket by replacing twice  by
 * 1970–71 Iraqi Central Premier League: removing the extra square bracket by replacing twice  by
 * 1970–71 Iraqi Central Premier League: removing the extra square bracket by replacing twice  by

Discussion
What happens in a case like ? Could it handle conversions to &amp;#91; / &amp;#93; Headbomb {t · c · p · b} 12:44, 3 April 2019 (UTC)
 * J. Smith (2010) "Comment on "Do Shitzus have feelings", [J. Poodles, v. 4, iss. 4, pp. 4-8]" J. Poodles v. 19, iss. 3, pp. 134-134.
 * Hi Headbomb. With the current code, nothing happens as it doesn't respect the check that it doesn't contain another square bracket. So for a first run, it would simply be ignored. It may fall in the other fixes I could add for #46, but I would first have to try it to see if there are no situations where this replacement shouldn't be used. --NicoV (Talk on frwiki) 16:21, 3 April 2019 (UTC)
 * Alright, then that case can always be handled separately. . Headbomb {t · c · p · b} 16:25, 3 April 2019 (UTC)
 * I run WPCleaner on a few pages, one at a time, and everything was good. I let it run on an extra dozen, and I found several articles with  which was replaced by   as specified, where the correct human fix would be  . I wonder if I should make this an exception also (a stray [ before the external link, in the same line). What do you think? --NicoV (Talk on frwiki) 07:36, 4 April 2019 (UTC)
 * I think those would be malfunctions, and that they need to be addressed, either by skipping those cases, or handling them correctly. But it is not at all clear to me that [Source: link] is something that needs to be 'fixed' in the first place, so unless a clear and compelling argument can be made, I say skip it. Headbomb {t · c · p · b} 14:02, 4 April 2019 (UTC)
 * Ok. I will modify WPCleaner to skip such cases, and I will run it on a few pages. I'll keep you posted. --NicoV (Talk on frwiki) 14:17, 4 April 2019 (UTC)

remember that you need to post the trial results here once they are completed. Headbomb {t · c · p · b} 14:49, 4 April 2019 (UTC)
 * , I ran WPCleaner for 49 edits (miscounted, stopped 1 too early), here are the results (comment of the edits is "v2.01b - Task 3 - WP:WCW project (Square brackets without correct beginning)"):
 * First part mentioned above with 17 edits, where I detected the case with stray opening square bracket before the external link: I modified WPCleaner to apply no automatic fixing in such case, and updated the description above accordingly. I also fixed manually the few pages where the automatic fix wasn't the best one to do by removing the extra "Source: [".
 * Second part with the extra 32 edits, which seems ok to me.
 * The trial edits seem to confirm the estimated number of pages that will be modified if run on the entire list, a few hundreds. --NicoV (Talk on frwiki) 10:53, 6 April 2019 (UTC)
 * if the trial is complete you need to add BotTrialComplete so that AnomieBOT moves this from "in trial" to "trial complete" at WP:BRFA. Based on what you wrote, it seems like the trial is done; is it? --DannyS712 (talk) 01:01, 10 April 2019 (UTC)
 * Thanks DannyS712. --NicoV (Talk on frwiki) 11:35, 10 April 2019 (UTC)


 * ,, , are tricky. I'll need to think a bit, but you're welcome to brainstorm about them in the meantime, or come up with improved logic for those cases. &#32; Headbomb {t · c · p · b} 16:46, 10 April 2019 (UTC)
 * Ok Headbomb. Here's my thoughts about them:
 * Adam Davies (footballer, born 1992):
 * Before the edit the reference was really malformed,, which gives
 * The fix doesn't make it worse, by only balancing the square brackets, but leaving out the real problem. Right now, I don't see any improvement to the logic or to avoid modifying it, but the current fix is still slightly better than the original. So, I think we could let it be that way...
 * Obviously, the correct fix would be something like the following, but I can't see any way to make that fix by bot...
 * Air America (airline):
 * Before the edit it was malformed,  which gives
 * The fix removes the extra square bracket, which gives.
 * This fixes one of the problem, the other one being the incorrect target of the external link. It's still an improvement.
 * April 1913 and April 1915 are very similar to the previous one : the link has 2 problems (incorrect target, extra square bracket), the bot fixes one of them.
 * --NicoV (Talk on frwiki) 20:06, 10 April 2019 (UTC)
 * I agree they're both improvements. Just wondering if those other errors are tracked somewhere. It's not really a strike against this bot, just wondering out loud if this is something this bot should also tackle, or if it's best left to another bot/tool. &#32; Headbomb {t · c · p · b} 20:09, 10 April 2019 (UTC)
 * Hi Headbomb.
 * For the first one, I don't see any way to fix it automatically, or even detect it properly (for example some templates can be used inside external links texts, some can't...)
 * For the other ones, I can easily add code to track them with WPCleaner (pipe inside an external link target). For automatic fixing, it's probably possible for some of them: when the pipe is at the end seems a good first candidate for automatic fixing, maybe the repetition of the first word is another good candidate. I can try to add that also, but it will require testing and I suggest to make it a separate request for approval: in the end, if they are all accepted, I will combine them with the dump analysis task (automatic fixing of some errors based on CW lists, dump analysis to create WPC lists, automatic fixing of some errors based on WPC lists). --NicoV (Talk on frwiki) 07:56, 11 April 2019 (UTC)


 * I haven't had an opportunity to look through all of the trials, but I've looked into the ones mentioned here. I'm not overly thrilled with the idea of automatically removing a known error (particularly something like the Air America page) with an error that might not be as obvious or track-able. Also not thrilled about what appears to be about a 10% failure rate. Not sure if this means the task should be declined, modified, or just closely watched; will have to think on that. Primefac (talk) 21:02, 27 April 2019 (UTC)
 * Primefac. The link has 2 completely unrelated problem: an incorrect target for the link (the pipe and the characters just after) and an extra closing square bracket at the end. They are really completely unrelated: a good example is espacially Air America (airline) where there was an extra square bracket on 1 link (which was fixed by my bot) and an incorrect target on for 4 links (, ,  , and  ). So I kind of disagree with the statement that my bot is removing a known error with an error less obvious: it's just fixing one error, the other one being totally unrelated and it's not a failure. But I agree that the other kind of error should be tracked: I'm currently adding a check for that in WPCleaner and will track such problems CHECKWIKI/WPC 543 dump, which will be filled in my next dump analysis. --NicoV (Talk on frwiki) 17:04, 1 May 2019 (UTC)
 * Primefac. I did a dump analysis on frwiki last night to try reporting the problem with pipe inside external links, result is available at fr:Projet:Correction syntaxique/Analyse 543‎. It's not as obvious as I hoped, as there are many links that are correct even with a pipe inside. I see several cases where I probably could report them without false positives (but I will miss some true errors):
 * Pipe at the end of the external link (followed by a whitespace), like  in fr:.300 Winchester Magnum
 * Pipe followed by a template, like  in fr:1650 en France
 * Pipe followed by an opening square bracket, like  in fr:Akiho Yoshizawa
 * Pipe followed by a word that is repeated just after the whitespace, like Air America (airline)
 * What do you think? --NicoV (Talk on frwiki) 07:24, 2 May 2019 (UTC)
 * Primefac. I ran the dump analysis on enwiki last night, results for the pipe inside external links are available at CHECKWIKI/WPC 543 dump (around 1000 articles with this problem), and they contain the articles mentioned above, so this problem will be tracked independently. If need be, I can also run a bot on this list to fix the most obvious ones (pipe at the end of the external link target): I already ran it on frwiki, and it fixed a vast majority of the reported problems (will be visible in the next version of fr:Projet:Correction syntaxique/Analyse 543‎ when I rerun the dump analysis). --NicoV (Talk on frwiki) 07:39, 6 May 2019 (UTC)
 * Primefac, This diff gives a good idea of what could be fixed for obvious errors (on frwiki, it went down from 1302 pages to 56) for this pipe inside an external link. --NicoV (Talk on frwiki) 09:33, 7 May 2019 (UTC)

Headbomb, Primefac. If need be, when an extra closing square bracket is fixed from a page, I can also do the automatic fixing for the pipe in the external link. Currently, it would only fix a pipe at the end of the target (if the link is properly formatted), but I can also try to add the automatic fixing when the word after the pipe is a copy of the first word of the text. --NicoV (Talk on frwiki) 13:21, 8 May 2019 (UTC)
 * The more I think of it, the more I think this is best left as a separate task/trial. You could run both tasks together, but it's easier to keep trials separate, I feel. So this task is, and you can make a separate BRFA for the pipe issues. &#32; Headbomb {t · c · p · b} 14:16, 8 May 2019 (UTC)
 * The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.