Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion from UCI moves format to SAN #402

Open
amalrajjs opened this issue Nov 3, 2022 · 6 comments
Open

Conversion from UCI moves format to SAN #402

amalrajjs opened this issue Nov 3, 2022 · 6 comments

Comments

@amalrajjs
Copy link

Instead of moves for Sicilian 1.e4 e5 2.Nf3 Nc6, there is an alternative way e2e4 e7e5 g1f3 b8c6. Is there a way to convert huge csv databases of FEN and UCI moves to SAN moves?

@mliebelt
Copy link
Owner

mliebelt commented Nov 3, 2022

Interesting idea. Currently, the pgn-parser in itself is not able to "play" chess. But combined with the pgn-reader, that should be easily doable. What do you need, the reading of e2e4 c7c5 moves, or the generation of it? In both cases, you have to include the pgn-reader, that "understands" chess good enough to play through the moves and show errors when moves are not correct. One more question: including variations or only the main line? I would like to do a sketch of that by using the pgn-reader, together with the parser, to provide a command line tool.

See the issue #397 (comment) (originally raised on the pgn-parser as well). That sounds pretty similar, perhaps we can collect more of those, to have at the end a usable command line tool to work on pgn files and spit out whatever is needed.

@amalrajjs
Copy link
Author

Thanks for the reply. I have a comma seperated csv database of puzzle from Lichess.org . In that database, moves are written in UCI format (e2e4 e7e5 g1f3 b8c6) and my software doesn't support this. csv contain both FEN and UCI moves. I need to open that huge database in Google sheets. If I have one software that can read those and convert to SAN moves (e4 e5 Nf3 Nc6) that will be great use. Is there any existing software? Is there any google sheets formula that can read and convert entire column ?

@mliebelt
Copy link
Owner

mliebelt commented Nov 4, 2022

Do you have an example or a link to examples? So I can get from there the format, and do a draft proposal for a change. If you trust the correctness, then the conversion could be done by the parser. In case of chess knowledge needed (e.g. ambiguous moves in the resulting notation) then the pgn-reader would be more appropriate.

Ok, found it myself here: https://database.lichess.org/#puzzles I will extract a short samlple, and attach it here. It seems doable ...

Checking the examples, I have noticed that from the pgn-parser view, the notation is not sufficient to "know" which piece is doing which move. So we need any way the pgn-reader to do the job.

I will move the ticket therefore to the other repository (PgnViewerJS), with the pgn-reader as module there.

@mliebelt mliebelt transferred this issue from mliebelt/pgn-parser Nov 4, 2022
@mliebelt
Copy link
Owner

mliebelt commented Nov 4, 2022

example-puzzle-db.csv with a few lines.

Here are some findings:

  • first line: c2c1q is not a valid move (at the moment)
  • piece symbols are missing, so a chess engine is needed to add the missing SAN information

@amalrajjs
Copy link
Author

Combine FEN and UCI moves. FEN contains pieces on each square initially. Later changes will be there. c2c1 means piece in c2 square move to c1 square. c2 piece is known from FEN. But when pieces move, we need to make changes in FEN too (It's only in code).

@amalrajjs amalrajjs reopened this Nov 5, 2022
@amalrajjs
Copy link
Author

Is there a way to add a new column of SAN moves as per the UCI moves and initial FEN?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants