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

Error in pgn with "old notation" #18

Open
osotorrio opened this issue Sep 26, 2016 · 7 comments
Open

Error in pgn with "old notation" #18

osotorrio opened this issue Sep 26, 2016 · 7 comments

Comments

@osotorrio
Copy link

Hi,

First of all, thank you very much for your work. Great job!!

I have a PGN file from and when I try to read it with pgn.net it throws an exception:

Error in pgn: Ln: 318 Col: 34
35.Kc3 f3 36.b6 e4 37.b7 e3 38.b8Q Rxb8 39.Bxb8 Rxh2 40.Bxh2 1-0

Expecting: Comment ( {...} or ;... ), Game termination marker (1/2-1/2 or 1-0
or 0-1 or *), Move (e.g. Qc4 or e2e4 or 0-0-0 etc.), Move annotation (e.g. ! or
??), Move number indicator (e.g. 5. or 13...), NAG ($ e.g. $6 or $32), RAV
e.g. "(6. Bd3)", Tag (e.g [Date "2013.10.02"]), end of input, '#', '+', '++',
'ch', 'dbl ch', '†', '††' or '‡'

As you can see the notation of the white move 38. b8Q is a bit weird. I guess it should be 38. b8=Q

Is the notation b8Q some kind of "old style"?. If so, why to throw an exception?...maybe it could support backward compatibility.

Thanks again!!

@Antaniserse
Copy link

Antaniserse commented Sep 26, 2016

As far as I know the PGN specs have always required the '=' symbol to denote a promotion; "b8Q" is sometimes seen in books and publications (the classic Chess Informat volumes, for example, have typically used a very shortened algebraic notation), but strictly speaking i don't think it was ever accepted in PGN standard, even if many common softwares gloss over it

@iigorr
Copy link
Owner

iigorr commented Sep 28, 2016

Hi Oscar, hi Luca.

I think the parser should be as forgiving as possible. If there are databases that denote the promotion in the abbreviated form, then there should be no error as long as it does not introduce any ambiguities.

I'll look into that. Thanks for reporting!

@iigorr iigorr reopened this Sep 28, 2016
@iigorr
Copy link
Owner

iigorr commented Oct 13, 2016

Oscar, do you have a link to source where such moves are listed?

@iigorr
Copy link
Owner

iigorr commented Oct 13, 2016

Never mind. I found it in the FIDE rules:

C.12
In the case of the promotion of a pawn, the actual pawn move is indicated, followed immediately by the first letter of the new piece. Examples: d8Q, f8N, b1B, g1R.

https://www.fide.com/component/handbook/?id=124&view=article

So this is official and needs to be fixed.

@iigorr
Copy link
Owner

iigorr commented Oct 13, 2016

Unfortunatelly there is an ambiguity. It conflicts with the SAN annotation "Theoretical Novelty", which is TN or N. Now in case of N we get the conflict:
f8N: pawn to f8 (Annotation: "Theoretical Novelty")
f8N: pawn to f8, promoting to Knight

Of course the latter is much more probable, but the formal grammar would still be ambiguous...

@osotorrio
Copy link
Author

@iigorr I apologize for taking too long to answer. I did not receive any notification :(

I believe that any game downloaded from the official FIDE's website would have that notation. For instance: https://ratings.fide.com/view_games.phtml?id=1503014&name=%22Carlsen__Magnus(NOR)%22

@iigorr
Copy link
Owner

iigorr commented Oct 30, 2016

@osotorrio, thanks for your feedback. Ok. I will drop the SAN for "Theoretical Notation". FIDE games should be supported of course. :)

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

3 participants