Changeset 184
- Timestamp:
- 09/25/06 21:51:33 (2 years ago)
- Files:
-
- 06/libkombilo/cpptest.cc (modified) (1 diff)
- 06/libkombilo/search.cc (modified) (1 diff)
- 06/libkombilo/search.h (modified) (1 diff)
- 06/libkombilo/sgfparser.cc (modified) (2 diffs)
- 06/libkombilo/sgfparser.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
06/libkombilo/cpptest.cc
r183 r184 1 #include <fstream> 2 #include <string> 3 #include "boost/filesystem/operations.hpp" 1 4 #include "search.h" 5 6 using namespace boost::filesystem; 2 7 3 8 int main() { 4 9 GameList gl("t1.db", "id", "[[PW]] - [[PB]] ([[winner]]), [[filename.]]", ALGO_FINALPOS | ALGO_MOVELIST | ALGO_HASH_FULL, 19); 10 11 gl.start_processing(); 12 13 directory_iterator end_itr; 14 string path = "/home/ug/go/gogod06/1999"; 15 for(directory_iterator it(path); it != end_itr; ++it) { 16 string n = it->string(); 17 if (n.substr(n.size()-4) == ".sgf") { 18 ifstream infile; 19 infile.open(it->native_file_string().c_str()); 20 21 string sgf; 22 string line; 23 while (!infile.eof()) { 24 getline(infile, line); 25 sgf += line; 26 } 27 infile.close(); 28 gl.process(sgf.c_str(), path.c_str(), n.c_str()); 29 } 30 } 31 gl.finalize_processing(); 32 printf("Processed %d games.\n", gl.size()); 33 5 34 // gl.gisearch("pw = 'Hane Naoki'"); 6 //Pattern p(CENTER_PATTERN, 19, 3, 5, ".X..OX.OX.OXOXO") ;7 vector<MoveNC> contList;8 contList.push_back(MoveNC(6,15,'X'));9 contList.push_back(MoveNC(6,13,'O'));10 contList.push_back(MoveNC(4,15,'X'));11 Pattern p(FULLBOARD_PATTERN, 19, 19, 19, ".....................O.O........OX......XO......X.OXX.XX...X,.OOXXX..OOOX.O....X.OXOOXOO..OX.......XOXXOXXOOXXOO....OX.XXXOOOXO.O.O...OXX..XOX..XO.X.XO...O.......X.....XO..O.,X....,.....XOO................X......X............X....O...........................................O.O...........O.....,.....X...........X.O.X............................................", contList);35 Pattern p(CENTER_PATTERN, 19, 3, 5, ".X..OX.OX.OXOXO") ; 36 // vector<MoveNC> contList; 37 // contList.push_back(MoveNC(6,15,'X')); 38 // contList.push_back(MoveNC(6,13,'O')); 39 // contList.push_back(MoveNC(4,15,'X')); 40 // Pattern p(FULLBOARD_PATTERN, 19, 19, 19, ".....................O.O........OX......XO......X.OXX.XX...X,.OOXXX..OOOX.O....X.OXOOXOO..OX.......XOXXOXXOOXXOO....OX.XXXOOOXO.O.O...OXX..XOX..XO.X.XO...O.......X.....XO..O.,X....,.....XOO................X......X............X....O...........................................O.O...........O.....,.....X...........X.O.X............................................", contList); 12 41 SearchOptions so; 13 42 gl.search(p, so); 06/libkombilo/search.cc
r183 r184 2955 2955 2956 2956 2957 int GameList::process(c har* sgf, char* path,char* fn) throw(SGFError,DBError) {2957 int GameList::process(const char* sgf, const char* path, const char* fn) throw(SGFError,DBError) { 2958 2958 2959 2959 Cursor c = Cursor(sgf, 1); // parse sgf sloppily 06/libkombilo/search.h
r183 r184 458 458 459 459 void start_processing() throw(DBError); 460 int process(c har* sgf, char* path,char* fn) throw(SGFError,DBError);460 int process(const char* sgf, const char* path, const char* fn) throw(SGFError,DBError); 461 461 void finalize_processing() throw(DBError); 462 462 06/libkombilo/sgfparser.cc
r183 r184 382 382 int Node::sloppy = 1; 383 383 384 Cursor::Cursor(c har* sgf, int sloppy) throw(SGFError) {384 Cursor::Cursor(const char* sgf, int sloppy) throw(SGFError) { 385 385 Node::sloppy = sloppy; 386 386 … … 412 412 } 413 413 414 void Cursor::parse(c har* s) throw(SGFError) {414 void Cursor::parse(const char* s) throw(SGFError) { 415 415 416 416 Node* curr = root; 06/libkombilo/sgfparser.h
r183 r184 107 107 class Cursor { 108 108 public: 109 Cursor(c har* sgf, int sloppy) throw(SGFError);109 Cursor(const char* sgf, int sloppy) throw(SGFError); 110 110 ~Cursor(); 111 111 … … 120 120 121 121 int noChildren(); 122 void parse(c har* s) throw(SGFError);122 void parse(const char* s) throw(SGFError); 123 123 void game(int n) throw(SGFError); 124 124 void next(int n=0) throw(SGFError);
