Wikipedia:Bots/Requests for approval/Luasóg bot 2


 * 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 Symbol keep vote.svg Approved.

Luasóg bot 2
Operator:

Automatic or Manually assisted: Automatic, unsupervised.

Programming language(s): JavaScript

Source code available: This is the script. Framework is available here.

Function overview: Change " " to " " on all main-space backlinks to Main-belt Asteroid (which now redirects to Asteroid belt).

Links to relevant discussions (where appropriate): Posted to Bot requests.

Edit period(s): One time run.

Estimated number of pages affected: 9483

Exclusion compliant (Y/N): No Yes.

Already has a bot flag (Y/N): No.

Function details: As above. Performed a sand-boxed test on the first 10 back links. No errors found.

Discussion
I'm unsure about this because it could be seen as a spell-checker process. I could add a human supervision element to the script but since this typo affects almost 10,000 articles I can't see anyone volunteering to supervise all of them. In practice, from my own inspection and the IP poster's description, who says he/she has fixed several hundred by hand, this looks like a consistent typo that is suitable for an automated process IMHO. It appears that all of these articles were created through an automated process by User:ClueBot II and the typo replicated across all of the affected articles by that original process. --RA (talk) 18:26, 30 May 2010 (UTC)
 * It appears that your code will result in the M not being capitalized when the problematic string appears at the beginning of a sentence. It may also convert a paragraph break into a preformatted line if the problematic string appears at the beginning of a paragraph. Note that end-of-sentence detection may be tricky, as you have to take into account constructs like "" and "". OTOH, it may be that the problematic string never occurs at the beginning of a sentence or paragraph so this worry is moot.
 * If the vast majority are due to a bot stub-creation as you said, one possibility is to detect and replace the error in the bot's templated output only, leaving the few instances that have since been changed by a human editor for human or script-assisted review. Anomie⚔ 16:21, 31 May 2010 (UTC)


 * I've updated the regex to do look behind for a word character thus ensuring the link doesn't occur at the start of a sentence (in look behinds don't exist in JS reg ex so I've had to do a roll-your-own equivalent). Anything that slips by I'll check by hand.
 * I've also added a test for the bot exclusion tag, per the comments by Josh below. --RA (talk) 20:06, 31 May 2010 (UTC)
 * That should work for handling sentence detection; it looks like the bot's template was along the lines of " ", so it should easily catch the majority of problem strings.
 * It looks like you copied the bot exclusion code from Template:nobots? Note that only the Perl example there actually matches the full template syntax. OTOH, I don't know whether any bot besides AnomieBOT (from whence comes the Perl example) matches the full syntax ;) Anomie⚔ 01:41, 1 June 2010 (UTC)
 * Ah ... I added the JS version to that page based on the C# version. I'll go back over it again based on your code. Thanks!--RA (talk) 08:56, 1 June 2010 (UTC)
 * Possibly " " might be a better replacement, two wikilinks can look like one, leading to surprise, and the more specific link is preferred over the general. Rich Farmbrough, 21:47, 1 June 2010 (UTC).
 * Are you sure? Most of these articles are stubs about asteroids or brief mention about an asteroid in a dab page or an article unrelated to asteroids. If I had written it up by hand I would have linked asteroid also. (This was the suggested linking by the original requester also.) --RA (talk) 22:35, 1 June 2010 (UTC)


 * At the same time:
 * MinorPlanets Navigator => Minor planets navigator
 * MinorPlanets Footer => Small Solar System bodies
 * if you could. Rich Farmbrough, 21:52, 1 June 2010 (UTC).
 * Are they typos in the same set of articles? Can do. --RA (talk) 22:35, 1 June 2010 (UTC)
 * Looks that that's bypassing redirects for MinorPlanets Navigator → Minor planets navigator and MinorPlanets Footer → Small Solar System bodies. May as well fix it when you're doing the asteroid typo fix anyway, but it's probably not worth doing otherwise. Anomie⚔ 23:18, 1 June 2010 (UTC)
 * Oh, I see them now. Sure, might as well do them too if we are passing. I'll add them to the script tonight (UCT). --RA (talk) 08:05, 2 June 2010 (UTC)
 * I updated the script to "fix" those redirects also. I've also updated the bot exclusion code to be fully compliant (practically at least). --RA (talk) 17:13, 6 June 2010 (UTC)
 * I note that you are intending to fix the redirects even if there is no other reason to edit the page, which seems to go against WP:R2D.
 * As for the bot exclusion, it seems that it will exclude any page that does not have any bot control template, which means it will edit almost no pages. It would also screw up if someone tried to allow or deny "Luasóg bot II", or a few other very obscure cases. I just cleaned up and expanded my bot exclusion test cases, you can use those pages for testing your function if you want. Anomie⚔ 02:49, 7 June 2010 (UTC)
 * RE: WP:R2D, it was your suggestion to fix them (see 23:18, 1 June 2010) :-)
 * RE: "it seems that it will exclude any page that does not have any bot control template" - LOL! ... doh!
 * RE: the "obscure" cases - you are a cruel and evil master ... but thank you for the test cases. Now 100% compliant. --RA (talk) 11:14, 7 June 2010 (UTC)
 * Actually, it was Rich Farmborough who suggested bypassing the template redirects; I just pointed out that the string replacements he suggested were in fact replacing redirected templates. As for the compliance, I left a note at User talk:Luasóg bot/Exclusion compliant. Anomie⚔ 15:50, 7 June 2010 (UTC)
 * So, will I do the templates too while I'm at it? Or leave them as they are?
 * Back to 100% on your test cases. --RA (talk) 18:40, 7 June 2010 (UTC)
 * I would do it like this: apply the real change, test if an edit needs to be made, and then if so apply the incidental changes too before submitting the edit. Anomie⚔ 19:27, 7 June 2010 (UTC)
 * Nice one. Done. --RA (talk) 19:48, 7 June 2010 (UTC)

Ok, let's give this a trial. Anomie⚔ 01:32, 8 June 2010 (UTC)
 * I'll give it a run tomorrow night. --RA (talk) 20:48, 9 June 2010 (UTC)
 * Done: Special:Contributions/Luasóg_bot. I noticed before I ran that the parts to do with MinorPlanets Navigator → Minor planets navigator and MinorPlanets Footer → Small Solar System bodies would fail (the template are more complex than that). So I left that part of the code out and just did the core task. --RA (talk) 21:56, 11 June 2010 (UTC)
 * The edits look good. Are you wanting to try for the template replacement, or just go ahead without it? Anomie⚔ 23:55, 11 June 2010 (UTC)
 * I was going to go ahead without it. It's not "broken" after all. The core task was the typo. --RA (talk) 12:00, 12 June 2010 (UTC)
 * In that case, for the core task only. Anomie⚔ 14:01, 12 June 2010 (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.