Skip to content

Commit 65b5736

Browse files
committed
Added longer opening databases
1 parent 9f05d73 commit 65b5736

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

notebooks/opening.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@
6969
},
7070
{
7171
"cell_type": "code",
72-
"execution_count": 4,
72+
"execution_count": 6,
7373
"metadata": {},
7474
"outputs": [
7575
{
7676
"data": {
7777
"application/vnd.jupyter.widget-view+json": {
78-
"model_id": "90dac59551bc41bd80b1fc51c3af2859",
78+
"model_id": "4c247aa8f4f340898bccfd5db6d07eb3",
7979
"version_major": 2,
8080
"version_minor": 0
8181
},
@@ -90,23 +90,23 @@
9090
"name": "stderr",
9191
"output_type": "stream",
9292
"text": [
93-
"illegal san: 'Qxe1' in r2k3r/2pPp3/p4n2/3b2B1/1p5P/2qP4/3RQ1P1/4K2R w - - 2 31 while parsing <Game at 0x7817c72654c0 ('Gelfand,B' vs. 'Gareev,T', '2019.12.29' at 'Moscow RUS')>\n",
94-
"illegal san: 'Bf3' in 6k1/pb3r1p/1q4p1/6Q1/2p1rb2/3p3P/PP1R2P1/2BR1N1K w - - 8 38 while parsing <Game at 0x7817b63cce00 ('Schleining,Z' vs. 'Paehtz,E', '2014.11.23' at 'Dresden GER')>\n"
93+
"illegal san: 'Qxe1' in r2k3r/2pPp3/p4n2/3b2B1/1p5P/2qP4/3RQ1P1/4K2R w - - 2 31 while parsing <Game at 0x76fa22f0d220 ('Gelfand,B' vs. 'Gareev,T', '2019.12.29' at 'Moscow RUS')>\n",
94+
"illegal san: 'Bf3' in 6k1/pb3r1p/1q4p1/6Q1/2p1rb2/3p3P/PP1R2P1/2BR1N1K w - - 8 38 while parsing <Game at 0x76fa2c2003e0 ('Schleining,Z' vs. 'Paehtz,E', '2014.11.23' at 'Dresden GER')>\n"
9595
]
9696
},
9797
{
9898
"name": "stdout",
9999
"output_type": "stream",
100100
"text": [
101-
"Number of moves: 10600083\n",
102-
"DB size: 2725291\n"
101+
"Number of moves: 8589441\n",
102+
"DB size: 1479274\n"
103103
]
104104
}
105105
],
106106
"source": [
107107
"root = {'move': 'root', 'count': 0, 'children': {}}\n",
108108
"\n",
109-
"halfLimit = 20\n",
109+
"halfLimit = 16\n",
110110
"movesSeen, dbSize = 0, 0\n",
111111
"for file_name in tqdm(os.listdir(output_dir)):\n",
112112
" if file_name.endswith(\".pgn\"):\n",
@@ -133,7 +133,7 @@
133133
},
134134
{
135135
"cell_type": "code",
136-
"execution_count": 6,
136+
"execution_count": 7,
137137
"metadata": {},
138138
"outputs": [],
139139
"source": [

src/bot/include/map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const COMPRESSED_OPENING_DB: &[u8] = include_bytes!("../../data/openings.tar.gz"
1212
fn read_opening_db() -> Result<Value, io::Error> {
1313
let output_dir = Path::new("./db");
1414
let compressed_path = output_dir.join("openings.tar.gz");
15-
let file_path = output_dir.join("openingDb.json");
15+
let file_path = output_dir.join("openingDB.json");
1616

1717
// If file doesn't exist, extract from embedded archive
1818
if !file_path.exists() {
@@ -31,12 +31,12 @@ fn read_opening_db() -> Result<Value, io::Error> {
3131
let tar = GzDecoder::new(tar_file);
3232
let mut archive = Archive::new(tar);
3333
archive.unpack(output_dir)?;
34-
34+
3535
// Clean up
3636
fs::remove_file(&compressed_path)?;
3737
println!("OpeningDB extracted to {:?}", file_path);
3838
}
39-
39+
4040
// Read and parse JSON
4141
let file_content = fs::read_to_string(&file_path)?;
4242
let json_data: Value = serde_json

src/data/openings.tar.gz

3.16 MB
Binary file not shown.

0 commit comments

Comments
 (0)