Hello.
I'm looking for a complex PGN file for testing a PGN parser. Something with complex variations and a variety of test cases.
I thought something like that should be already available, but I could not find anything from google.
Anyone with a link to such a test PGN file?
Thanks in advance.
looking for a complex PGN file for testing PGN parser
Moderators: hgm, Rebel, chrisw
-
- Posts: 164
- Joined: Wed Dec 23, 2009 1:57 pm
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: looking for a complex PGN file for testing PGN parser
The "enormous.pgn" file on my ftp box is daunting. In one game, there are comments nested 17 levels deep. If that doesn't break your parsing, it will probable work for most everything. You will also find all the usual nonsense, wrong o-o characters (should be alpha-o, not zero), and moves like 1.e4 with no space, etc...casaschi wrote:Hello.
I'm looking for a complex PGN file for testing a PGN parser. Something with complex variations and a variety of test cases.
I thought something like that should be already available, but I could not find anything from google.
Anyone with a link to such a test PGN file?
Thanks in advance.
-
- Posts: 65
- Joined: Sun Jul 31, 2011 11:57 am
- Location: Waterlooville, Hampshire, UK
Re: looking for a complex PGN file for testing PGN parser
What do you mean by 'comment nesting'?bob wrote:The "enormous.pgn" file on my ftp box is daunting. In one game, there are comments nested 17 levels deep. If that doesn't break your parsing, it will probable work for most everything. You will also find all the usual nonsense, wrong o-o characters (should be alpha-o, not zero), and moves like 1.e4 with no space, etc...casaschi wrote:Hello.
I'm looking for a complex PGN file for testing a PGN parser. Something with complex variations and a variety of test cases.
I thought something like that should be already available, but I could not find anything from google.
Anyone with a link to such a test PGN file?
Thanks in advance.
-
- Posts: 27792
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: looking for a complex PGN file for testing PGN parser
Probably recursive variations.trojanfoe wrote:What do you mean by 'comment nesting'?
-
- Posts: 670
- Joined: Mon Dec 03, 2007 3:01 pm
- Location: Barcelona, Spain
Re: looking for a complex PGN file for testing PGN parser
just to be more precise.
Comments may not be nested according to the pgn specification. Only Variations can. Its the difference between {} and ().
Comments may not be nested according to the pgn specification. Only Variations can. Its the difference between {} and ().
5: Commentary
Comment text may appear in PGN data. There are two kinds of comments. The
first kind is the "rest of line" comment; this comment type starts with a
semicolon character and continues to the end of the line. The second kind
starts with a left brace character and continues to the next right brace
character. Comments cannot appear inside any token.
Brace comments do not nest; a left brace character appearing in a brace comment
loses its special meaning and is ignored. A semicolon appearing inside of a
brace comment loses its special meaning and is ignored. Braces appearing
inside of a semicolon comments lose their special meaning and are ignored.
8.2.5: Movetext RAV (Recursive Annotation Variation)
An RAV (Recursive Annotation Variation) is a sequence of movetext containing
one or more moves enclosed in parentheses. An RAV is used to represent an
alternative variation. The alternate move sequence given by an RAV is one that
may be legally played by first unplaying the move that appears immediately
prior to the RAV. Because the RAV is a recursive construct, it may be nested.
-
- Posts: 65
- Joined: Sun Jul 31, 2011 11:57 am
- Location: Waterlooville, Hampshire, UK
Re: looking for a complex PGN file for testing PGN parser
That is actually a very useful file Bob - I found several bugs in my PGN scanner/parser by testing against it. Many thanks!bob wrote:The "enormous.pgn" file on my ftp box is daunting. In one game, there are comments nested 17 levels deep. If that doesn't break your parsing, it will probable work for most everything. You will also find all the usual nonsense, wrong o-o characters (should be alpha-o, not zero), and moves like 1.e4 with no space, etc...casaschi wrote:Hello.
I'm looking for a complex PGN file for testing a PGN parser. Something with complex variations and a variety of test cases.
I thought something like that should be already available, but I could not find anything from google.
Anyone with a link to such a test PGN file?
Thanks in advance.
-A
-
- Posts: 438
- Joined: Mon Apr 24, 2006 8:06 pm
Re: looking for a complex PGN file for testing PGN parser
Try this:
Code: Select all
[Event "This is an event with a \""]
[Site "This site has \\\\ xxx"]
[Date "1996.08.15"][Round "-"][White "White"][Black "Black"]
[Result "1/2-1/2"][SetUp "1"];I love comments
[FEN "1nbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/1NBQKBNR w KQkq - "]e4(d4;comment
d5!!2.c4$50(Nf3?))e5 Nf3{Comment !}Nc6 Nc3 Nf6 Bc4 Bc5 O-O O-O
% This is a line with an escape character !
@@@æææ {unexpected characters are skipped}
<> {These symbols are reserved}
1/2-1/2
-
- Posts: 65
- Joined: Sun Jul 31, 2011 11:57 am
- Location: Waterlooville, Hampshire, UK
Re: looking for a complex PGN file for testing PGN parser
Yeah that causes my parser problems, however where does the PGN spec state that 'unexpected characters are skipped'?Rémi Coulom wrote:Try this:
Code: Select all
[Event "This is an event with a ""] [Site "This site has \\\\ xxx"] [Date "1996.08.15"][Round "-"][White "White"][Black "Black"] [Result "1/2-1/2"][SetUp "1"];I love comments [FEN "1nbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/1NBQKBNR w KQkq - "]e4(d4;comment d5!!2.c4$50(Nf3?))e5 Nf3{Comment !}Nc6 Nc3 Nf6 Bc4 Bc5 O-O O-O % This is a line with an escape character ! @@@æææ {unexpected characters are skipped} <> {These symbols are reserved} 1/2-1/2
-A
-
- Posts: 164
- Joined: Wed Dec 23, 2009 1:57 pm
Re: looking for a complex PGN file for testing PGN parser
Thanks.Rémi Coulom wrote:Try this:
Code: Select all
[Event "This is an event with a ""] [Site "This site has \\\\ xxx"] [Date "1996.08.15"][Round "-"][White "White"][Black "Black"] [Result "1/2-1/2"][SetUp "1"];I love comments [FEN "1nbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/1NBQKBNR w KQkq - "]e4(d4;comment d5!!2.c4$50(Nf3?))e5 Nf3{Comment !}Nc6 Nc3 Nf6 Bc4 Bc5 O-O O-O % This is a line with an escape character ! @@@æææ {unexpected characters are skipped} <> {These symbols are reserved} 1/2-1/2
More of those would actually help (note my PGN parser complains about the FEN string since a couple of digits at the end are missing)
-
- Posts: 164
- Joined: Wed Dec 23, 2009 1:57 pm
Re: looking for a complex PGN file for testing PGN parser
I also believe that the standard does not allow comments in the "tag pair section", defined in section 8.1 as: "The tag pair section is composed of a series of zero or more tag pairs. A tag pair is composed of four consecutive tokens: ..."trojanfoe wrote:Yeah that causes my parser problems, however where does the PGN spec state that 'unexpected characters are skipped'?Rémi Coulom wrote:Try this:
Code: Select all
[Event "This is an event with a ""] [Site "This site has \\\\ xxx"] [Date "1996.08.15"][Round "-"][White "White"][Black "Black"] [Result "1/2-1/2"][SetUp "1"];I love comments [FEN "1nbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/1NBQKBNR w KQkq - "]e4(d4;comment d5!!2.c4$50(Nf3?))e5 Nf3{Comment !}Nc6 Nc3 Nf6 Bc4 Bc5 O-O O-O % This is a line with an escape character ! @@@æææ {unexpected characters are skipped} <> {These symbols are reserved} 1/2-1/2
-A