Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: PGN

Author: Bruce Moreland

Date: 22:03:02 09/30/05

Go up one level in this thread


On October 01, 2005 at 00:58:42, Bruce Moreland wrote:

>On October 01, 2005 at 00:01:45, Dann Corbit wrote:
>
>>On September 30, 2005 at 23:48:42, Bruce Moreland wrote:
>>
>>>As far as I know there has been no revision to the standard for ten years.
>>>Please correct me if I am wrong, and I would love to be wrong.
>>>
>>>Problems:
>>>
>>>1) No clear definition of export standard.  Is there one writer that is
>>>considered the standard?
>>>
>>>2) NAGs do not correlate well with Informant/ECO symbols.  There are some ECO
>>>meanings that don't exist, and other NAGs are ambiguous in that context.  This
>>>sounds like a trivial problem, but it causes hell if you try to write something
>>>that reads PGN, converts to some sane format for editing, and then write it back
>>>out to PGN.
>>>
>>>3) The standard allows comments in stupid places, some of which won't seem
>>>stupid to some people.
>>>
>>>Assume you are parsing a file, and you find a comment.  You really want to
>>>attach it to a move.  This is kind of hard to do if the comment follows the last
>>>game in the file, if it occurs between games, occurs in the middle of a tag,
>>>etc.
>>>
>>>Anyone else know of problems?  Anyone else have any idea how to fix them?
>>
>>I complained about en passent sqares that don't exist.  The standard says that
>>these two positions are different:
>>[d]3k4/3p4/8/8/3P4/8/8/3K4 b - -
>>[d]3k4/3p4/8/8/3P4/8/8/3K4 b d2 -
>
>d3 isn't even a legal en-passant square, but I get what you mean.  The
>en-passant square should not be included in a FEN if it an en-passant move to
>that square is not legal.  Period.
>
>My argument is by analogy with the situation involving white knights on c3, g1,
>with he c3 knight pinned against the king.  You do not need to say Nge2 in SAN.
>
>>Clearly they are not.
>>
>>>Last time I sent email to Steven J Edwards about this, he essentially told me
>>>that great minds were working on it, and that I should shut up and go away.
>>>
>>>That was in about 1997.
>>
>>That pretty much sums it up.  There have been some efforts at adding stuff for
>>computer chess (that %emt, %clk goo}:
>>http://www.enpassant.dk/chess/palview/enhancedpgn.htm
>
>Yes, not at all what I'm getting at.
>
>>If you want to see a parser that can really go to town, PGN-Extract by Barnes is
>>really good.
>
>Yes, this seems good, but put a comment before the tags, in the tags, or after
>the last game, and see what happens.
>
>Before:
>
>{ a}
>[Event "?"]
>[Site "Luzern"]
>{ b }
>[{c}Date {d} "1989.??.??"{e}]{f}
>[Round "?"]
>[White "Nikolic Predrag"]
>[Black "Liang Jinrong"]
>[Result "1-0"]
>
>{g}1.{h}d4{i} $1{j} ({k} e4 {l} ) {m} Nf6 2.Nf3 e6 3.c4 d5 4.Nc3 Be7
>5.Bg5 O-O 6.e3 h6 7.Bh4 b6 8.Be2 Bb7
>9.Bxf6 Bxf6 10.cxd5 exd5 11.O-O Qe7 12.Qb3 Rd8
>13.Rad1 c5 14.dxc5 Bxc3 15.Qxc3 bxc5 16.Ne5 Nd7
>17.Nxd7 Rxd7 18.Bg4 Rc7 19.Rd2 Rd8 20.Rc1 Rd6
>21.Rdc2 Bc8 22.Bxc8 Rxc8 23.Qd3 c4 24.Qd4 Rb8
>25.Rd2 Ra6 26.a3 Ra5 27.h3 Rab5 28.Rcc2 R8b6
>29.Qf4 Qf6 30.Qxf6 Rxf6 31.e4 dxe4 32.Rxc4 Rfb6
>33.Rxe4 Rxb2 34.Rxb2 Rxb2 35.Re8+ Kh7 36.Re7 a6
>37.Rxf7 Rb3 38.Rf3 Rxf3 39.gxf3 Kg6 40.Kg2 Kf5
>41.Kg3 a5 42.a4 Kg5 43.f4 Kh5 44.Kf3 Kh4
>45.Kg2 Kh5 46.Kg3 Kg6 47.Kg4 Kf6 48.f5 Ke5
>49.f3 h5 50.Kg5 h4 51.Kg4  1-0
>{ n }
>
>After:
>
>[Event "?"]
>[Site "?"]
>[Date "????.??.??"]
>[Round "?"]
>[White "?"]
>[Black "?"]
>[Result "1-0"]
>
>{ g }
>
>1. d4 $1 { i } { j } ({ k } 1. e4 { l }) { m } 1... Nf6 2. Nf3 e6 3. c4 d5
>4. Nc3 Be7 5. Bg5 O-O 6. e3 h6 7. Bh4 b6 8. Be2 Bb7 9. Bxf6 Bxf6 10. cxd5
>exd5 11. O-O Qe7 12. Qb3 Rd8 13. Rad1 c5 14. dxc5 Bxc3 15. Qxc3 bxc5 16.
>Ne5 Nd7 17. Nxd7 Rxd7 18. Bg4 Rc7 19. Rd2 Rd8 20. Rc1 Rd6 21. Rdc2 Bc8 22.
>Bxc8 Rxc8 23. Qd3 c4 24. Qd4 Rb8 25. Rd2 Ra6 26. a3 Ra5 27. h3 Rab5 28.
>Rcc2 R8b6 29. Qf4 Qf6 30. Qxf6 Rxf6 31. e4 dxe4 32. Rxc4 Rfb6 33. Rxe4 Rxb2
>34. Rxb2 Rxb2 35. Re8+ Kh7 36. Re7 a6 37. Rxf7 Rb3 38. Rf3 Rxf3 39. gxf3
>Kg6 40. Kg2 Kf5 41. Kg3 a5 42. a4 Kg5 43. f4+ Kh5 44. Kf3 Kh4 45. Kg2 Kh5
>46. Kg3 Kg6 47. Kg4 Kf6 48. f5 Ke5 49. f3 h5+ 50. Kg5 h4 51. Kg4 1-0
>
>Notice that I killed all of the tags (the program emitted errors but continued),
>"g" got put by itself on a line, "h" disappeared entirely despite being between
>two other comments (?), "i" got moved to after the NAG, and "n" is gone.
>
>This program also leaves a space between "{" and comment text, but it doesn't
>leave a space after "(" and before ")".
>
>This is the kind of stuff I mean.
>

Not that I am complaining about this implementation.  It is probably correct to
put the comment after the NAG, for example.

bruce

>bruce
>
>>
>>Winboard has really clever parsing stuff in it to deal with crappy inputs.
>>
>>The Elo calculation stuff by Remi has a real nice PGN parser in it.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.