Chess::PGN::Filter

Chess::PGN::Filter is a Perl extension for converting PGN files to other formats.
Download

Chess::PGN::Filter Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Hugh S. Myers
  • Publisher web site:
  • http://search.cpan.org/~hsmyers/Chess-PGN-EPD-0.21/EPD.pm

Chess::PGN::Filter Tags


Chess::PGN::Filter Description

Chess::PGN::Filter is a Perl extension for converting PGN files to other formats. Chess::PGN::Filter is a Perl extension for converting PGN files to other formats.SYNOPSIS use Chess::PGN::Filter; filter(source => $pgn,filtertype => 'XML');OR my %substitutions = ( hsmyers => 'Myers, Hugh S (ID)', ); my @exclude = qw( WhiteElo BlackElo EventDate ); filter( source => $pgn, filtertype => 'TEXT', substitutions => %substitutions, nags => 'yes', exclude => @exclude, );OR filter( source => $pgn, filtertype => 'DOM', );OR $dom = filter( source => $pgn, filtertype => 'DOM', verbose => 0, );This is a typical text in one side, different text out the otherside filter module. There are as of this writing, the following supported choices:1. XML -- Converts from .pgn to .xml using the included pgn.dtd as the validation document. This is for the most part a one to one transliteration of the PGN standard into XMLese. It does have the additional virtue of allowing positions to be encoded within the XML output. These are generated by an embedded NAG of {0} and automatically (user controlled) at the end of each game. As a kind of adjunct to the position diagrams, pgn.dtd optionally allows each move to include it's FEN string. This allows scripted animation for web pages generated this information. 2. TEXT -- Although the PGN standard is widely available, many program that generate .pgn do so in an ill-formed way. This mode is an attempt to 'normalize' away the various flaws found in the 'wild'! This includes things like game text all on a single line without a preceding blank line. Or castling indicated with zeros rather than the letter 'O'. There is at least one application that carefully indents the first move! The list of oddities is probably as long as the list of applications. 3. DOM -- A Document Object Model (DOM) makes for a very convenient interim form, common to all other filter types. Useful in both the design and debugging phases of filter construction. By way of self-documentation, here is an example of a single game that shows all of the obvious features of the DOM: $VAR1 = { 'Tags' => { 'Site' => 'Boise (ID)', 'Event' => 'Cabin Fever Open', 'Round' => '1', 'ECO' => '?', 'Date' => '1997.??.??', 'White' => 'Barrett Curtis', 'Black' => 'Myers Hugh S', 'Result' => '1-0' }, 'Gametext' => }, . . . { 'Movenumber' => '29', 'Comment' => ' (Bxe5) Black could still kick for a while if he had played ...Bxe5.', 'Epd' => 'r1bq1rk1/2p1npb1/2n1p2P/pp1pP1p1/3P2P1/2P4Q/PP2BP2/RNB1K2R b KQ -', 'Movetext' => 'h6' } ] }; Requirements: · Perl


Chess::PGN::Filter Related Software