This page describes a grammar for talking about chess matches. :openccg:grammars:chess.ccg.txt

Motivation

Why would you want to parse chess-related sentences? There is a standard notation for describing chess matches, called algebraic chess notation, but it's ridiculously terse. The idea behind this grammar is that it could be used to convert games recorded in the notation into a more friendly English form.

Goals

The final grammar should be capable of describing every move that can be transcribed in standard chess notation, namely:

  • individual pieces (the queen, a rook, the pawns)
  • simple moves (the white king moved)
  • captures (White captured black's queen)
  • pawn promotion (Black made the pawn a queen)

Words

Verbs

One of the more difficult tasks in constructing the chess grammar was finding a ditransitive verb that made sense in this domain; in the end, I settled on using 'make' to describe pawn promotion (see above). The final grammar is woefully short of verbs; as it is, the six(!) verbs it currently understands are:

  • capture (Transitive) – the pawn captured a rook
  • threaten (Transitive) – the pawn threatens blacks king
  • take (Transitive) – Black took whites queen
  • move (Transitive) – Black moved a rook
  • move (Intransitive) – the black rook moved
  • make (Ditransitive) – White made the pawn a queen

Nouns

Furthermore, there aren't all that many nouns that need to be accounted for in a chess-related discussion; the chess grammar only recognizes the names of the pieces and White/Black for the two players. It does, however, distinguish between different classes of nouns – king and queen are singular-only nouns, while White and Black are singular pronouns. Also, no structure accepts unmodified nouns (pawn); to be properly parsed, a sentence has to either include a specifier (the pawn or blacks pawn) or an adjective (black pawns).

Adjectives

The chess grammar recognizes 5 adjectives for describing pieces – left/right/center to indicate where on the board a particular piece lies and white/black to specify to whom the piece belongs. Unfortunately, white/black have a double meaning in this context: they can specify the owner of a piece, or it's position on the board (esp. bishops). In allowing noun phrases like blacks black bishop (the bishop belonging to black which moves along black tiles), I was unable to exclude redundant phrases like blacks black pawn (the pawn belong to black which is…black). This is annoying, but phrases like this aren't actually incorrect, merely redundant.

Implementation

Features

The grammar only tracks a few features:

  • case – not currently used, but tracked for later use
  • number – used to distinguish between kings/queens (for which there is no plural) and other pieces.
  • player – who owns the piece
  • tense – past/present, useful for different contexts.

Expansions

The chess grammar uses expansions as a shorthand for defining the plural/singular form of nouns, differentiating between plural/singular and singular-only nouns, and for defining present/past tense verbs.

Notes

It is important to distinguish between the three different methods of specifying piece ownership:

  • blacks pawn (using blacks as a determiner)
  • a black pawn (using black as an adjective)
  • Black moved a pawn (using Black as the subject noun)
 
openccg/grammars/chess.txt · Last modified: 2007/04/25 18:26 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki