Package pywikipedia :: Module solve_disambiguation
[show private | hide private]
[frames | no frames]

Module pywikipedia.solve_disambiguation

Script to help a human solve disambiguations by presenting a set of options.

Specify the disambiguation page on the command line. The program will
pick up the page, and look for all alternative links, and show them with
a number adjacent to them. It will then automatically loop over all pages
referring 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:

   -pos:XXXX   adds XXXX as an alternative disambiguation

   -just       only use the alternatives given on the command line, do not
               read the page for other possibilities

   -redir      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    "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.

   -primary:XY 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

   -file:XYZ   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 saved one per line, without [[brackets]].
               The -pos parameter won't work if -file is used.

   -always:XY  instead of asking the user what to do, always perform the same
               action. For example, XY can 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".

   -main       only check pages in the main namespace, not in the talk,
               wikipedia, user, etc. namespaces.

To complete a move of a page, one can use:

    python solve_disambiguation.py -just -pos:New_Name Old_Name

Classes
DisambiguationRobot  
PrimaryIgnoreManager If run with the -primary argument, reads from a file which pages should not be worked on; these are the ones where the user pressed n last time.
ReferringPageGenerator  

Function Summary
  main()

Imported modules:
pywikipedia.config, math, pywikipedia.pagegenerators, re, sys, pywikipedia.wikipedia
Imported variables:
__version__, ignore_title, link_trail, msg, msg_redir, primary_topic_format
Generated by Epydoc 2.1 on Sun Jul 03 17:07:34 2005 http://epydoc.sf.net