bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] sgf file format


From: Joern Thyssen
Subject: Re: [Bug-gnubg] sgf file format
Date: Fri, 1 Aug 2003 07:39:30 +0000
User-agent: Mutt/1.4.1i

On Thu, Jul 31, 2003 at 09:22:13PM +0200, address@hidden wrote
> I want to write some scripts to extract information from a
> (large) collection of sgf files representing a series of matches.
> 
> For each sgf file I'd like to extract:
> 
> who won
> relative FIBS rating
> av. error rate per move for each player

There is no simple way to extract any of these, since all numbers are
derived from the content of the SGF file. 

(1) who won:

look for RE[ .. ]

(2) and (3):

look for GS[ .. ]. The GS includes all the match
statistics including total error rate and the different number of moves.
There is a GS[ .. ] for each game, so you'll have to sum these, and
calculate the final error rate per move.

The relative FIBS rating was calculated from the error rate per move.
You find the formula in the gnubg source code (analysis.c, look for
relativeFibsRating).


I'm not familiar with scripting facilities on windows, but it may be
easier to do something like this:

gnubg -t << EOF >> output
load match xxx000.sgf
show stat match
EOF

epm= `grep 'Error rate blah blah' output | "strip unwanted chars"`
who= `grep 'Actual blah blah' output | "strip unwanted chars"'
fr=`grep 'Relative FIBS`output | "strip unwanted chars"'

echo epm, who, fr

Jørn




reply via email to

[Prev in Thread] Current Thread [Next in Thread]