well, if you plan to use RubyGo, I can easyly add a patch for you :->
jf
--
_________________________________________
/ do you play Go? \
|http://jeanfrancois.menon.free.fr/rubygo |
\ /
-----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
The best thing I can think of is to take Kombilo's SGF-parser which
can read in the full game and can output the main branch. You need
Python to get it all working. If you want it I have a simpler Python
program that does the same, but I know it might fail more often than
the Kombilo parser -- in theory, it has never let me down until now.
Jan van Rongen
Mace <mac...@yahoo.com> wrote:
--
-----------------------------------------
Richard Hunter, living in Tokyo (email: hunter at gol dot com)
This may be wrong, but I think the structure of the .sgf is like:
{
Header
(
Body
(variation1)
(variation2)
)
}
So any script that will delete the internal parantheticals should reduce it
to the main branch only.
SmartGo for Windows also includes a command to delete all the variations
(Edit > Delete Nodes > "Delete branches (keep main sequence)".
Anders Kierulf
www.smartgo.com
Mace,
Just one caution -- different SGF version (or SGF writers) use different
ordering for the variations. Sometimes the top line is the main
variation, sometimes not. But if you play through the games, then you
will be able to detect the main variation, and chop off the side
variations as you go.
Best,
Mike V
CGoban (1 and 2) can both delete variations with the "cut" button, but you
have to manually go to each variation and cut it out, so it isn't an
automatic process.
If you really want an automated system, download
http://www.igoweb.org/~wms/stripper.jar and run it with "java -jar
stripper.jar <in.sgf> <out.sgf>" (requires java 1.3). I just wrote it;
since I already had an SGF library, it was only about 20 lines of code.