Skip to content
/ sgfdb Public

package to read and write SGF databases (directory of directories of files)

Notifications You must be signed in to change notification settings

Ken1JF/sgfdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# File:		sgfdb/README

# Author:	Ken Friedenbach
# Copyright, 2009-2014. 
# All rights reserved
 
The sgfdb package consists of the following files:
	sgfdb - defines functions for reading and writing an SGF database,
        i.e. a directory of directories of .sgf files (such as GoGoD)
	
The GoGoD database of professional Go games is available for purchase from:
	http://www.gogod.co.uk/
and makes an excellent test database.

		ProcessDatabase and ProcessDirectory
		=====================================

These two functions, together with servers and channels provides a 
    framework which takes advantage of multiple processors and threads 
    in processing a database of SGF files.

The function ProcessDatabase uses ioutil.ReadDir to read the base
    directory. It then calls startServers, which sets up some communication 
    channels and starts two servers, a request server and result server. 
    ProcessDatabase then iterates through the directories, builds a request 
    for each sub-directory and sends each request to the request channel. 

        CountFilesAndMoves
        ==================
        
This function uses ProcessDatabase and ProcessDirectory to read
the files in the database, and the number of moves.

The result is a count of the number of directores and the number 
of files and nodes (semi-colons) in each directory.
		
		ReadAndWriteDatabase
		====================
	
ReadAndWriteDatabase calls ProcessDataBase with action functions WriteSGFFile, WriteSGFDirectory, and WriteSGFDatabase. ProcessDataBase iterates through directories in the Index directory, and calls the function ProcessDirectory. ProcessDirectory iterates through the .sgf files in each directory, calling ioutil.ReadFile.
The action functions call sgf.ParseFile to build a parse tree, and sgf.WriteFile to write a copy of each file in a copy of each 
    directory in the output directory.

There is a script, compareSGFs.txt, which is used to compare the 
    original SGF files to the ones written by sgf.WriteFile. It uses
    the program diffsgf which ignores white space.

		

About

package to read and write SGF databases (directory of directories of files)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages