Page MenuHomePhabricator

Efficient method for mapping a WikiProject template to the WikiProject Directory
Closed, ResolvedPublic


Something like this:

def wptemplate2directory(template_name):
  Convert a WikiProject template name to a path within the
  WikiProject Directory hierarchy.  

    template_name : str
      The name of a template (or redirected template) used to tag an article

    A directory path as a list of strings ordered from top to bottom.  
    E.g. "maths rating" returns ["stem", "mathematics"]

def resolve_title(page_name):
  Get the canonical name for a page name by following 
  redirects.  This method keeps a cache of mappings for page 
  names it's already seen.
    page_name : str
      the page name to resolve
    The string representing the canonical title of a page after redirects

Regretfully, there's no machine-readable version of