tool to add informant symbols to pgn games

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Jonathan003
Posts: 239
Joined: Fri Jul 06, 2018 4:23 pm
Full name: Jonathan Cremers

tool to add informant symbols to pgn games

Post by Jonathan003 »

I have an old small tool to ad a informant symbol to white or black moves in pgn games, it's called lgpgnmw. Here is a link to my google drive where you can download it:

lgpgnmw only works with 32 bits Windows, and it is doesn't work for big pgn databases. (for example with a pgn database with 300000 games it will not work).
I have tried it in DosBox but didn't get it to work.
I want to use it to filter out main lines from pgn files created with obk2bin. When converting a obk book to bin there is also an option "-p" to create a pgn file with the games.
obk2bin is included in OpenBook which you can download here: https://goneill.co.nz/chess.php

When making a obk book in Chessmaster 9000, there is an option to add the weight by frequency the moves are played. The moves that are played the mos ge 3 dots, the moves that are played less ge 2 dots, the moves that only played sometimes get 1 dot, and moves that were almost never played get no dots.
this is a sample how the pgn games looks like after converting the obk book to pgn with obk2bin:

[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "1/2-1/2"]

1. d2d4!! b8c6? 2. d4d5!! c6e5!! 3. e2e4!! e7e6!! 4. f2f4!! e6d5! 5. f4e5!!
d8h4!! 6. e1e2!! h4h5!! 7. e2e1!! h5h4!! 8. e1d2!! h4h6!! 9. d2c3!! h6c6!!
10. c3d2!! c6h6!! 11. d2e2!! h6h5!! 12. e2e1!! 1/2-1/2

[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "1/2-1/2"]

1. d2d4!! b8c6? 2. d4d5!! c6e5!! 3. e2e4!! e7e6!! 4. f2f4!! e6d5! 5. f4e5!!
d8h4!! 6. e1e2!! h4h5!! 7. e2d2!! h5h6!! 8. d2c3!! h6c6!! 9. c3d2!! c6h6!!
10. d2d3!! h6a6!! 11. d3d2!! a6h6!! 12. d2e1!! h6h4!! 13. e1d2!! h4f4!!
14. d2c3!! f4e5!! 15. d1d4!! f8b4!! 16. c3d3!! d5e4!! 17. d4e4!! e5e4!!
18. d3e4!! g8f6!! 19. e4e3!! b4c5!! 20. e3f3!! b7b5!! 1/2-1/2

[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "1/2-1/2"]

1. d2d4!! b8c6? 2. d4d5!! c6e5!! 3. e2e4!! e7e6!! 4. f2f4!! e6d5! 5. d1d5!!
e5c6!! 6. d5d1!! f8b4!! 7. c2c3!! b4c5!! 8. d1f3!! d7d6!! 9. c1e3!! c5e3!!
10. f3e3!! g8f6!! 11. b1d2!! e8g8!! 12. e1c1!! f8e8!! 13. e3g3!! f6e4!!
14. d2e4!! e8e4!! 15. f1d3!! e4e8!! 16. g1f3!! d8f6!! 17. f3g5!! c8f5!!
18. d3c4!! f5g6!! 19. h2h4!! h7h5!! 20. g3f3!! c6e7!! 1/2-1/2




To use it with lgpgnmw I first have to change the pgn to short algebraic so it looks like this:




[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "1/2-1/2"]

1.d4!! Nc6? 2.d5!! Ne5!! 3.e4!! e6!! 4.f4!! exd5! 5.fxe5!! Qh4+!! 6.Ke2!!
Qh5+!! 7.Ke1!! Qh4+!! 8.Kd2!! Qh6+!! 9.Kc3!! Qc6+!! 10.Kd2!! Qh6+!! 11.Ke2
!! Qh5+!! 12.Ke1!! 1/2-1/2

[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "1/2-1/2"]

1.d4!! Nc6? 2.d5!! Ne5!! 3.e4!! e6!! 4.f4!! exd5! 5.fxe5!! Qh4+!! 6.Ke2!!
Qh5+!! 7.Kd2!! Qh6+!! 8.Kc3!! Qc6+!! 9.Kd2!! Qh6+!! 10.Kd3!! Qa6+!! 11.Kd2
!! Qh6+!! 12.Ke1!! Qh4+!! 13.Kd2!! Qf4+!! 14.Kc3!! Qxe5+!! 15.Qd4!! Bb4+!!
16.Kd3!! dxe4+!! 17.Qxe4!! Qxe4+!! 18.Kxe4!! Nf6+!! 19.Ke3!! Bc5+!! 20.Kf3
!! b5!! 1/2-1/2

[Event "?"]
[Site "?"]
[Date "????.??.??"]
[Round "?"]
[White "?"]
[Black "?"]
[Result "1/2-1/2"]

1.d4!! Nc6? 2.d5!! Ne5!! 3.e4!! e6!! 4.f4!! exd5! 5.Qxd5!! Nc6!! 6.Qd1!!
Bb4+!! 7.c3!! Bc5!! 8.Qf3!! d6!! 9.Be3!! Bxe3!! 10.Qxe3!! Nf6!! 11.Nd2!!
O-O!! 12.O-O-O!! Re8!! 13.Qg3!! Nxe4!! 14.Nxe4!! Rxe4!! 15.Bd3!! Re8!! 16.
Nf3!! Qf6!! 17.Ng5!! Bf5!! 18.Bc4!! Bg6!! 19.h4!! h5!! 20.Qf3!! Ne7!!
1/2-1/2

I think the notations !! means 3 dots in the obk book, ! means 2 dots, ? means one dot, and no annotation means no dot.
I would like to filter out the games. Than I would create four databases. A database with only games with dubious move(s), (where there are no dot's), a database with only games with interesting move(s), (where there is one dot). a database with only games with common move(s), (where there are 2 dot's), and a database with only games with main moves, (where there are 3 dot's). I can search for games with a ?, and I can search for games with a !, and I can search for games with a !!. But I can not search for games with moves with no annotation.
I would like it if 3 dots get !!, 2dots get !, 1 dot get !? and no dot get ?!
Than I could easily search for all games in Chessbase.

This are the options of lgpgnw:

options:

wg1 - mark every white move with "!"
wg2 - mark every white move with "!!"
bg1 - mark every black move with "!"
bg2 - mark every black move with "!!"
wb1 - mark every white move with "?"
wb2 - mark every white move with "??"
bb1 - mark every black move with "?"
bb2 - mark every black move with "??"

So if I choose for example wb1 than it would add an extra ? to the notation. If there already was a ? than it would become ?? if there was already a ?? it would become ???, ect...

So I could use the options wb1 first and than the option bb1. And then in a text editor, (that can handle big files), first replace ?? with !? and than replace ? with ?! to get what I want.

The problem is that lgpgnmw works only in a windows 32 bit system, and doesn't work for big files.

I have tried to run it in DosBox but it I didn't get it to work.

Maybe someone could build a tool that does the same as lgpgnmw but faster on a 64 bit system and can handle big pgn files from over 500000 games?

Or build a tool to convert obk to pgn so the output would be like this: 3 dots get !!, 2dots get !, 1 dot get !? and no dot get ?!



There also exist a tool called markup-pgn:

But this tool erases first all informant symbols before adding the chosen informant symbol, so it's useless for this.

GRT
Jonathan003
Posts: 239
Joined: Fri Jul 06, 2018 4:23 pm
Full name: Jonathan Cremers

Re: tool to add informant symbols to pgn games

Post by Jonathan003 »

I want to delete the previous post but it is too late. I don't need an extra tool.
I use obk2bin to convert the obk book to pgn. The notations !! means 3 dots in the obk book, ! means 2 dots, one dot get's no annotation, and the moves with no dot get ? as notation. That's what the manual of the old 32 bit obk2pgn says. And I think it's the same when converting obk to pgn with obk2bin.

I convert to cbh format in Chessbase 15 and create a search booster.
Than to make two pgn databases from it, main lines and sidelines. I just have to search for ? in Chessbase and that's my database with sidelines. Than I just delete the games with ? and I have my database with main lines.
The result looks good so far.