That's doable, but there are issues. For example, one parameter is the "min played" limit. For such comments it would likely have to be ignored since it is unlikely that such analysis would be included in many games. But if that is done, then many PGN games have crappy analysis included as well. Putting that into a book is also problematic...
Give some thought to those issues and then suggest something you think would work OK...
That's doable, but there are issues. For example, one parameter is the "min played" limit. For such comments it would likely have to be ignored since it is unlikely that such analysis would be included in many games. But if that is done, then many PGN games have crappy analysis included as well. Putting that into a book is also problematic...
Give some thought to those issues and then suggest something you think would work OK...
That should work. Grabbing comments can be ignored if the "minplayed" is >1.
If you don't use if("minplayed" <=1) it should grab any pv lines upto "maxply".
It can copy from "({ .... } to the )" & strip what isn't needed for the book creation,...
Else...
Add another variable at the end of book create 60 3... 1 for comments included, 0; default not included.
That's doable, but there are issues. For example, one parameter is the "min played" limit. For such comments it would likely have to be ignored since it is unlikely that such analysis would be included in many games. But if that is done, then many PGN games have crappy analysis included as well. Putting that into a book is also problematic...
Give some thought to those issues and then suggest something you think would work OK...
That should work. Grabbing comments can be ignored if the "minplayed" is >1.
If you don't use if("minplayed" <=1) it should grab any pv lines upto "maxply".
It can copy from "({ .... } to the )" & strip what isn't needed for the book creation,...
Else...
Add another variable at the end of book create 60 3... 1 for comments included, 0; default not included.
Is there any other problems?
Only other issue I can think of is the actual parsing, since comments can be nested. I have seen one that would choke a large mule with comments 14 levels deep. It is a pretty significant change, since encountering a PGN header resets the game to the initial position at present. This would need to back up to the previous position where analysis was found...
Only other issue I can think of is the actual parsing, since comments can be nested. I have seen one that would choke a large mule with comments 14 levels deep. It is a pretty significant change, since encountering a PGN header resets the game to the initial position at present. This would need to back up to the previous position where analysis was found...
Use the current header values or even the defaults, don't reset until you finish stepping through the comments and find no more comment identifiers such as "{(" and then the result_tag '*' at the end of PGN.
Count the steps and inc each time one is found and repeat until none are found.
count = 0;
while(!=result_tag){
If(comment) // find begin chars
grab(); //do your magic
count = count + 1; //line in pgn
step(); // your location
Only other issue I can think of is the actual parsing, since comments can be nested. I have seen one that would choke a large mule with comments 14 levels deep. It is a pretty significant change, since encountering a PGN header resets the game to the initial position at present. This would need to back up to the previous position where analysis was found...
Use the current header values or even the defaults, don't reset until you finish stepping through the comments and find no more comment identifiers such as "{(" and then the result_tag '*' at the end of PGN.
Count the steps and inc each time one is found and repeat until none are found.
count = 0;
while(!=result_tag){
If(comment) // find begin chars
grab(); //do your magic
count = count + 1; //line in pgn
step(); // your location
if(result_tag)
reset();
}
next_pgn();
That's not my point. When I find a line starting with "[" I simply reset the game to the starting position and then search for the result tag followed by the first move. This requires more complex code, as I have to remember the point where a "branch" (alternate analyis) starts and when I get to the end, back up to that point. But it has to be "stacked" because nested analysis is perfectly allowable in PGN. Makes the parsing a lot more complicated. Might be easier to write something to eat a PGN file and expand a single game into many games by unnesting the analysis comments...
Only other issue I can think of is the actual parsing, since comments can be nested. I have seen one that would choke a large mule with comments 14 levels deep. It is a pretty significant change, since encountering a PGN header resets the game to the initial position at present. This would need to back up to the previous position where analysis was found...
Use the current header values or even the defaults, don't reset until you finish stepping through the comments and find no more comment identifiers such as "{(" and then the result_tag '*' at the end of PGN.
Count the steps and inc each time one is found and repeat until none are found.
count = 0;
while(!=result_tag){
If(comment) // find begin chars
grab(); //do your magic
count = count + 1; //line in pgn
step(); // your location
if(result_tag)
reset();
}
next_pgn();
That's not my point. When I find a line starting with "[" I simply reset the game to the starting position and then search for the result tag followed by the first move. This requires more complex code, as I have to remember the point where a "branch" (alternate analyis) starts and when I get to the end, back up to that point. But it has to be "stacked" because nested analysis is perfectly allowable in PGN. Makes the parsing a lot more complicated. Might be easier to write something to eat a PGN file and expand a single game into many games by unnesting the analysis comments...
If I remember right, the Fritz4 book was a single, nested PGN game.
Only other issue I can think of is the actual parsing, since comments can be nested. I have seen one that would choke a large mule with comments 14 levels deep. It is a pretty significant change, since encountering a PGN header resets the game to the initial position at present. This would need to back up to the previous position where analysis was found...
Use the current header values or even the defaults, don't reset until you finish stepping through the comments and find no more comment identifiers such as "{(" and then the result_tag '*' at the end of PGN.
Count the steps and inc each time one is found and repeat until none are found.
count = 0;
while(!=result_tag){
If(comment) // find begin chars
grab(); //do your magic
count = count + 1; //line in pgn
step(); // your location
if(result_tag)
reset();
}
next_pgn();
That's not my point. When I find a line starting with "[" I simply reset the game to the starting position and then search for the result tag followed by the first move. This requires more complex code, as I have to remember the point where a "branch" (alternate analyis) starts and when I get to the end, back up to that point. But it has to be "stacked" because nested analysis is perfectly allowable in PGN. Makes the parsing a lot more complicated. Might be easier to write something to eat a PGN file and expand a single game into many games by unnesting the analysis comments...
Also you wouldn't introduce a bug into your regular code trying to handle some special case.
Only other issue I can think of is the actual parsing, since comments can be nested. I have seen one that would choke a large mule with comments 14 levels deep. It is a pretty significant change, since encountering a PGN header resets the game to the initial position at present. This would need to back up to the previous position where analysis was found...
Use the current header values or even the defaults, don't reset until you finish stepping through the comments and find no more comment identifiers such as "{(" and then the result_tag '*' at the end of PGN.
Count the steps and inc each time one is found and repeat until none are found.
count = 0;
while(!=result_tag){
If(comment) // find begin chars
grab(); //do your magic
count = count + 1; //line in pgn
step(); // your location
if(result_tag)
reset();
}
next_pgn();
That's not my point. When I find a line starting with "[" I simply reset the game to the starting position and then search for the result tag followed by the first move. This requires more complex code, as I have to remember the point where a "branch" (alternate analyis) starts and when I get to the end, back up to that point. But it has to be "stacked" because nested analysis is perfectly allowable in PGN. Makes the parsing a lot more complicated. Might be easier to write something to eat a PGN file and expand a single game into many games by unnesting the analysis comments...
Yes, of course...
When you start... "["
Then the first move....
(By result_tag, I was thinking the end of the pgn, not the actual tag header...)
Only other issue I can think of is the actual parsing, since comments can be nested. I have seen one that would choke a large mule with comments 14 levels deep. It is a pretty significant change, since encountering a PGN header resets the game to the initial position at present. This would need to back up to the previous position where analysis was found...
Use the current header values or even the defaults, don't reset until you finish stepping through the comments and find no more comment identifiers such as "{(" and then the result_tag '*' at the end of PGN.
Count the steps and inc each time one is found and repeat until none are found.
count = 0;
while(!=result_tag){
If(comment) // find begin chars
grab(); //do your magic
count = count + 1; //line in pgn
step(); // your location
if(result_tag)
reset();
}
next_pgn();
That's not my point. When I find a line starting with "[" I simply reset the game to the starting position and then search for the result tag followed by the first move. This requires more complex code, as I have to remember the point where a "branch" (alternate analyis) starts and when I get to the end, back up to that point. But it has to be "stacked" because nested analysis is perfectly allowable in PGN. Makes the parsing a lot more complicated. Might be easier to write something to eat a PGN file and expand a single game into many games by unnesting the analysis comments...
If I remember right, the Fritz4 book was a single, nested PGN game.
That's probably because, in the Chessbase GUI, you're able to analyze a game, and all the comments are imported into the book, from the PGN. Which is what this would do...