Cannot import PGN file from chessbase.com
waveman777 opened this issue · 1 comments
Hi there. I don't seem to be able to open PGN file downloaded from chessbase.com site.
I get this error: "The document “...” could not be opened."
This is what's inside the file:
`[Event "10m + 0s"]
[White "Waveman777"]
[Black "Ant49"]
[Site "play.chessbase.com"]
[Round ""]
[Annotator ""]
[Result "1-0"]
[Date "2018.12.21"]
[WhiteElo "1620"]
[BlackElo "1295"]
[PlyCount "155"]
- e4 {[%emt 0:0:4]} e5 {[%emt 0:0:3]} 2. Nf3 {[%emt 0:0:1]} d6 {[%emt 0:0:1]} 3. h3 {[%emt 0:0:3]} Nf6 {[%emt 0:0:2]} 4. Nc3 {[%emt 0:0:5]} Be7 {[%emt 0:0:2]} 5. Bc4 {[%emt 0:0:2]} Be6 {[%emt 0:0:9]} 6. Bxe6 {[%emt 0:0:12]} fxe6 {[%emt 0:0:2]} 7. d3 {[%emt 0:0:2]} 0-0 {[%emt 0:0:2]} 8. 0-0 {[%emt 0:0:1]} Nc6 {[%emt 0:0:8]} 9. Bg5 {[%emt 0:0:1]} Nd4 {[%emt 0:0:3]} 10. Nxd4 {[%emt 0:0:2]} exd4 {[%emt 0:0:3]} 11. Nb5 {[%emt 0:0:5]} e5 {[%emt 0:0:8]} 12. f4 {[%emt 0:0:6]} a6 {[%emt 0:0:2]} 13. Bxf6 {[%emt 0:0:13]} Bxf6 {[%emt 0:0:9]} 14. fxe5 {[%emt 0:0:9]} dxe5 {[%emt 0:0:8]} 15. Na3 {[%emt 0:0:8]} c5 {[%emt 0:0:6]} 16. Nc4 {[%emt 0:0:2]} b5 {[%emt 0:0:4]} 17. Na5 {[%emt 0:0:10]} Qxa5 {[%emt 0:0:4]} 18. Qh5 {[%emt 0:0:6]} Qd8 {[%emt 0:0:22]} 19. c3 {[%emt 0:0:10]} Qe7 {[%emt 0:0:7]} 20. c4 {[%emt 0:0:5]} b4 {[%emt 0:0:4]} 21. a4 {[%emt 0:0:3]} a5 {[%emt 0:0:2]} 22. b3 {[%emt 0:0:1]} Qf7 {[%emt 0:0:20]} 23. Qf5 {[%emt 0:0:43]} Ra7 {[%emt 0:0:15]} 24. Ra2 {[%emt 0:0:2]} Ra6 {[%emt 0:0:20]} 25. Raf2 {[%emt 0:0:4]} Qg6 {[%emt 0:0:16]} 26. Qd7 {[%emt 0:0:16]} Qe8 {[%emt 0:0:15]} 27. Qd5+ {[%emt 0:0:14]} Kh8 {[%emt 0:0:16]} 28. Qb7 {[%emt 0:0:11]} Qc6 {[%emt 0:0:18]} 29. Qe7 {[%emt 0:1:4]} Raa8 {[%emt 0:0:24]} 30. Rxf6 {[%emt 0:0:22]} gxf6 {[%emt 0:0:9]} 31. Rf5 {[%emt 0:0:20]} Rae8 {[%emt 0:0:21]} 32. Qa7 {[%emt 0:0:29]} Ra8 {[%emt 0:0:7]} 33. Qe7 {[%emt 0:0:8]} Rae8 {[%emt 0:0:13]} 34. Qa7 {[%emt 0:0:2]} Ra8 {[%emt 0:0:2]} 35. Qe7 {[%emt 0:0:2]} Qe8 {[%emt 0:0:13]} 36. Qxc5 {[%emt 0:0:5]} Qf7 {[%emt 0:0:27]} 37. Qb5 {[%emt 0:0:17]} Rfb8 {[%emt 0:0:10]} 38. Qc6 {[%emt 0:0:16]} Rc8 {[%emt 0:0:2]} 39. Qb6 {[%emt 0:0:7]} Rcb8 {[%emt 0:0:4]} 40. Qc6 {[%emt 0:0:12]} Rc8 {[%emt 0:0:3]} 41. Qd6 {[%emt 0:0:13]} Rd8 {[%emt 0:0:7]} 42. Qb6 {[%emt 0:0:10]} Rdb8 {[%emt 0:0:2]} 43. Qc6 {[%emt 0:0:2]} Rc8 {[%emt 0:0:1]} 44. Qd6 {[%emt 0:0:1]} Rd8 {[%emt 0:0:1]} 45. Qb6 {[%emt 0:0:21]} Rdb8 {[%emt 0:0:2]} 46. Qc5 {[%emt 0:0:4]} Rc8 {[%emt 0:0:7]} 47. Qd6 {[%emt 0:0:6]} Rd8 {[%emt 0:0:2]} 48. Qc5 {[%emt 0:0:8]}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rxc6 {[%emt 0:0:7]} 75. Qe5 {[%emt 0:0:6]} Rxa4 {[%emt 0:0:12]} 76. Qe8+ {[%emt 0:0:2]} Kf6 {[%emt 0:0:4]} 77. Qxc6+ {[%emt 0:0:1]} Ke5 {[%emt 0:0:3]} 78. Qxa4 {[%emt 0:0:0]} 1-0
`
The PGN is invalid. Castling should use the letter O and not the number zero (0). Change the castling to Os and it works. From the PGN spec:
8.2.3.3: Basic SAN move construction
...
SAN kingside castling is indicated by the sequence "O-O"; queenside castling is
indicated by the sequence "O-O-O". Note that the upper case letter "O" is
used, not the digit zero. The use of a zero character is not only incompatible
with traditional text practices, but it can also confuse parsing algorithms
which also have to understand about move numbers and game termination markers.
Also note that the use of the letter "O" is consistent with the practice of
having all chess move symbols start with a letter; also, it follows the
convention that all non-pwn move symbols start with an upper case letter.