When parsing a kifu generated by 81dojo, it returned an empty list after calling kif['moves'].
The problem was the regex which recognized line moves when there was only one space between move number and move position.
Content
Updated MOVE_RE regex in ./shogi/KIF.py
How To Check
I've checked my code in a jupyter notebook by running in a cell :
PATH = 'path/to/kifu/directory'
kif = shogi.KIF.Parser.parse_file(PATH + '81dojo-kif.kifu')[0]
kif['moves']
Coverage remained the same at 82.579% when pulling 058513310e854416c529cb6f208ab7e1e28986b7 on sokah2412:81dojo-kifu into 54bbdd048965e1b717e8bdde9e1ce319d80bdb44 on gunyarakun:master.
Coverage remained the same at 82.579% when pulling 058513310e854416c529cb6f208ab7e1e28986b7 on sokah2412:81dojo-kifu into 54bbdd048965e1b717e8bdde9e1ce319d80bdb44 on gunyarakun:master.
Coverage remained the same at 82.579% when pulling 058513310e854416c529cb6f208ab7e1e28986b7 on sokah2412:81dojo-kifu into 54bbdd048965e1b717e8bdde9e1ce319d80bdb44 on gunyarakun:master.
Issue
When parsing a kifu generated by 81dojo, it returned an empty list after calling kif['moves']. The problem was the regex which recognized line moves when there was only one space between move number and move position.
Content
Updated MOVE_RE regex in ./shogi/KIF.py
How To Check
I've checked my code in a jupyter notebook by running in a cell :
And now it returns the list of all the moves