Page 1 of 1

Strangeness in TWIC PGN files

Posted: Sun Jul 06, 2014 12:48 pm
by HumbleProgrammer
In the past couple of weeks, PGN downloads from http://www.theweekinchess.com have started giving my PGN parser fits. It seems that several files now contain games where a pair of hyphens ("--") appear in place of a move; twic1025.pgn has dozens of occurrences. Typically, these are at the end of the game (example #1) but once or twice they've appeared in the middle (example #2). Am I correct in assuming that this is invalid PGN?

--- example #1 ---
[Event "TCh-TUR 2014"]
[Site "Konya TUR"]
[Date "2014.06.26"]
[Round "5.7"]
[White "Adhiban,Baskaran"]
[Black "Kuljasevic,D"]
[Result "0-1"]
[WhiteTitle "GM"]
[BlackTitle "GM"]
[WhiteElo "2624"]
[BlackElo "2564"]
[ECO "C53"]
[Opening "Giuoco Piano"]
[WhiteTeam "Tasduvar Satranc Spor Kulubu"]
[BlackTeam "Alapli Aktif Genclik Spor Kulubu"]
[WhiteFideId "5018471"]
[BlackFideId "14506661"]
[EventDate "2014.06.23"]

1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. c3 Nf6 5. d3 a6 6. Bb3 d6 7. Nbd2 Ba7 8. h3 h6
9. Nf1 Be6 10. Ng3 Qd7 11. O-O O-O 12. Be3 Bxb3 13. Qxb3 Ne7 14. d4 Ng6 15. -- 0-1
--- example #2 ---
[Event "Turkey Cup 2014"]
[Site "Kemer TUR"]
[Date "2014.02.02"]
[Round "2.71"]
[White "Subasi,Zeki"]
[Black "Yuvarlak,U"]
[Result "1/2-1/2"]
[WhiteElo "1714"]
[BlackElo "1850"]
[ECO "C45"]
[Opening "Scotch"]
[Variation "Schmidt variation"]
[WhiteFideId "6345433"]
[BlackFideId "6305598"]
[EventDate "2014.02.01"]

1. e4 e5 2. Nf3 Nc6 3. d4 exd4 4. Nxd4 Nf6 5. Nc3 Bb4 6. Nxc6 bxc6 7. Bd3 d5 8.
O-O Bxc3 9. bxc3 dxe4 10. Qe2 O-O 11. Bxe4 Re8 12. f3 Bf5 13. Bg5 -- 14. Rad1
Qe7 15. Bxf6 Qxf6 16. Qc4 Rad8 17. Bxc6 1/2-1/2
--- end ---

Cheers!
Humble Programmer
,,,^..^,,,

Re: Strangeness in TWIC PGN files

Posted: Mon Jul 07, 2014 7:48 pm
by User923005
There is nothing in the PGN standard that would allow for that.
It looks to me like they are using "--" as nomenclature for a move that they are missing information for.
But the PGN standard has no such provision, and all following moves will be purely speculative anyway, since we won't know what the board looks like.

Re: Strangeness in TWIC PGN files

Posted: Thu Jul 10, 2014 8:42 pm
by hyatt
I'd bet Ken Thompson's PGN reader would handle that. He talked about this problem in the early 80's. David Levy wrote one of his Sicilian books and had Ken typeset it for him using figurine notation. Ken decided to start building a big book, and when he ran through everything David had, he started scanning in other books, and ran into major issues, as chess opening books are not always printed using the highest quality typefaces, ink and paper (this was prior to the adoption of laser printers, for example). He wrote a PGN reader that could, given enough moves in the game, figure out what that -- meant, which was pretty damned slick back then. If you assume all moves given are legal, you can often narrow that missing move down to just one move that must be played at that point so that some later move is not either illegal or ambiguous...

Used to be some puzzles running around based on this theme, in fact, "what is the missing move". And later the retrograde analysis crowd and their "given this position, what was white's last move" or some such...

Re: Strangeness in TWIC PGN files

Posted: Fri Jul 11, 2014 7:42 pm
by User923005
It reminds me of a woman I worked with from the University of Washington named Judy Zeh. We worked on some Biology papers on Bowhead Whales (Balaena mysticetus). She was always interested in everything being robust. Is the software robust? Is the mathematics robust? Is the analysis robust?

I remember thinking to myself that it was an excellent approach.

Re: Strangeness in TWIC PGN files

Posted: Fri Jul 25, 2014 9:39 pm
by pgn4web
Within PGN, the -- token is sometimes used for nullmoves, i.e. when a player "passes" and the opponent makes two moves in a row.
http://www.enpassant.dk/chess/palview/m ... gncontnull
Many PGN reader interpret the -- token like that (and the moves sequence sort of makes sense in the examples).

Not sure about the meaning of a nullmove into a TWIC file, you can always try asking Mark Chrowther, his email is on the TWIC homepage.