mcostalba / chess_db

GNU General Public License v3.0
22 stars 5 forks source link

Sometimes parser reports 0 win/draw/loss info #18

Closed gbtami closed 7 years ago

gbtami commented 7 years ago

Get latest .pgn from http://www.theweekinchess.com/zips/twic1153g.zip

tamas@tami:~/PGN$ parser book ./twic1153.pgn full

Processing...done
Sorting...done
Writing Polygot book...done

Games: 2763
Moves: 228794
Incorrect moves: 0
Unique positions: 86%
Games/second: 69075
Moves/second: 5719850
MBytes/second: 59.3988
Size of index file (bytes): 3660704
Book file: ./twic1153.bin
Processing time (ms): 40

tamas@tami:~/PGN$ parser find ./twic1153.bin rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1

{
    "fen": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1",
    "key": 9384546495678726550,
    "moves": [
       {
            "move": "c7c5", "weight": 27984, "games": 547, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [2035144, 410704, 710656, 1688784, 1243104, 54256, 2076648, 1443128, 2353736, 1031232]
       },
       {
            "move": "e7e5", "weight": 15143, "games": 296, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [173472, 1238600, 399768, 1679312, 888672, 93912, 604328, 2231696, 1820432, 423896]
       },
       {
            "move": "e7e6", "weight": 8390, "games": 164, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [2268784, 944128, 1045952, 1135128, 773504, 1701352, 1668784, 1899960, 1399176, 220256]
       },
       {
            "move": "c7c6", "weight": 6343, "games": 124, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [357584, 1578176, 1041944, 1025344, 681344, 849552, 1381496, 771096, 933248, 2194840]
       },
       {
            "move": "d7d6", "weight": 2762, "games": 54, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [2218192, 812840, 1771544, 290608, 1761984, 1913560, 1226680, 1632944, 500072, 1693904]
       },
       {
            "move": "g7g6", "weight": 1892, "games": 37, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [1246632, 800976, 948848, 873816, 970736, 1491424, 2359184, 823288, 1525928, 122128]
       },
       {
            "move": "d7d5", "weight": 1637, "games": 32, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [896376, 1032472, 1042992, 1883520, 1059432, 2285320, 2257488, 90144, 1603112, 996320]
       },
       {
            "move": "g8f6", "weight": 818, "games": 16, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [1104120, 1601096, 2266952, 2004792, 1994432, 803080, 1343888, 2079312, 2140640, 1661288]
       },
       {
            "move": "b7b6", "weight": 358, "games": 7, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [2317072, 2029016, 1299960, 1000024, 795528, 983480, 1440584]
       },
       {
            "move": "b8c6", "weight": 153, "games": 3, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [42000, 1803992, 2339312]
       },
       {
            "move": "f7f6", "weight": 51, "games": 1, "wins": 0, "losses": 0, "draws": 0, "pgn offsets": [1043696]
       }
    ]
}
gbtami commented 7 years ago

Maybe this is related to the size of .pgn file. Smaller .pgn files from twic seems Ok.

sshivaji commented 7 years ago

0 wins, losses, and draws but with one game means that the game in question does not have a result. Can you check the offset and verify in the original PGN that the game has no result. I have a test case for this logic.

gbtami commented 7 years ago

The problem is not the last "move" line with 1 "games" but all lines being 0/0/0 in the position 1.e4!