User:Slaporte/slaw

The Wikisource Legal Tool gathers, wikifies, and sorts the text of a judicial decision. This script does not edit Wikisource--it is a tool to prepare material that can be manually added to Wikisource.

What it does

 * Separates the syllabus, opinion of the court, and any concurrences or dissents
 * Adds templates:
 * To the Syllabus: template:header, template:USSCcase, template:CaseCaption, template:PD-USGov
 * To the Opinion of the Court: template:header, template:USSCcase, template:PD-USGov
 * To any Dissent or Concurrence: template:header, template:USSCcase2, template:PD-USGov
 * Adds data (where available) into the above templates:
 * Court
 * Volume (citation)
 * Reporter (citation)
 * Page (citation)
 * Case name
 * Lower court (not always available)
 * Date decided
 * Date argued (not always available)
 * Docket number (not always available)
 * Wikifies foot notes by creating tags and ==Notes== section
 * Known issue with * notes that are sometimes at the begining of an opinion. I am not sure how to handle this, since MediaWiki automatically assigns numbers to foot notes
 * Wikifies links to:
 * Full citation to U.S. Reporter
 * Full citation to Federal Reporter

What it does not do (yet)

 * Identify the author of the opinion of the court, dissents, or concurrences
 * Identify corresponding article on Wikipedia
 * Wikify links to citations to state decisions, statutes, secondary material
 * Wikify short form citations or "Id."

Technical information
I wrote the Wikisource Legal Tool in PHP. It uses XPath to sift through the DOM tree of an HTML page. It can parse OpenJuris, and I have another version that parses some areas of Cornell's Legal Information Institute. This script is just a proof of concept--I wrote it when I should have been studying tax. If you want to help the project, please contact me.