PGN to Wikitext

From FinalTheoryofChess

Jump to: navigation, search

Contents


Commentary on Current Version

AL 0.910 Alpha now divides all classes into separate class files. The end user now has the option to choose between manual input of footer information, or to select a pre-formated option for Droidfish analysis. This version has overcome certain bugs in previous versions that led to errors reading computer analysis from the Portable Game Notation (PGN) file and correctly formatting the computer analysis in the output Wikitext file. By default, this version searches for the input file in the current working directory, and writes the output file into the working directory as well. Input PGN must be in Long Algebraic Notation (LAN) to be read by HAL 0.910 a. Castling must be written as King origin - destination, e.g. Ke1-g1 for 0-0, Ke1-c1 for 0-0-0.

Commentary on Previous Versions

This version (0.051) adds to version 0.05a the (limited) ability to handle annotations that are in the form of computer analysis. The Fritz 7 GUI running the chess engine Stockfish 2.3.1 was used to annotate Legal's Mate in the Philidor / Paris Defense (1.e4 e5 2.Nf3 Nc6 3.Bc4 d6). The resulting long-algebraic PGN was then pasted into the PGN_Input.pgn file. This Java program is tailored to work with the specific format produced by the Fritz 7 GUI but other chess programs may not produce a compatible PGN.

This program recognizes an annotation when it finds a left bracket ' [ '. All of the text contained between the left and right brackets is displayed above the chess diagrams along with the following section header: ==Computer Analysis==. Every page for which there is an accompanying annotation, this program can insert a references section at the bottom of the page, i.e. a footer. A section header, ==Continuations==, now demarcates the annotations from the continuations.

At the outset of the program, the user is prompted to answer three questions. The first: "Enter a caption for the diagrams: " The caption is displayed at the bottom of each chess diagram. In this example (see output_PGN2Wiki.txt), I entered Paris Defense, Legal's Mate. The second question is: "Enter page name length in number of plys: " Generally, the answer to this should be 4 unless there is a name conflict with an existing page. In such cases increase the answer to the next even number '6' and in even rarer cases where, the answer may need to be the next even number '8'. Answering '4' will result in pages being named similar to the following: 17.dxe4 e5 18.Nf3 exf4 19.gxf4. (Answering '6' instead of '4' would have resulted in 16.Nxe4 Nxe4 17.dxe4 e5 18.Nf3 exf4 19.gxf4 instead.)

The third prompt request the user to enter footer information. This footer information is then included on every generated wiki page for which there is accompanying annotation. In this example, I entered '''Engine: '''Stockfish 2.3.1 JA.

The ability to handle annotations is intended to pave the way for the PGN to Wikitext translator to transform an entire chess database that is full of computer analysis into individual wikipages which display the computer evaluations for each individual position. In this way, the computer analysis from any PGN database of the proper format can be incorporated into the a (this) wiki-based chess database.

Limitations: This version still lacks the ability to differentiate between pieces when either knight or rook has the ability to move to the same square. For example, it will display 5.Nf3 in situations where it should include the origin of said piece, e.g. 5.Ngf3 (because the queen knight on 'd2' also had the ability to move to f3.

Open Source Code & Bytecode

Current Version

  1. File:HAL NotationFormat(2015-04-13).zip

Previous Versions

  1. File:HAL 0.04 alpha.zip
  2. File:HAL 0.05 alpha.zip
  3. File:HAL 0.051 alpha.zip
  4. File:HAL 0.0910 Alpha.zip

Sample Output

File:PGN to Wikitext screen shot.jpg

Java Programming Language

Java Development Kit at Oracle.com

JCreator Java IDE

JCreator software

Personal tools