20.01.2013 Views

Kombilo Documentation Release 0.7.4 Ulrich Goertz - Bitbucket

Kombilo Documentation Release 0.7.4 Ulrich Goertz - Bitbucket

Kombilo Documentation Release 0.7.4 Ulrich Goertz - Bitbucket

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

getTags(index)<br />

Get all tags of the game at position index in the current list.<br />

<strong>Kombilo</strong> <strong>Documentation</strong>, <strong>Release</strong> <strong>0.7.4</strong><br />

get_data(i, showTags=True)<br />

Return entry in line i of current list of games (as it appears in the <strong>Kombilo</strong> game list window).<br />

importTags(filename)<br />

The file given by filename should be a file to which previously tags have been exported using<br />

exportTags().<br />

This method imports all the tags into the current databases. The games are identified by the Dyer signature<br />

together with a hash value of their final position. So unless there are duplicates in the database, this should<br />

put the tags on those games where they were before exporting. In case of duplicates, all duplicates will<br />

receive the corresponding tags.<br />

listOfCurrentSGFFiles()<br />

Return a list of file names for all SGF files of games in the current list of games.<br />

noOfGames()<br />

Return the number of games in the current list of games.<br />

noOfHits()<br />

Return the number of hits for the last pattern search.<br />

noOfSwitched()<br />

Return the number of hits where the colors are reversed for the last pattern search.<br />

populateDBlist(d)<br />

Add the databases specified in the dictionary d to this GameList. d must have the following format:<br />

For each key k, d[k] is a list of three entries. The first entry is the sgfpath, i.e. the path where the SGF<br />

files of this database are stored. The second entry is the path where the <strong>Kombilo</strong> database files are stored,<br />

and the third entry is the name of these database files, without the extension.<br />

The keys are assumed to be strings. If‘‘k‘‘ ends with ‘disabled’, then the disabled flag will be set for the<br />

corresponding database.<br />

After adding the databases in this way, you must call KEngine.loadDBs() to load the database files.<br />

printGameInfo(index)<br />

Return a pair whose first entry is a string containing the game info for the game at index. The second entry<br />

is a string giving the reference to commentaries in the literature, if available.<br />

printSignature(index)<br />

Return the symmetrized Dyer signature of the game at index in the current list of games.<br />

reset()<br />

Reset the list, s.t. it includes all the games from self.data.<br />

class kombiloNG.KEngine<br />

This is the class which you use to use the <strong>Kombilo</strong> search functionality.<br />

After instantiating it, you need to tell the gamelist which databases you want to use, e.g. using<br />

GameList.populateDBlist(), and then call loadDBs(). Afterwards you can use<br />

patternSearch(), for instance.<br />

See the <strong>Kombilo</strong> documentation on further information how to get started.<br />

Further notes.<br />

After a pattern search, the continuations are assembled into the list self.continuations, whose entries are<br />

lists [ total number of hits, x-coordinate in currentSearchPattern, y-coordinate in currentSearchPattern, number<br />

of black continuations, number of black wins after black play here, number of black losses after black play here,<br />

4.3. API 41

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!