I have been trying to merge polyglot chess opening databases. When merging databases with existing programs, if any move in a position already exist in the first file, new moves from same position will not be added from the next file.
Here is the problem: When two books (in bin-format) are merged with polyglot, it's expected that lines from both of them can be found in the new combined/merged one. This is not the case: the contents of the second entry are omitted:
[Event "?"] [Site "?"] [Date "2021.01.01"] [Number "1"] [White "?"] [Black "?"] [Result "1/2-1/2"] [ECO "B74"] [PlyCount "12"] 1. e4 c5 1/2-1/2
[Event "?"] [Site "?"] [Date "2021.01.01"] [Number "1"] [White "?"] [Black "?"] [Result "1/2-1/2"] [ECO "A00"] [PlyCount "12"] 1. g3 e5 1/2-1/2
polyglot make-book -pgn 1.pgn -min-game 1 -max-ply 12 -bin 1.bin polyglot make-book -pgn 2.pgn -min-game 1 -max-ply 12 -bin 2.bin polyglot merge-book -in1 1.bin -in2 2.bin -out combined.bin
g3 e5 entry gets scraped.
For reference, the above definition of the problem was described here: https://firstname.lastname@example.org/msg1798406.html
This is something I have found really annoying for a very long time. After years of frustration that there was no program that could properly merge chess polyglot database files with recalculation of weights, I eventually decided to learn how to make a program that could do that.
So, now I have written a program to merge chess opening polyglot database files with recalculation of weights and it solves this problem. I call it merge_polyglot.
But I don´t really have any clue what to do with it. Would others find this useful? Where would I post this program to make it available for other chess enthusiasts?