Improvement: When ELO is "" return 0 instead of ""
MichaelLeeHobbs opened this issue · 3 comments
Zero is an imposable rating to my knowledge. It is what I use to represent unrated in the database.
PGN
[Site "Hastings"]
[Date "1895.??.??"]
[Round "?"]
[White "Steinitz, William"]
[Black "Tinsley, Samuel"]
[Result "1-0"]
[WhiteElo ""]
[BlackElo ""]
[ECO "E70"]
1.d4 Nf6 2.c4 c5 3.d5 d6 4.Nc3 g6 5.e4 Bg7 6.Bd3 O-O 7.Nge2 Nbd7 8.Nf4 Ne5
9.Be2 b6 10.h4 h5 11.f3 Rb8 12.Nh3 a6 13.a4 Re8 14.Nf2 e6 15.Bg5 exd5 16.Nxd5 Be6
17.Ne3 Qd7 18.Nh3 Nc6 19.Bf4 Bxh3 20.Rxh3 Nd4 21.Bd3 Rb7 22.Kf2 Ne6 23.Bg3 Bh6
24.Nd5 Nxd5 25.cxd5 Nf4 26.Bxf4 Bxf4 27.Bxa6 Be5 28.Bxb7 Bd4+ 29.Kf1 Qxb7
30.Qb3 Ra8 31.Rb1 Qa6+ 32.Qb5 Qxa4 33.Qxa4 Rxa4 34.f4 Rb4 35.b3 c4 36.Ke2 Kf8
37.Kd2 Bf6 38.Re3 c3+ 39.Kc2 Bd4 40.Re2 Rb5 41.b4 f5 42.Kd3 1-0
returns
{
Event: 'Hastings',
Site: 'Hastings',
Date: { value: '1895.??.??', year: 1895, month: '??', day: '??' },
Round: '?',
White: 'Steinitz, William',
Black: 'Tinsley, Samuel',
Result: '1-0',
WhiteElo: '',
BlackElo: '',
ECO: 'E70',
messages: [ [Object], [Object] ],
UUID: 'dc48f09e-5d25-4e5a-8e87-db28d0fda832',
MD5: '42b737cf13b14c0f19cbde2815a0db90'
}
I think there are some more special cases. Elo should be all the time an integer, therefore it could be transformed to an integer, with 0 being the value for not rated. Perhaps there are other values that are currently strings that could be converted?
My data set is so far is limited to Chess.com and www.pgnmentor.com. In those two sets I have only seen a integer, nothing, or "". I'm still testing my pipeline and have only processed less than 1% of the data I have. Will update if I see some other value.
Had a ? as well. I ended up doing parseInt(elo) || 0
so I want actually know if there are other values. I'm looking at 5 hours to processes this data and had rather not have another crash, lol.