pgn-parser icon indicating copy to clipboard operation
pgn-parser copied to clipboard

PGN spec: allowed nags

Open mliebelt opened this issue 3 years ago • 1 comments

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.

mliebelt avatar Mar 03 '21 21:03 mliebelt

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:

  1. Have at most 1 traditional suffix annotation (NAG 1-6).
  2. Have that suffix annotation as first NAG.

mliebelt avatar Jun 01 '21 10:06 mliebelt