Wikipedia:Bots/Requests for approval/Detroiterbot IV
- 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 Approved.
Operator: MJCdetroit (talk · contribs)
Time filed: 03:50, Saturday February 19, 2011 (UTC)
Automatic or Manually assisted: Automatic, unsupervised.
Programming language(s): AutoWikiBrowser (AWB)
Source code available: See below.
Function overview: For most articles on U.S. settlements, there is a line in the Demographics section that states "housing units at an average density of [number]/sq mi ([number]/km²)...". The main goal of this function is a clean up task to change "/sq mi" to " per square mile". There will also be some other minor non-controversial clean up tasks.
Links to relevant discussions (where appropriate):
Edit period(s): Daily (actually nightly)
Estimated number of pages affected: All articles on U.S. settlements (cities, towns, villages), therefore less than 20,000. I'll do one state or territory per night until finished.
Exclusion compliant (Y/N): Y
Already has a bot flag (Y/N): Y
Function details: --Regex--
- Find 1: (average)(\s)(density)(\s)(of)(\s)(\d\.\d|\d\d.\d|\d\d\d\.\d)(/)(sq)(\s| )(mi) Replace: $1$2$3$4$5$6$7 per square mile
- Find 2: (was|of)(\s)(\d\.\d|\d\d\.\d|\d\d\d\.\d|\d\,\d\d\d\.\d)(/)(mi²)(\s)(\() Replace:$1$2$3 per square mile (
- Find 3: (average)(\s)(density)(\s)(of)(\s)(\d\.\d|\d\d.\d|\d\d\d\.\d)(/)(mi²) Replace: $1$2$3$4$5$6$7 per square mile
- Find 4: ([[)(population)(\s)(density)(]])(\s)(was)(\s)(\d\.\d|\d\d.\d|\d\d\d\.\d|\d\,\d\d\d\.\d)(/)(sq)(\s| )(mi) Replace: $1$2$3$4$5$6$7$8$9 people per square mile
--non Regex--
- Find 5: US Replace: U.S.
- Find 6: mi² Replace: sq mi
- Find 7: km²Replace: km<sup>2</sup>
Discussion
[edit]I already performed 50 edits of settlements in Alabama using this exact code and everything looked good. Not exclusion complaint to my knowledge, I've never used it with this bot before. —MJCdetroit (yak) 03:50, 19 February 2011 (UTC)[reply]
- AutoWikiBrowser is exclusion compliant by default, unless you've changed that, you shouldn't need to worry. Could you link to those 50 edits for us please? Also, your regex patterns look waay more complicated than they need to be, to save me the time of reading through them, could you explain what each is meant to do and we'll see if we can't find work out something more straightforward? As to the non-regex replaces, I think it would be best to forget the US -> U.S. in this case, as that sort of comes under spelling fixes, which bots aren't typically good at (just off the top of my head it may run into problems with "USA"). The other two you will need to explain the benefits of? Cheers, - Kingpin13 (talk) 12:08, 22 February 2011 (UTC)[reply]
- I've changed nothing as to the exclusion complaint, I honestly just don't know enough about it to know whether this was used by the bot before. I'll change that to "Y".
- Review the edits on my MJCdetroit account on February 18th. You can see the Alabama edits: [1]
- There is a space before and after US so that switch was not a problem with USA because of the "A" is not a space. see the diff: [2]
- This is a partial response (family needs pull me away until later sorry). I'll explain the rest later in the day. —MJCdetroit (yak) 15:39, 23 February 2011 (UTC)[reply]
- For Find 1, the intend is to seek out one particular sentence that appears in almost every article on a U.S. settlement under the Demographics section and replace the part "/sq mi" with "per square mile" to improve the appearance (and grammar too). Here is a diff:[3] "replaced: average density of 59.7/sq mi → average density of 59.7 per square mile"
- For "Find 2": Here is a diff: [4] "was 1,841.8/mi² ( → was 1,841.8 per square mile ("
- For "Find 3": No diffs exist, but the purpose is to catch when the particular "average density..." sentence has "mi²" installed instead of sq mi and spells it out in full.
- For "Find 4": this is designed to catch any instance where the sentence in the Demographics sections of the articles that starts with "The population density was..." does not have square mile spelled out in full; most articles should already have this done for that particular sentence.
- For "Find 5" and "Find 6" above: This is a MOSNUM clean up for other parts of the article; sq mi is the more common/preferred abbreviation and the MOSNUM says to "Avoid using Unicode superscripts and subscripts (such as ² and ₃)" ... but to use "
<sup></sup>
and<sub></sub>
tags". - Hope that makes more sense for y'all. Regards, —MJCdetroit (yak) 01:03, 24 February 2011 (UTC)[reply]
Find 5 is context-sensitive and may be prone to false positives, i.e. related to spelling, as Kingpin13 points out. This should not be applied automatically. Find 6 and Find 7 are cosmetic and should not be done on their own. — HELLKNOWZ ▎TALK 11:54, 11 March 2011 (UTC)[reply]
- Find 5, 6, and 7 have been disabled. Also I just did 60 more trail edits and everything worked well; no problems. See my contributions from today. —MJCdetroit (yak) 04:00, 12 March 2011 (UTC)[reply]
- Trial complete.
- Trial completed. You can see any of the edits by going to my contributes (http://en.wikipedia.org/wiki/Special:Contributions/MJCdetroit). Anything with the "clean up, replaced:..." edit summary in the last month is the trial code for this bot. There were not any errors detected during the trial edits. Could I please get this approved soon? —MJCdetroit (yak) 13:12, 17 March 2011 (UTC)[reply]
{{BAG assistance needed}}
12:54, 24 March 2011 (UTC)
Approved. MBisanz talk 02:35, 5 April 2011 (UTC)[reply]
- 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.