gunyarakun / python-shogi

A pure Python shogi library with move generation and validation and handling of common formats.
GNU General Public License v3.0
179 stars 43 forks source link

Support kifu generated by 81dojo #33

Closed sokah2412 closed 3 years ago

sokah2412 commented 3 years ago

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 :

PATH = 'path/to/kifu/directory'
kif = shogi.KIF.Parser.parse_file(PATH + '81dojo-kif.kifu')[0]
kif['moves']

And now it returns the list of all the moves

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 82.579% when pulling 058513310e854416c529cb6f208ab7e1e28986b7 on sokah2412:81dojo-kifu into 54bbdd048965e1b717e8bdde9e1ce319d80bdb44 on gunyarakun:master.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 82.579% when pulling 058513310e854416c529cb6f208ab7e1e28986b7 on sokah2412:81dojo-kifu into 54bbdd048965e1b717e8bdde9e1ce319d80bdb44 on gunyarakun:master.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 82.579% when pulling 058513310e854416c529cb6f208ab7e1e28986b7 on sokah2412:81dojo-kifu into 54bbdd048965e1b717e8bdde9e1ce319d80bdb44 on gunyarakun:master.

gunyarakun commented 3 years ago

Thank you! I'll add a test.