nguyenpham / ocgdb

Open Chess Game Database Standard (OCGDB)
MIT License
31 stars 8 forks source link

error messages when opening exported pgn from ocgdb in other chess GUI like Scid #22

Closed Jonathan003 closed 2 years ago

Jonathan003 commented 2 years ago

I used these commends ocgdb -pgn ecoE.pgn -db ecoE.db3 -cpu 4 -o moves2 ocgdb -db ecoE.db3 -cpu 4 -dup -o printall;remove ocgdb -pgn ecoE_out.pgn -db ecoE.db3 -cpu 4 -export

When I open the exported pgn in Scid I get thes error messages (game 9933, line 227803) Unexpected end of game: PGN header '[' seen inside game (result missing ?). (game 10333, line 235866) Unexpected end of game: PGN header '[' seen inside game (result missing ?). (game 14439, line 332695) Unexpected end of game: PGN header '[' seen inside game (result missing ?).

When I open the pgn's ecoE.pgn and ecoE_out.pgn in a text editor to compare them. I can see that games without a result have no result tag in the pgn exported by ocgdb.

[Result "*"]

This is how a game without a result looks like in the exported pgn from ocgdb

[Event "Rated Correspondence game"] [BlackElo "2430"] [White "Flowerdragon"] [Black "arvischess"] [TimeControl "-"] [Date "2019-02-26"] [Round "0"] [WhiteElo "2476"] [ECO "E06"] [PlyCount "32"]

  1. d4 d5 2. c4 e6 3. g3 Nf6 4. Bg2 Be7
  2. Nd2 O-O 6. Ngf3 c5 7. dxc5 Bxc5 8. O-O Nc6
  3. Nb3 Bd6 10. cxd5 exd5 11. Nbd4 Re8 12. Bg5 h6
  4. Bxf6 Qxf6 14. Rc1 Bd7 15. e3 Ne7 16. Qb3 b5

In the original pgn the game looks like this

[Event "Rated Correspondence game"] [BlackElo "2430"] [White "Flowerdragon"] [Black "arvischess"] [Result "*"] [TimeControl "-"] [Date "2019-02-26"] [Round "0"] [WhiteElo "2476"] [ECO "E06"] [PlyCount "32"]

  1. d4 d5 2. c4 e6 3. g3 Nf6 4. Bg2 Be7
  2. Nd2 O-O 6. Ngf3 c5 7. dxc5 Bxc5 8. O-O Nc6
  3. Nb3 Bd6 10. cxd5 exd5 11. Nbd4 Re8 12. Bg5 h6
  4. Bxf6 Qxf6 14. Rc1 Bd7 15. e3 Ne7 16. Qb3 b5

It is not a major issue but it would be nice if it could be fixed, so I don't get these annoying messages when opening the exported pgn from ocgdb in Scid. A also wonder if it will not give problems if the is no result tag in the game headers, when trying to make bin book with polyglot from the exported pgn's from ocgdb

nguyenpham commented 2 years ago

Fixed with commit https://github.com/nguyenpham/ocgdb/commit/8726834462c0037d7b8fe97bc6228e28feca31db

Jonathan003 commented 2 years ago

Thanks!