Latest Updates:
Normal Topic Filter games according to my repertoire (Read 418 times)
an ordinary chessplayer
Senior Member
****
Offline


I used to be not bad.

Posts: 491
Location: Columbus, OH (USA)
Joined: 01/02/15
Re: Filter games according to my repertoire
Reply #4 - 06/08/19 at 21:06:11
Post Tools
Easy on unix or mac.
Only slightly less easy on windows. http://gnuwin32.sourceforge.net/packages.html
  1. convert your repertoire.pgn(s) to repertoire.epd (e.g. use pgn-extract)
  2. convert your new.pgn to new.epd
  3. for each line in new.epd
    $ grep -F "fen" repertoire.epd

I wrote a couple of helper awk scripts to somewhat automate this task, and combined them in one attachment. You would have to separate them again before using. WIth these scripts, the exact sequence of commands to reproduce the above steps would be:
  • $ pgn-extract -w200 --fencomments -orepertoire1.pgn repertoire.pgn
  • $ gawk -f fencomments.awk repertoire1.pgn > repertoire1.epd
  • $ pgn-extract -w200 --fencomments -onew1.pgn new.pgn
  • $ gawk -f fencomments.awk new1.pgn > new1.epd
  • $ gawk -f epdcompare.awk -v CMP=repertoire1.epd new1.epd > cmp.epd


With the following repertoire.pgn
Code (Pascal)
Select All
[Event "rep game 1"]
[Result "*"]

1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 Nf6 5. Nc3 g6
6. f4 Bg7 7. e5 dxe5 8. fxe5 Ng4 9. Bb5+ Kf8 10. Ne6+
*

[Event "rep game 2"]
[Result "*"]

1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Nc6 5. Nf3 Qb6
6. Bd3 cxd4 7. cxd4 Nxd4 8. Nxd4 Qxd4 9. Bb5+ Bd7 10. Bxd7+ Kxd7
11. Qxd4
* 


And the following new.pgn to compare it to:
Code (Pascal)
Select All
[Event "new game 1"]
[Result "*"]

1. e4 e6 2. d4 d5 3. e5 c5 4. c3 Qb6 {N} 5. Nf3
5... Nc6 {transposition}
6. Bd3 cxd4 7. cxd4 Bd7 {N} 8. O-O Nxd4 9. Nxd4 Qxd4 10. Nc3 a6
* 


The output cmp.epd is below.
Code
Select All
rnbqkbnr/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BQK2R w KQkq -;hmvc 0;fmvn 7;id 1;fk 2;fmvnmax 7;
r1b1kbnr/pp3ppp/1qn1p3/3pP3/3P4/3B1N2/PP3PPP/RNBQK2R b KQkq -;hmvc 0;fmvn 7;id 1;fk 2;fmvnmax 7;
r3kbnr/pp1b1ppp/1qn1p3/3pP3/3P4/3B1N2/PP3PPP/RNBQK2R w KQkq -;hmvc 1;fmvn 8;id 1;fk 0;fmvnmax 0;
r3kbnr/pp1b1ppp/1qn1p3/3pP3/3P4/3B1N2/PP3PPP/RNBQ1RK1 b kq -;hmvc 2;fmvn 8;id 1;fk 0;fmvnmax 0;
r3kbnr/pp1b1ppp/1q2p3/3pP3/3n4/3B1N2/PP3PPP/RNBQ1RK1 w kq -;hmvc 0;fmvn 9;id 1;fk 0;fmvnmax 0;
r3kbnr/pp1b1ppp/1q2p3/3pP3/3N4/3B4/PP3PPP/RNBQ1RK1 b kq -;hmvc 0;fmvn 9;id 1;fk 0;fmvnmax 0;
r3kbnr/pp1b1ppp/4p3/3pP3/3q4/3B4/PP3PPP/RNBQ1RK1 w kq -;hmvc 0;fmvn 10;id 1;fk 0;fmvnmax 0;
r3kbnr/pp1b1ppp/4p3/3pP3/3q4/2NB4/PP3PPP/R1BQ1RK1 b kq -;hmvc 1;fmvn 10;id 1;fk 0;fmvnmax 0;
r3kbnr/1p1b1ppp/p3p3/3pP3/3q4/2NB4/PP3PPP/R1BQ1RK1 w kq -;hmvc 0;fmvn 11;id 1;fk 0;fmvnmax 0; 


Note that it matches by position and not by move. The two "N" moves result in positions with "fk 0", and the transposition is also caught.
  • id - game number in the new.pgn
  • fk - array of matching game numbers in repertoire.pgn
    Note that the first position matched both games in the repertoire.
  • fmvn - full move number in new.pgn.
    Note that for black moves this is "off by one" from the last move played.
  • fmvnmax - the largest "repertoire" full move number where the id-game in new.pgn matched any fk-game in repertoire.pgn

I could have output the sm opcode as well (supplied move), and for openings work this would have made it a little easier to scan the final epd.  I didn't do that because I'm actually planning to use epdcompare with endgame epd-files (not pgn-files). As it stands, you will probably have to open both new.pgn and cmp.epd at the same time and scan two files together. But since the OP asked about ChessBase, I assume the plan is: once the interesting new games are identified, merge by dragging them onto the appropriate game in the repertoire.
  

epdcompare_awk.txt ( 3 KB | 18 Downloads )
Back to top
 
IP Logged
 
JFugre
YaBB Newbies
*
Offline


I Love ChessPublishing!

Posts: 29
Joined: 01/22/19
Re: Filter games according to my repertoire
Reply #3 - 06/07/19 at 21:15:42
Post Tools
https://sjeng.org/dl/pgnannotate.exe (source: https://sjeng.org/dl/pgnannotate.py)

I wrote this a while ago to do exactly this. You need to have a PGN file with your repertoire. These can be games, variation trees, etc. Black and white repertoire should be together in one file.

Then the program goes over the games PGN and IF there are 2 or less moves known for a position, but ANOTHER move was played, it will add an annotation noting the "known move(s)".

My use case was to go over large collections of games played online and quickly check where I forgot my theory. It may be too restricted for you.
  
Back to top
 
IP Logged
 
Tartakaviar
YaBB Newbies
*
Offline


I Love ChessPublishing!

Posts: 2
Joined: 06/07/19
Re: Filter games according to my repertoire
Reply #2 - 06/07/19 at 15:44:50
Post Tools
brabo wrote on 06/07/19 at 12:52:16:
I don't believe there is a tool which does exactly what you want but you can get something very close to it.

In the recent versions of the Fritz interface you can ask to analyze a batch of games (so x number of games at once). You define the time of the analysis (I would put it as fast as possible in your case) and you also activate the openingreference function in which you specify in which database should be looked for the games.

If you have a hundred of your own games to check then I would let it run overnight so in the morning you have it ready. I know some players do that for their online blitzgames.

Thanks for this interesting answer. Fritz is cheaper than chessbase so i'll probably buy it. The functionality you describe seems very interesting and as you said close to my need but I will realize  and perfectly understand it as soon as I will experiment this functionality.
Thanks again !
  
Back to top
 
IP Logged
 
brabo
God Member
*****
Offline


Welcome chessfriend

Posts: 902
Joined: 02/02/07
Re: Filter games according to my repertoire
Reply #1 - 06/07/19 at 12:52:16
Post Tools
I don't believe there is a tool which does exactly what you want but you can get something very close to it.

In the recent versions of the Fritz interface you can ask to analyze a batch of games (so x number of games at once). You define the time of the analysis (I would put it as fast as possible in your case) and you also activate the openingreference function in which you specify in which database should be looked for the games.

If you have a hundred of your own games to check then I would let it run overnight so in the morning you have it ready. I know some players do that for their online blitzgames.
  
Back to top
WWW  
IP Logged
 
Tartakaviar
YaBB Newbies
*
Offline


I Love ChessPublishing!

Posts: 2
Joined: 06/07/19
Filter games according to my repertoire
06/07/19 at 10:44:19
Post Tools
Hello everyone,

Is there a tool - if possible a freeware - 
that from two repertoire databases for each color  (in Chessbase or PGN format)
filters all games of another database or PGN (the target base) that are in my repertoire.

Ideally I'd like to know from what move me or my opponent are "out" of the repertoire.
I have never managed to do that with Chessbase 8 (yes I know I date).
And I hesitate to buy a newer version of Chessbase.
Is there a version of Chessbase that manages to do it?

Thank you in advance for your help.
  
Back to top
 
IP Logged
 
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo