User:Grapesurgeon/AWB explanation

Source: Wikipedia, the free encyclopedia.

This page explains my Wikipedia:AutoWikiBrowser scripts. Note that I manually review every individual change, and often manually adjust each edit. I will sometimes make mistakes. If you have concerns please post on my talk page.

The script has several thousand lines of code, some of which are only rarely active, so I won't be able to explain everything it does. I also add code basically every time I use the program.

If you're interested in getting code snippets from it, let me know. I write all these commands in text files, then use Python to format the commands and add them to the AWB .xml profile file directly.

Reference formatting

  • Wikilink publications in references (limited to North Korean, South Korean, and Japanese sources for now)
    • Note that repeat links are permitted for these (
      MOS:REPEATLINK
      )
    • Note: My script previously inserted {{Interlanguage link}}s within citation parameters, but I learned recently that this is bad practice. My script can now remove interlanguage links and replace with regular red links. I submitted a bot request to do this but nobody ever followed through on implementing it ¯\(ツ)/¯
  • Tags Korea-related unreliable sources with {{
    WP:KO/RS
    )
  • If a |title= is in Korean, I change the parameter to |script-title=ko: (
    MOS:KO-REF
    )
    • Note that this affects how Korean text is rendered (Template:Citation Style documentation/title), so it's permissible to make as the only change on the page with AWB. However, if there's only one or two of this type of change on a page I often just skip to avoid history bloat.
  • If an entire Hangul name is squeezed into the |last= parameter, it splits it into |last=... |first=...
  • Changes |language=kr (Kanuri language) to |language=ko
  • Deletes non-essential elements of titles and publication names, e.g. everything after "Article title" here: |title=Article title {{!}} 38 North: Informed Analysis of North Korea
  • Fixes if |last= and |first= parameters are flipped
  • Deletes non-people names in |last= and |first= parameters
    • E.g. |last=JoongAng |first=Ilbo; this is the name of a newspaper (JoongAng Ilbo)
    • E.g. |last=기자 |first=박정현|last=박 |first=정현 "기자" means "reporter"
  • If page range is placed incorrectly in |p=, replaces parameter with |pp=. Vice versa for single pages.

Article body adjustments

  • For bios, if Hangul name is missing from the first parentheses, inserts it (
    MOS:KO-LEAD
    )
  • For bios, if birth year or year range is missing from {{
    WP:SDDATES
    )
  • Discourages Hanja in lead for modern North and South Korean topics if Hanja is already in infobox (
    MOS:HANJALEAD
    )
  • Discourages the use of "Korean-American" in the lead of articles (
    MOS:KO-ETHNICITY
    )
  • Standardizes spelling of terminology to match guidelines in
    WP:KO-CONSISTENT
    )
    • Have coded in around a thousand of these kinds of adjustments. E.g. "Rhee Syngman" → "Syngman Rhee"
  • Converts hyphens (-) and tildes (~) for number/date ranges to the endash (–) (
    MOS:KO-TILDE
    )
  • Converts curly quotes and apostrophes to straight variants (
    MOS:'
    )
  • Changes many unnecessary redirects to direct links (
    MOS:NOPIPE
    )
    • As this is a non-visible change, I skip pages where this is the only change
  • Merges some place links when possible, discourages linking of "North Korea" and "South Korea" (
    MOS:GEOLINK
    )
  • Adjusts some frequent incorrect or poor prose
    • E.g. verbose phrases like "Seoul City" instead of just "Seoul"
  • Some invisible template formatting (avoiding the use of template redirects, deleting several common empty params, using named parameters instead of skipping positional ones, moving parameters around to more common ordering); skip if only change

Korean text formatting

  • Wraps bare Korean text using {{
    MOS:HANGULFORMAT
    )
    • E.g. [[Korean language|Korean]]: 식당{{Korean|hangul=식당}}
    • E.g. {{Korean|hangul=식당}} [[Hanja]]: 食堂{{Korean|hangul=식당|hanja=食堂}}
    • E.g. {{Korean|hangul=식당}}; {{literally|restaurant}}{{Korean|hangul=식당|lit=restaurant}}
  • Discourages the use of links to
    MOS:KO-WIKT
    )
  • Converts direct links to the Korean Wikipedia to {{
    MOS:KO-WIKILINK
    )
  • Discourages bolding or italicization of Korean characters (
    MOS:HANGULBOLD
    )

Infobox adjustments

Talk banner page

  • I have a simple script that adds {{WikiProject Korea}} to the talk page of articles if not already present.
  • I have another script that detects if the name order in |listas= for biographies is flipped.