pgn-parser
pgn-parser copied to clipboard
PGN spec: allowed nags
See the pgn spec: SAN move suffix annotations with the following statement.
Import format PGN allows for the use of traditional suffix annotations for moves. There are exactly six such annotations available: "!", "?", "!!", "!?", "?!", and "??". At most one such suffix annotation may appear per move, and if present, it is always the last part of the move symbol.
The parser allows here (in all cases) much more. Perhaps it is necessary to have a strict and sloppy mode, to differentiate that. So reading games in strict mode would deny to parse move texts like e4! ??
and many more.
With the changed post-processing, it should now be possible to add validations. One of the validations is then, that only 1 out of the 6 "traditional suffix annotations" should be used. Emit a warning then, so others may use that information then to decide if the PGN notation is ok or not.
The 2 rules to implement here are:
- Have at most 1 traditional suffix annotation (NAG 1-6).
- Have that suffix annotation as first NAG.