On Tue, Oct 14, 2025 at 07:05:07PM +0200, Francesco Ariis wrote:

>     I want to know more about private properties gnubg uses to
> write .sgf files.

> My goal is to import _analysed_ backgammon matches and then filter
> positions for cube and chequer errors.
> 
> SGF/gnubg documentation was quite useful to get a working parser up and
> running, but these properties are not documented as far as I can see:
> 
> - GS        -> Game stats
> - A         -> Analysis (chequer?)
> - MR        -> ???
> - LU        -> Luck analysis.
> 
> There are some hints in `sgf.h` [1], but nothing precise.
> 
> Is there any kind of explanation of those somewhere, or should I just
> check the code to know more?

MR indicates that the move has been marked with the Cmark GUI command 
(presumably to roll it out in a batch or to browse interesting moves 
quickly, jumping to cmarked move to cmarked move.

The other records are what you guessed but contain more complex data for 
which the code in sgf.c is probably the only documentation...


That said, parsing the sgf file is probably not the easiest way to get 
what you look for. You should consider using the embedded python 
interpreter from the CLI.

If you have loaded a match, the gnubg.match() function will return a 
data structure containing all the information available.

A "help(gnubg.match)" may look impressive with its:
...
    returns: dictionary of match info:
       'games' => list of dictionaries, one per game
...
         'game'=>list of dictionaries, one per move
...
              'moves'=>list of dictionaries, one per analysed move
...
plus a lot of other layered data
 
but, even if you want to process this with another language and are not 
familiar with python, learning its basics to dump what interests you in 
a format that suits you will almost certainly be easier than getting it 
directly from the sgf file.

Reply via email to