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

Module pywikipedia.spellcheck

This bot spellchecks Wikipedia pages. It is very simple, only checking
whether a word, stripped to its 'essence' is in the list or not, it does
not do any grammar checking or such. It can be used in two ways:

spellcheck.py Title
    Check a single page; after this the bot will ask whether you want to
    check another page
spellcheck.py -start:Title
    Go through the wiki, starting at title 'Title'.
spellcheck.py -newpages
    Go through the pages on [[Special:Newpages]]

For each unknown word, you get a couple of options:
    numbered options: replace by known alternatives
    a: This word is correct; add it to the list of known words
    c: The uncapitalized form of this word is correct; add it
    i: Do not edit this word, but do also not add it to the list
    r: Replace the word, and add the replacement as a known alternative
    s: Replace the word, but do not add the replacement
    *: Edit the page using the gui
    g: Give a list of 'guessed' words, which are similar to the given one
    x: Ignore this word, and do not check the rest of the page

When the bot is ended, it will save the extensions to its word list;
there is one word list for each language.

The bot does not rely on Latin script, but does rely on Latin punctuation.
It is therefore expected to work on for example Russian and Korean, but not
on for example Japanese.

Command-line options:
-html     change HTML-entities like ü into their respective letters.
          This is done both before and after the normal check.
-rebuild  save the complete wordlist, not just the changes, removing the
          old wordlist.

Classes
SpecialTerm  
Word  

Function Summary
  askAlternative(word, context)
  cap(string)
  distance(a, b)
  getalternatives(string)
  makepath(path)
creates missing directories for the given path and returns a normalized absolute version of the path.
  removeHTML(page)
  spellcheck(page)
  uncap(string)

Imported modules:
codecs, re, string, sys, pywikipedia.wikipedia
Imported variables:
correct_html_codes, edit, endpage, knownwords, msg, newpages, newwords, rebuild, start, title
Function Details

makepath(path)

creates missing directories for the given path and
    returns a normalized absolute version of the path.

- if the given path already exists in the filesystem
  the filesystem is not modified.

- otherwise makepath creates directories along the given path
  using the dirname() of the path. You may append
  a '/' to the path if you want it to be a directory path.

from holger@trillke.net 2002/03/18

Generated by Epydoc 2.1 on Sun Jul 03 17:07:37 2005 http://epydoc.sf.net