solve_disambiguation.py is a python bot script to help a human solve links to disambiguation pages by presenting a set of options.
Type in the disambiguation page on the command line. The program will pick up the page, and create a menu of all outbound links found on the page, with a unique number adjacent to each link. It will then automatically loop over all pages which refer to the disambiguation page, and show 30 characters of context on each side of the reference to help you make the decision between the alternatives. It will ask you to type the number of the appropriate replacement, and perform the change.
It is possible to choose to replace only the link (just type the number) or replace both link and link-text (type '
r' followed by the number).
Multiple references in one page will be scanned in order, but typing '
n' (next) on any one of them will leave the complete page unchanged. To leave only some reference unchanged, use the '
s' (skip) option.
Command line options (in addition to the general options for all bots):
XXXXas an alternative disambiguation
- Only use the alternatives given on the command line, do not read the page for other possibilities.
- If the page is a redirect page, use the page redirected to as the (only) alternative; if not set, the pages linked to from the page redirected to are used. If the page is not a redirect page, this will raise an error.
- "Primary topic" disambiguation (Begriffsklärung nach Modell 2). That's titles where one topic is much more important, the disambiguation page is saved somewhere else, and the important topic gets the nice name. All links found on page
XXXX (disambiguation)will be listed as options for the user, but the bot will still work on links to
- Like the above, but use XY as the only alternative, instead of searching for alternatives in [[Keyword (disambiguation)]]. Note: this is the same as
-primary -just -pos:XY.
- Reads a list of pages, which can for example be gotten through extract_names.py. XYZ is the name of the file from which the list is taken. If XYZ is not given, the user is asked for a filename.
- Page titles should be listed one per line, with [[brackets]].
-posparameter won't work if
- Instead of asking the user what to do, always perform the same action. For example,
XYcan be "r0", "u" or "2". Be careful with this option, and check the changes made by the bot. Note that some choices for XY don't make sense and will result in a loop, e.g., "l" or "m".
- Only check pages in the main namespace, not in the talk, wikipedia, user, etc. namespaces.
- Goes through all disambiguation pages in the category on your wiki that is defined (to the bot) as the category containing disambiguation pages, starting at XY. If only '-start' or '-start:' is given, it starts at the beginning.
To complete a move of a page, one can use:
python solve_disambiguation.py -just -pos:New_Name Old_Name
||This page is out of date and needs to be updated
A Wikibookian thinks that this page is no longer accurate, and the material in it needs to be updated by an editor or author.
Once this page has been brought up to date, you can remove this tag
Global arguments available for all bots
|-family:xyz||Set the family of the wiki you want to work on, e.g. wikipedia, wiktionary, commons, wikitravel, …. This will override the configuration in user-config.py settings.||user-config.py parameter:
|-lang:xx||Set the language of the wiki you want to work on, overriding the configuration in user-config.py where xx should be the language code.||user-config.py parameter:
|-log||Enable the logfile. Logs will be stored in the logs subdirectory.||user-config.py parameter:
|-log:xyz||Enable the logfile, using xyz as the filename.|
|-nolog||Disable the logfile (if it's enabled by default).|
|Set the minimum time (in seconds) the bot will wait between saving pages.||user-config.py parameter:
|Make the program output more detailed messages than usual to the standard output about its current work, or progress, while it is proceeding. This may be helpful when debugging or dealing with unusual situations.||not selected|
- Commons uses 'commons' for
family; Meta uses 'meta' for both.