This page describes a grammar for talking about chess matches. :openccg:grammars:chess.ccg.txt
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.
The final grammar should be capable of describing every move that can be transcribed in standard chess notation, namely:
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:
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).
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.
The grammar only tracks a few features:
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.
It is important to distinguish between the three different methods of specifying piece ownership:
blacks as a determiner)black as an adjective)Black as the subject noun)