Opening books format

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
beachknight
Posts: 3533
Joined: Tue Jan 09, 2007 7:33 pm
Location: Antalya, Turkey
Contact:

Re: Opening books format

Post by beachknight » Wed Apr 16, 2008 6:53 pm

Is there any executable that takes *.abk book as input
and produce *.pgn as output.

I'd be glad to have such a tool.

Best to you,
hi, merhaba, hallo HT

User avatar
beachknight
Posts: 3533
Joined: Tue Jan 09, 2007 7:33 pm
Location: Antalya, Turkey
Contact:

Re: Opening books format

Post by beachknight » Wed Apr 16, 2008 7:39 pm

OS: WinXPSP2

Best!
hi, merhaba, hallo HT

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Opening books format

Post by Jim Ablett » Thu Apr 17, 2008 12:07 am

beachknight wrote:Is there any executable that takes *.abk book as input
and produce *.pgn as output.

I'd be glad to have such a tool.

Best to you,
Here's the compiled windows exe 'abk2pgn.exe' from Dann's modified src.
Works fine, but output still needs a little bit of post-processing
with pgn-extract/pgntrim.

http://www.zshare.net/download/10653257fcb8f902/

Jim.

CThinker
Posts: 388
Joined: Wed Mar 08, 2006 9:08 pm
Contact:

Re: Opening books format

Post by CThinker » Thu Apr 17, 2008 5:02 am

One more modification...

Replace this:

Code: Select all

    if (move_promo)
        fprintf(ft, "Q");       // allways queen: this is incorrect 
with this:

Code: Select all

    if (move_promo) {
        static const char prm[] = "RNBQ";
        fprintf(ft, "%c", prm[abs(move_promo)-1]);
    }

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Opening books format

Post by Jim Ablett » Thu Apr 17, 2008 8:07 am

CThinker wrote:One more modification...

Replace this:

Code: Select all

    if (move_promo)
        fprintf(ft, "Q");       // allways queen: this is incorrect 
with this:

Code: Select all

    if (move_promo) {
        static const char prm[] = "RNBQ";
        fprintf(ft, "%c", prm[abs(move_promo)-1]);
    }
abk2pgn with Lance Perkins mod

http://www.zshare.net/download/106703053e39962e/

For cleaning up pgns I created a little batch script for my personal use
which run a series of pgn tools one after the other automatically (saves a lot of typing on the command line).

http://www.zshare.net/download/1067058909ff22e0/

This what it does automatically >
To clean/normalize and process a pgn file

Step 1: Backup original pgn file.
Step 2: 'Pgn-Extract' to remove duplicates.
Step 3: 'CleanTag' to remove erroneous tags.
Step 4: 'Trim' to correctly re-format pgn file.
Step 5: 'PgnMan' to add ECO to openings.
Step 6: 'AddElo' to fill in missing Elo tags.
Step 7: 'CleanUp' to remove incorrect null values.
Step 8: 'NameList' to produce player stats file.
Step 9: 'Ratelist' to produce player elo stats file

Step 10: Output completed/processed pgn 'processed.pgn' and stats files.


On the command line type:
-----------------------------------------------

process <name of pgn file>

EXAMPLE:

process anand.pgn


When completed directory will additionally contain >

1. processed.pgn - the fully cleaned/normalized/processed pgn file.
2. Ratelist.txt - Ratings list of all players contained in the pgn.
3. Namelist.txt - List of all players contained in the pgn.
Jim.

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Opening books format

Post by Jim Ablett » Thu Apr 17, 2008 8:32 am

On the command line type:
-----------------------------------------------

process <name of pgn file>

EXAMPLE:

process anand.pgn
Small amendment to that. The don't have to type the name of the pgn.
Just drop the pgn into the folder and type process

Jim.

User avatar
beachknight
Posts: 3533
Joined: Tue Jan 09, 2007 7:33 pm
Location: Antalya, Turkey
Contact:

Re: Opening books format

Post by beachknight » Thu Apr 17, 2008 3:07 pm

Thanks Jim.

I'll try them out.

Best to yoU!
hi, merhaba, hallo HT

Jimbo I
Posts: 144
Joined: Thu Feb 15, 2007 3:34 am
Location: USA

Re: Opening books format

Post by Jimbo I » Sat Dec 26, 2009 4:48 pm

Jim Ablett wrote:
CThinker wrote:One more modification...

Replace this:

Code: Select all

    if &#40;move_promo&#41;
        fprintf&#40;ft, "Q");       // allways queen&#58; this is incorrect 
with this:

Code: Select all

    if &#40;move_promo&#41; &#123;
        static const char prm&#91;&#93; = "RNBQ";
        fprintf&#40;ft, "%c", prm&#91;abs&#40;move_promo&#41;-1&#93;);
    &#125;
abk2pgn with Lance Perkins mod

http://www.zshare.net/download/106703053e39962e/

For cleaning up pgns I created a little batch script for my personal use
which run a series of pgn tools one after the other automatically (saves a lot of typing on the command line).

http://www.zshare.net/download/1067058909ff22e0/

This what it does automatically >
To clean/normalize and process a pgn file

Step 1: Backup original pgn file.
Step 2: 'Pgn-Extract' to remove duplicates.
Step 3: 'CleanTag' to remove erroneous tags.
Step 4: 'Trim' to correctly re-format pgn file.
Step 5: 'PgnMan' to add ECO to openings.
Step 6: 'AddElo' to fill in missing Elo tags.
Step 7: 'CleanUp' to remove incorrect null values.
Step 8: 'NameList' to produce player stats file.
Step 9: 'Ratelist' to produce player elo stats file

Step 10: Output completed/processed pgn 'processed.pgn' and stats files.


On the command line type:
-----------------------------------------------

process <name of pgn file>

EXAMPLE:

process anand.pgn


When completed directory will additionally contain >

1. processed.pgn - the fully cleaned/normalized/processed pgn file.
2. Ratelist.txt - Ratings list of all players contained in the pgn.
3. Namelist.txt - List of all players contained in the pgn.
Jim.
Hi Jim,
I stumbled across this thread and was wanting to try out your abk2pgn compile with the Lance Perkins mod, but it seems the link has expired. Would it be possible for you to repost a new link so I can download it to play with? Thanks.

User avatar
Jim Ablett
Posts: 1327
Joined: Fri Jul 14, 2006 5:56 am
Location: London, England
Contact:

Re: Opening books format

Post by Jim Ablett » Sat Dec 26, 2009 5:24 pm

Jimbo I wrote:
Jim Ablett wrote:
CThinker wrote:One more modification...

Replace this:

Code: Select all

    if &#40;move_promo&#41;
        fprintf&#40;ft, "Q");       // allways queen&#58; this is incorrect 
with this:

Code: Select all

    if &#40;move_promo&#41; &#123;
        static const char prm&#91;&#93; = "RNBQ";
        fprintf&#40;ft, "%c", prm&#91;abs&#40;move_promo&#41;-1&#93;);
    &#125;
abk2pgn with Lance Perkins mod

http://www.zshare.net/download/106703053e39962e/

For cleaning up pgns I created a little batch script for my personal use
which run a series of pgn tools one after the other automatically (saves a lot of typing on the command line).

http://www.zshare.net/download/1067058909ff22e0/

This what it does automatically >
To clean/normalize and process a pgn file

Step 1: Backup original pgn file.
Step 2: 'Pgn-Extract' to remove duplicates.
Step 3: 'CleanTag' to remove erroneous tags.
Step 4: 'Trim' to correctly re-format pgn file.
Step 5: 'PgnMan' to add ECO to openings.
Step 6: 'AddElo' to fill in missing Elo tags.
Step 7: 'CleanUp' to remove incorrect null values.
Step 8: 'NameList' to produce player stats file.
Step 9: 'Ratelist' to produce player elo stats file

Step 10: Output completed/processed pgn 'processed.pgn' and stats files.


On the command line type:
-----------------------------------------------

process <name of pgn file>

EXAMPLE:

process anand.pgn


When completed directory will additionally contain >

1. processed.pgn - the fully cleaned/normalized/processed pgn file.
2. Ratelist.txt - Ratings list of all players contained in the pgn.
3. Namelist.txt - List of all players contained in the pgn.
Jim.
Hi Jim,
I stumbled across this thread and was wanting to try out your abk2pgn compile with the Lance Perkins mod, but it seems the link has expired. Would it be possible for you to repost a new link so I can download it to play with? Thanks.
New link - abk2pgn (Lance Perkins mod)
Download:
http://www.mediafire.com/?nt2jvxzmttz

Jim.

Jimbo I
Posts: 144
Joined: Thu Feb 15, 2007 3:34 am
Location: USA

Re: Opening books format

Post by Jimbo I » Sat Dec 26, 2009 5:33 pm

Many thanks, Jim!

:D

Post Reply