Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.629.107 Times

Chess::PGN::Parse 0.19

  Date Added: April 20, 2010  |  Visits: 1.616

Chess::PGN::Parse

Report Broken Link
Printer Friendly Version


Product Homepage
Download (207 downloads)



Chess::PGN::Parse is a Perl module that reads and parses PGN (Portable Game Notation) Chess files. SYNOPSIS use Chess::PGN::Parse; use English qw( -no_match_vars ); my $pgnfile = "kk_2001.pgn"; my $pgn = new Chess::PGN::Parse $pgnfile or die "cant open $pgnfilen"; while ($pgn->read_game()) { print $pgn->white, ", " , $pgn->black, ", ", $pgn->result, ", ", $pgn->game, "n"; } use Chess::PGN::Parse; my $text =""; { local $INPUT_RECORD_SEPARATOR = undef; open PGN "< $pgnfile" or die; $text = ; close $text; } # reads from string instead of a file my $pgn = new Chess::PGN::Parse undef, $text; while ($pgn->read_game()) { print $pgn->white, ", " , $pgn->black, ", ", $pgn->result, ", ", $pgn->game, "n"; } use Chess::PGN::Parse; my $pgnfile = "kk_2001.pgn"; my $pgn = new Chess::PGN::Parse $pgnfile or die "cant open $pgnfilen"; my @games = $pgn->smart_read_all(); Chess::PGN::Parse offers a range of methods to read and manipulate Portable Game Notation files. PGN files contain chess games produced by chess programs following a standard format (http://www.schachprobleme.de/chessml/faq/pgn/). It is among the preferred means of chess games distribution. Being a public, well established standard, PGN is understood by many chess archive programs. Parsing simple PGN files is not difficult. However, dealing with some of the intricacies of the Standard is less than trivial. This module offers a clean handle toward reading and parsing complex PGN files. A PGN file has several tags, which are key/values pairs at the header of each game, in the format [key "value"] After the header, the game follows. A string of numbered chess moves, optionally interrupted by braced comments and recursive parenthesized variants and comments. While dealing with simple braced comments is straightforward, parsing nested comments can give you more than a headache. Chess::PGN::Parse most immediate methods are: read_game() reads one game, separating the tags and the game text. parse_game() parse the current game, and stores the moves into an array and optionally saves the comments into an array of hashes for furter usage. It can deal with nested comments and recursive variations. quick_parse_game() Same as the above, but doesnt save the comments, which are just stripped from the text. It cant deal with nested comments. Should be the preferred method when we know that we are dealing with simple PGNs. smart_parse_game() Best of the above methods. A preliminary check will call parse_game() or quick_parse_game(), depending on the presence of nested comments in the game. read_all(), quick_read_all(), smart_read_all() will read all the records in the current PGN file and return an array of hashes with all the parsed details from the games..

Requirements: No special requirements
Platforms: Linux
Keyword: Chess Chesspgnparse Comments Game Libraries Parse Perl Module Pgn Portable Game Notation Programming Read Reads
Users rating: 0/10

License: Freeware Size: 26.62 KB
USER REVIEWS
More Reviews or Write Review


CHESS::PGN::PARSE RELATED
Libraries  -  Tie::Eudora 0.01
Tie::Eudora is a Perl module that can encode/decode emails, read/write emails in Eudora mailbox files. SYNOPSIS #### # Subroutine interface # $encoded_email = decode_record($mailbox_email); @email = decode_field($encoded_email);...
66.56 KB  
Libraries  -  Test::Cmd 1.05
Test::Cmd is a Perl module for portable testing of commands and scripts. SYNOPSIS use Test::Cmd; $test = Test::Cmd->new(prog => program_or_script_to_test, interpreter => script_interpreter, string => identifier_string, workdir => ,...
30.72 KB  
Libraries  -  Games::Chess 0.003
Games::Chess Perl module represent chess positions and games. SYNOPSIS use Games::Chess qw(:constants); my $p = Games::Chess::Position->new; $p->at(0,0,BLACK,ROOK); $p->at(7,7,WHITE,ROOK); print $p->to_text; The Games::Chess package...
49.15 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  File::Comments 0.07
File::Comments is a Perl module that ecognizes file formats and extracts format-specific comments. SYNOPSIS use File::Comments; my $snoop = File::Comments->new(); # *---------------- # | program.c: # | /* comment */ # | main () {} #...
12.29 KB  
Libraries  -  File::Type::Builder 0.22
File::Type::Builder is Perl module to parse mime-magic and generate code. SYNOPSIS my $build = File::Type::Builder->new(); while ( ) { chomp; my $parsed = $build->parse_magic($_); my $code = $build->string_start($parsed); (or...
153.6 KB  
Libraries  -  Webalizer::Hist 0.02
Webalizer::Hist is a Perl module to parse the webalizer.hist-file. SYNOPSIS use Webalizer::Hist; if(my $dwh = Webalizer::Hist->new(source => "webalizer.hist")) { while(my $hashref = $dwh->month()) { print "Got " . $hashref->{totalhits} ....
5.12 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Home & Leisure  -  Chess Game Notation File Converter 1.0
Chess games in electronic form (usually downloaded from Internet sites) are written in algebraic notation and in accordance with the PGN Standards (Pgn=Portable Game Notation). The chess games are thus given in files with the extension pgn, e.g....
71.68 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.11.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB