View source: R/clean_movetext.R
clean_movetext | R Documentation |
Removes comments, annotations, and other formatting that would interfere with engine analysis.
clean_movetext(movetext, cut_gtm = TRUE)
movetext |
A character vector of PGN movetext data |
cut_gtm |
(Default = TRUE) A boolean indicating if game termination markers should be deleted |
The PGN specification
allows comments, annotations, game termination markers, and formatting
oddities that may not play well with all software. The clean_movetext()
function removes everything but the moves and move numbers, unless the
cut_gtm
parameter is set to FALSE
.
A character vector of clean movetext.
Game termination markers ('1-0', '0-1', '1/2-1/2', '*') are removed by
default. This causes the movetext to no longer comply with the PGN
specification. PGN files saved without game termination markers will not
function properly. If you intend to save the clean movetext to a PGN file,
set the cut_gtm
parameter to FALSE
to preserve the game termination
markers.
As a human-readable (and writable) format, pgn files may sometimes contain non-standard characters. Some sources may use zero for castling ('0-0' or '0-0-0') instead of capital letter O. Clean movetext will convert these to the accepted forms. Em (—) or en (–) dashes are replaced with ordinary dashes (-).
get_pgn()
to get the movetext and other data from a PGN
file.
clean_movetext('1. e4! {Best by test.} e5 (d5 leads to the Scandinavian.) *')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.