Changeset 206
- Timestamp:
- 11/17/06 21:15:33 (1 year ago)
- Files:
-
- 06/libkombilo/cpptest.cc (modified) (2 diffs)
- 06/libkombilo/process.py (modified) (2 diffs)
- 06/libkombilo/search.cc (modified) (1 diff)
- 06/libkombilo/testsearch.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
06/libkombilo/cpptest.cc
r203 r206 80 80 // for(vector<string>::iterator it = res.begin(); it != res.end(); it++) 81 81 // printf("%s\n", it->c_str()); 82 for(int i=0; i<gl.size(); i++) printf("%s\n", gl.currentEntryAsString(i).c_str());82 // for(int i=0; i<gl.size(); i++) printf("%s\n", gl.currentEntryAsString(i).c_str()); 83 83 84 84 // ------------------- print some statistics ------------------------------------------ … … 106 106 107 107 // ------------------- resetFormat ------------------------------------------ 108 printf("reset db\n");109 gl.resetFormat("pb");110 vector<string> res = gl.currentEntriesAsStrings(0, 40);111 for(vector<string>::iterator it = res.begin(); it != res.end(); it++)112 printf("%s\n", it->c_str());108 // printf("reset db\n"); 109 // gl.resetFormat("pb"); 110 // vector<string> res = gl.currentEntriesAsStrings(0, 40); 111 // for(vector<string>::iterator it = res.begin(); it != res.end(); it++) 112 // printf("%s\n", it->c_str()); 113 113 } 06/libkombilo/process.py
r195 r206 20 20 starttime = time.time() 21 21 try: 22 gl = GameList('t1.db', 'id', '') 22 pop = ProcessOptions() 23 # pop.algos = 0 24 # pop.rootNodeTags = 'PW,PB,RE,DT' 25 pop.sgfInDB = False 26 gl = GameList('t1.db', 'id', '', pop) 23 27 except DBError: 24 28 print 'Database error' … … 48 52 process(filelist) 49 53 54 # gl = GameList("t1.db", "id", "[[filename.]], ") 55 56 p = Pattern(CENTER_PATTERN, 19, 3, 5, ".X..OX.OX.OXOXO") 57 so = SearchOptions() 58 59 gl.reset() 60 gl.search(p, so) 61 62 for i in range(gl.size())[-10:]: 63 print gl.currentEntryAsString(i) 64 65 06/libkombilo/search.cc
r205 r206 4228 4228 4229 4229 if (p_op->sgfInDB) { 4230 rc = sqlite3_bind_text(ppStmt, stmt_ctr++, sgf, -1, SQLITE_TRANSIENT); 4230 if (c->root->numChildren == 1) rc = sqlite3_bind_text(ppStmt, stmt_ctr++, sgf, -1, SQLITE_TRANSIENT); 4231 else { 4232 string s= "("; 4233 s += c->outputVar(root); 4234 s+= ")"; 4235 rc = sqlite3_bind_text(ppStmt, stmt_ctr++, s.c_str(), -1, SQLITE_TRANSIENT); 4236 } 4231 4237 if (rc != SQLITE_OK) throw DBError(); 4232 4238 } 06/libkombilo/testsearch.py
r204 r206 7 7 8 8 start = time.time() 9 gl = GameList('t1.db' , 'PB')9 gl = GameList('t1.db') 10 10 end = time.time() 11 11 print gl.size(), 'games in the database' 12 print 'Opening the db took %.2f seconds.' % (end - start) 12 13 gl.gisearch("pw = 'Cho Chikun'") 13 14 print gl.size(), 'games in the database' 14 print 'This search took %.2f seconds.' % (end - start)15 15 16 16 p = Pattern(CENTER_PATTERN, 19, 3, 5, '.X.' + '.OX' + '.OX' + '.OX' + 'OXO') … … 19 19 gl.search(p, SearchOptions()) 20 20 end = time.time() 21 for i in range(gl.size()):22 print gl.currentEntryAsString(i)23 print gl.getCurrentProperty(i, 'EV')21 # for i in range(gl.size()): 22 # print gl.currentEntryAsString(i) 23 # print gl.getCurrentProperty(i, 'EV') 24 24 # print '\n'.join(gl.currentEntriesAsStrings()) 25 25 print gl.size(), 'games, ', gl.numHits(), 'hits.'
