Is there a program to correct pgn?

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Is there a program to correct pgn?

Postby Uri Blass » 22 Nov 2004, 11:16

When I download the games of wbec from all 7 divisions I find some errors in the games.

It is easy for humans to correct the error because they can see that after the error there is a comment about illegal moves in the pgn file and the only mistake is that the illegal move is not inside a comment.

My question is if there is some program that can fix errors like these errors.

For the record
The errors that I find are in the games

Ozwald 0.43- Mustang 1.72 ply 100 move h4xf6+ is illegal line 1761
Ozwald 0.43- TSCP 1.73 ply 90 move c4c2 is illegal line 5511
Gandalf 4.32h- FrancescaMAD 0.0.9 ply 45 move O-O is illegal line 311765
DanChess 1.0- Belzebub 0.62 MPPS II ply 213 move Kd7 is illegal line 391676
Djinn 0.781- Chispa 3.94b ply 65 move Kg8xf7 is illegal line 406459
Tao 5.4- WildCat 2.79 ply 120 move Rh8+ is illegal line 424506
Booot 2.4- ChessRikus 1.4.60 ply 100 move Ka5a6 is illegal line 561530
WESP 0.8- Matacz 0.93 ply 183 move a8a8 is illegal line 569097


Uri
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: Is there a program to correct pgn?

Postby Uri Blass » 22 Nov 2004, 11:50

For the record here are the games that were corrected manually(after I corrected them)

After the correction movei reports no error.
I used mainly cut and paste to change the place of the illegal move to be inside the comment.

Notepead is a slow editor for big files and often needs some seconds for simple cut or paste inspite of the fact that I use a fast computer and I will be happy to know if there is a better alternative to edit big files of 25 Mbytes manually.

[Event "WBEC1-4th Division"]
[Site "DUAL-P3-933"]
[Date "2001.07.10"]
[Round "7"]
[Number "1028"]
[White "Ozwald 0.43"]
[Black "Mustang 1.72"]
[Result "0-1"]
[TimeControl "60/3600"]

1. Nf3 e6 2. g3 d5 3. Bg2 c5 4. c4 dxc4 5. Ne5 Nf6 6. O-O Be7 7. Qa4+ Kf8
8. Na3 Bd6 9. Nexc4 a6 10. Qb3 Nc6 11. Bxc6 bxc6 12. Qf3 Nd5 13. Nxd6 Qxd6
14. Nc4 Qd8 15. Qa3 Nb4 16. Qa4 Bb7 17. Na5 Qb6 18. a3 Nd5 19. Nxb7 Qxb7
20. e4 Nf6 21. d4 Nxe4 22. Qc2 Nf6 23. dxc5 Re8 24. Bg5 Nd5 25. b4 f6 26.
Bd2 Qb5 27. a4 Qe2 28. Rae1 Qg4 29. Re4 Qf3 30. Qc4 e5 31. Rfe1 Ra8 32. b5
axb5 33. axb5 Ne7 34. b6 Rb8 35. Qa2 Qf5 36. Ra4 Nc8 37. Ra8 Rb7 38. Qa6
Qd7 39. Re2 g6 40. Bb4 Kf7 41. Rd2 Qe7 42. Rd6 Kg7 43. Rxc6 Qd7 44. Qa4 Ne7
45. Rd6 Qxa4 46. Rxa4 Rhb8 47. c6 Rxb6 48. c7 Rxb4 49. h4 Rb1+ 50. Kg2 Rc8
{ 51.h4xf6 Illegal move Black wins} 0-1

[Event "WBEC1-4th Division"]
[Site "DUAL-P3-933"]
[Date "2001.07.23"]
[Round "23"]
[Number "880"]
[White "Ozwald 0.43"]
[Black "TSCP 1.73"]
[Result "0-1"]
[TimeControl "60/3600"]

1. d4 d5 2. Nc3 e6 3. Bf4 Bb4 4. Qd3 Nf6 5. a3 Bxc3+ 6. Qxc3 Nc6 7. O-O-O
Ne4 8. Qe1 Qh4 9. g3 Qd8 10. f3 Nf6 11. h4 O-O 12. h5 Re8 13. h6 g6 14. g4
Nxd4 15. g5 Nh5 16. Bd2 e5 17. Bh3 Bxh3 18. Rxh3 e4 19. f4 Qd7 20. Qf1 Nf5
21. e3 f6 22. Qg2 Qd8 23. Qg4 fxg5 24. Rxh5 Nxe3 25. Bxe3 gxh5 26. Qxh5
gxf4 27. Rxd5 fxe3 28. Rxd8 Raxd8 29. Qg5+ Kf7 30. Qg7+ Ke6 31. Qxc7 Rf8
32. Qc4+ Kf5 33. b3 b6 34. Qc3 Rd6 35. Qxe3 Rg8 36. Nh3 Rg4 37. Qf2+ Ke5
38. Qh2+ Kd5 39. Ng5 Rg6 40. Nxh7 Rg1+ 41. Kb2 R6g2 42. Nf6+ Ke6 43. Qh3+
Kxf6 44. h7 Rg8 45. c4 R8g2+
{46. c4c2 Black wins because a illegal move of white} 0-1

[Event "WBEC Premier Div.4"]
[Site "MP2400"]
[Date "2003.08.29"]
[Round "16.4"]
[Number "60"]
[White "Gandalf 4.32h"]
[Black "FrancescaMAD 0.0.9"]
[Result "1-0"]
[TimeControl "40/2400"]

1. d4 e6 2. e4 d5 3. Nc3 Bb4 4. e5 c5 5. a3 Bxc3+ 6. bxc3 Qc7 7. Nf3 b6 8.
a4 Ba6 9. Bxa6 Nxa6 10. O-O cxd4 11. cxd4 Rc8 12. Ba3 Ne7 13. Qb1 Nb8 14.
Bd6 Qd8 15. Qb5+ Qd7 16. Rfc1 Nbc6 17. c4 f6 18. Kf1 Rg8 19. cxd5 Nxd5 20.
Qd3 Rh8 21. Nd2 Nde7 22. Ne4 fxe5 23. dxe5
{Black wins on time, illegal move (O-O) by Francesca!} 1-0

[Event "WBEC6 6th Division"]
[Site "DUAL-P3-933"]
[Date "2003.10.19"]
[Round "13"]
[Number "294"]
[White "DanChess 1.0"]
[Black "Belzebub 0.62 MPPS II"]
[Result "1-0"]
[TimeControl "40/2400"]

1. d4 e6 2. e4 d5 3. Nc3 Bb4 4. e5 Bxc3+ 5. bxc3 Ne7 6. Nf3 c5 7. Bb5+ Bd7
8. Bd3 Qa5 9. Bd2 c4 10. Be2 Nbc6 11. O-O Rb8 12. a4 Nd8 13. Bg5 Bxa4 14.
Bxe7 Kxe7 15. Qc1 b5 16. Qg5+ Kf8 17. Qd2 Kg8 18. Bd1 Qc7 19. Ng5 Nc6 20.
Bh5 Rf8 21. Bxf7+ Rxf7 22. Nxe6 Qa5 23. Rfe1 Ne7 24. Re2 Nc8 25. Rae1 Re7
26. Nc5 Re8 27. f3 Nb6 28. g3 Nc8 29. Nd7 Qd8 30. Nc5 Nb6 31. Qc1 Qa8 32.
Qf4 Rf8 33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[Black "Chispa 3.94b"]
[Result "1-0"]
[TimeControl "40/2400"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O b5 6. Bb3 Bb7 7. Re1 Bc5 8.
c3 d6 9. d4 Bb6 10. Bg5 h6 11. Bxf6 Qxf6 12. Bd5 O-O 13. Na3 Rab8 14. Nc2
Ne7 15. Bxb7 Rxb7 16. a4 c5 17. Qd3 c4 18. Qd2 Nc6 19. axb5 axb5 20. Ne3
exd4 21. Nd5 Qd8 22. Nxd4 Bxd4 23. cxd4 Re8 24. Qd1 Qd7 25. Ra6 Ra7 26. Rb6
Ne7 27. Nxe7+ Rxe7 28. h3 Re8 29. Qg4 Qxg4 30. hxg4 d5 31. Rxb5 Rxe4 32.
Rxe4 Ra1+ 33. Kh2
{Black wins on time,Kg8xf7 illegal move by Chispa} 1-0

[Event "WBEC6 1st Division"]
[Site "MP2400"]
[Date "2003.11.12"]
[Round "14.2"]
[Number "606"]
[White "Tao 5.4"]
[Black "WildCat 2.79"]
[Result "0-1"]
[TimeControl "40/2400"]

1. d4 Nf6 2. c4 g6 3. Nf3 Bg7 4. Nc3 O-O 5. e4 d6 6. Be2 e5 7. O-O Nc6 8.
d5 Ne7 9. Qb3 Nh5 10. Ne1 Nf4 11. Bxf4 exf4 12. Nd3 g5 13. c5 dxc5 14. Nxc5
Qd6 15. Nd3 c6 16. Rad1 cxd5 17. Nxd5 Nxd5 18. exd5 Re8 19. Rfe1 b6 20. Nb4
Bd7 21. Nc2 Rac8 22. Ba6 Rxe1+ 23. Rxe1 Rc5 24. Nb4 Bf6 25. a3 b5 26. Qa2
f3 27. g3 g4 28. Qb3 Bd4 29. Qd3 Qf6 30. Rd1 Bxb2 31. Qe3 Bd4 32. Qf4 Qxf4
33. gxf4 Kg7 34. Bb7 a5 35. Nc6 Bxc6 36. Bxc6 b4 37. axb4 axb4 38. Ba4 Rxd5
39. Bb3 Rd8 40. Kf1 Kf6 41. Rd3 Kf5 42. Bxf7 h5 43. Bb3 h4 44. h3 Ke4 45.
Bc2 gxh3 46. Re3+ Kxf4 47. Re4+ Kg5 48. Kg1 Bxf2+ 49. Kxf2 h2 50. Re1 Rd2+
51. Kxf3 Rxc2 52. Ra1 h3 53. Ra5+ Kh4 54. Ra1 h1=Q+ 55. Rxh1 b3 56. Rd1
Rc3+ 57. Kf2 h2 58. Kg2 b2 59. Kf2 Kh3 60. Rd8 h1=N+
{White wins on time,61. Rh8+ illegal move by Tao (dont know about minor promotion!)} 0-1

[Event "WBEC7 6th Division"]
[Site "DUAL-P3-933"]
[Date "2004.02.10"]
[Round "2"]
[Number "33"]
[White "Booot 2.4"]
[Black "ChessRikus 1.4.60"]
[Result "0-1"]
[TimeControl "40/2400"]

1. c4 e5 2. Nc3 Nc6 3. e3 Nf6 4. Bd3 d5 5. cxd5 Nxd5 6. Be4 Ndb4 7. Nge2
Nd3+ 8. Bxd3 Qxd3 9. O-O Bd6 10. Ng3 O-O 11. Nge4 Be7 12. f3 Be6 13. Nf2
Qd7 14. d3 Rfd8 15. Qe2 b5 16. Nxb5 Nb4 17. a4 a6 18. Nc3 Nxd3 19. Rd1 Nxc1
20. Raxc1 Bd6 21. a5 Bb3 22. Rd2 f5 23. e4 f4 24. Qd3 Qe6 25. Nd5 Bxd5 26.
Qxd5 Qxd5 27. Rxd5 Rab8 28. Nd3 Rb5 29. Rxb5 axb5 30. b4 Ra8 31. Kf2 Kf7
32. Ke2 Kf6 33. Rc6 h5 34. Nc5 Kf7 35. Na6 Ra7 36. h3 h4 37. Nc5 g6 38. Nd3
Ke7 39. Rc1 Ke8 40. Rb1 Ra6 41. Kd2 Rc6 42. Rc1 Kd7 43. Rxc6 Kxc6 44. Kc3
Kb7 45. Kb2 g5 46. Kb3 Ka6 47. Kc3 Be7 48. Kb2 Bf8 49. Ka3 c5 50. bxc5 Kxa5
{Black wins on time, 51. Ka5a6 illegal move by white!} 0-1


[Event "WBEC7 6th Division"]
[Site "DUAL-P3-933"]
[Date "2004.03.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Rg7
79. Qd5 Rgf7 80. Qh5+ Kg8 81. Qg6+ Kf8 82. Qh6+ Ke7 83. Kb2 R7f6 84. Qh7+
Rf7 85. Qh8 Kd6 86. Qb8+ Kc6 87. Qe5 R7f5 88. Qe8+ Kc5 89. c3 Rf6 90. Qe5+
Kc6 91. a4 Rf2+ 92. Ka3
{Draw by ...(3), 92...a8a8?? set to 1-0} 1-0
User avatar
Uri Blass
 
Posts: 727
Joined: 09 Oct 2004, 05:59
Location: Tel-Aviv

Re: Is there a program to correct pgn?

Postby Jim Ablett » 22 Nov 2004, 12:12

Hi Uri,

I think pgn-extract by David Barnes may do what you want.
Quote from Readme .... " The general form for calling pgn-extract is as follows:

pgn-extract [flags] [input-game-files]

In its simplest form, calling pgn-extract with no arguments will cause it
to read games from its standard input, check them and reproduce those
without errors in SAN notation on its standard output.

Normally, the input files from which games are to be extracted are listed
on the command line:

pgn-extract file1.pgn [file2.pgn ...] -oOutput.pgn


Download XP compatible/bugfixed version from my Homepage

http://homepages.tesco.net/henry.ablett/jims.html

Regards
Jim
Jim Ablett
 
Posts: 721
Joined: 27 Sep 2004, 10:39
Location: Essex, England


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 11 guests