SGF Organising Utilities

    Keywords: Software

As a result of a discussion on rec.games.go kicked off by Michael Lowe? I wrote a quick perl program, and thought it would be a good idea to collect SGF Utilities here on Sensei's Library.

Table of contents

SGF to SGF

Filters that remove information

CommentFilter by Chris Goldsmith

To start the ball rolling here is the quick program I wrote to filter comments (chatter) out of SGF files, it currently is focussed at files downloaded off of KGS, but can easily be adapted to handle other go servers.

removeTag

Here is another perl program, this one removes any sgf properties you don't want, and empty comment nodes too.

[ext] KibitzCleaner by Blubb Fallo

This is a very small Python script similar to CommentFilter, but also capable of filtering based on players' ranks.

The link to sourceforge is dead.

Smartgo

Smartgo allows editing of sgf files. It can remove any specified attribute (also comments) from an sgf file. It also allows changing the main line or removing branching from sgf files. It can create diagrams from sgf files.

[ext] SGFC - Removing Comments and more

Dieter: Has someone written a tool which extracts comments from sgf-files into text-files ? As the editor of the Belgian magazine, this would considerably reduce the workload of converting contributed commented games to articles in Gowrite.

(Sebastian:) Yes, our very own Arno has written a tool that does this and much more: [ext] SGFC - all you need to do is check the "delete property" box and enter "C" for "comment" in the text box like this:
http://www.seedwiki.com/Accounts/Helm_Sebastian_8957/sgfc.png

LauriPaatero: in GOWrite 2 (2.1.x) you can export game in graphics and HTML. Result is HTML file with comments and links to graphics (EPS or PNG).

Filters that add or merge information

Soksoo Database

eats many sgf files and saves the corner play sequences (joseki and similar) to a new sgf

SGF Merge Trees

Such a tool would be able to merge multiple games into a single tree (same moves must be merged into one node, comments concatenated, conflicting properties detected and warnings displayed ...).

[ext] http://www.igoweb.org/~wms/comp/sgfMerger/

Dieter: I tested this and it works!

% == SGF Batch Processing (handling multiple files). ==
%
% (add heading again, if you add such a tool)

SGF Collection Tools

Proposal:

Since sgf allows multiple games in one file (sgf collection), there should be a tool to manage such collections (and since most editors support only one sgf tree per file it should be a external tool). It should allow to:

  • show a list with all games (with general properties like PB, PW, RB, RW, ...)
  • open one game in game-specific editor (by GM property) by saving it to temporary file
  • if the temporary file is edited, it can be integrated back into the collection (just remember positions of '(;' and ')' to modify the block); backup file needs to be created

The parser would be pretty simple, compared to full sgf parsing (just skip most parts ...).
The whole tool should be game independent (not just Go).

willemien for go only games collections: SmartGo can do this. I am not sure about Drago

SGF Tree to SGF collection tool

willemien I wrote a very basic tool that takes an SGF tree and transforms it into a Sgf collection. (Every path from the root to a leaf/ end node becomes a new game) I am not a great programmer (and the program fails sometimes, but it would be a good idea if somebode(who is better in programming than me) writes a foolproof version.

SGF Statistics

MtnViewMark: I have recently taken Arno's sgfc source and build a program that processes collections of SGF files and produces statistics on property and value usage. The [ext] source is available.

I ran it over about five thousand SGF files from the GoDatabases page and all five thousand problems from GoProblemsCom with interesting results:

  • Other than text comments (C and N), move and node annotation is basically never used.
  • The graphic markup (AR, LN, and DD, is never used. Nor is SL.
  • The character set (CA), if ever specified, is almost always UTF-8.

Full details are available: [ext] game-stats.txt and [ext] problem-stats.txt

Yes - I realize this isn't quite the right place in the library for this info... open to suggestions!

Other Formats to SGF

SGF to Other

[ext] Peter Strempel's Format Conversion Utilities

[ext] SGFtoKifu

SGFtoKifu is a program for generating images containing kifu diagrams from SGF files. It is especially useful if you want to print a game you have in this format to review in a real board.

Diverse to SGF

Image to SGF:

GoCam

CompoGo

CompoGo [ext] (CompoGo homepage) eats a picture and gives a diagram to save as SGF file

Chris Ball's [ext] image2sgf

[ext] Go Tracer

Text to SGF

  • [ext] JText2Sgfs is a Java program, that eats text files (e.g. a Mozilla mailbox), extracts sgf-data and saves them to SGF files.
  • The same did SplitGo (for Java) by Ray Tayek. This program disappeared from the net.
  • A tool to convert a text diagram from rgg to SGF (there is at least one)?

==See also ==


This is a copy of the living page "SGF Organising Utilities" at Sensei's Library.
(OC) 2011 the Authors, published under the OpenContent License V1.0.
[Welcome to Sensei's Library!]
StartingPoints
ReferenceSection
About