libkombilo
0.8
|
#include <vector>
#include <utility>
#include <stack>
#include <fstream>
#include "sqlite3.h"
#include "pstdint.h"
#include <boost/unordered_map.hpp>
#include "abstractboard.h"
#include "sgfparser.h"
#include "algos.h"
Go to the source code of this file.
Data Structures | |
class | ProcessOptions |
class | SearchOptions |
class | GameListEntry |
class | VarInfo |
class | GameList |
The GameList class is the main interface to the libkombilo functionality. More... | |
Functions | |
std::map< std::string, std::vector< int > > | find_duplicates (std::vector< string > glists, bool strict=false, bool dupl_within_db=false) throw (DBError) |
Variables | |
const int | HANDI_TAG = 1 |
const int | PROFESSIONAL_TAG = 2 |
process flags | |
(used to determine the behavior for individual games - in contrast to options which apply to the whole GameList and are given in ProcessOptions) Combine via bitwise OR. | |
const int | CHECK_FOR_DUPLICATES = 1 |
check for duplicates using the signature | |
const int | CHECK_FOR_DUPLICATES_STRICT = 2 |
check for duplicates using the final position (if ALGO_FINAPOS is available) | |
const int | OMIT_DUPLICATES = 4 |
Omit games recognized as duplicates from the database. | |
const int | OMIT_GAMES_WITH_SGF_ERRORS = 8 |
process return values | |
0: SGF error occurred when parsing the "tree structure" (i.e. before parsing the individual nodes) database was not changed n>0: n games were processed, use process_results to access the individual results | |
const int | UNACCEPTABLE_BOARDSIZE = 1 |
const int | SGF_ERROR = 2 |
const int | IS_DUPLICATE = 4 |
const int | NOT_INSERTED_INTO_DB = 8 |
const int | INDEX_OUT_OF_RANGE = 16 |
part of libkombilo, http://www.u-go.net/kombilo/
Copyright (c) 2006-12 Ulrich Goertz ug@ge omet ry.de
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
std::map<std::string, std::vector<int> > find_duplicates | ( | std::vector< string > | glists, |
bool | strict = false , |
||
bool | dupl_within_db = false |
||
) | |||
throw | ( | DBError | |
) |
To find duplicates, pass a list of GameList instances (by specifying the file names of their .db files in a vector of strings) to this method. You can also specify whether the duplicate checks should be strict, and whether duplicates within the individual GameList instances should also be found, or whether only duplicates "spanning" at least two dbs should be found.
The function returns a map<string, vector<int> > whose keys are game signatures, and for each signature, a list of duplicates with this signature. This list is in the form db_id1, game_id1, db_id2, game_id2, ...; here db_id is the place within the glists vector which was passed to find_duplicates, and game_id is the id within the gamelist db_id.
const int SGF_ERROR = 2 |
SGF error occurred when playing through the game (and the rest of the concerning variation was not used). Depending on OMIT_GAMES_WITH_SGF_ERRORS, everything before this node (and other variations, if any) was inserted, or the database was not changed.