Table of Contents

A grammar for ordering breakfast from a short order cook. :openccg:grammars:shortorder.ccg.txt

Goals

The grammar should be capable of parsing requests for eggs, bacon, or toast. Requests can be for a single egg, piece of bacon, or piece of toast, or up to three. Eggs can be prepared in multiple ways.

Words

The grammar is able to parse sentences of the form I want (type of food).

Types of Food

Eggs, bacon, and toast are supported by the grammar. Eggs were easy to implement, but bacon and toast behave differently. It is legal to say, I want one egg, but not, I want one bacon. The noun bacon is more of an abstract concept, it needs to be instantiated before it can be refered to be a number. The words piece-of and pieces-of do this for both bacon and toast, but they cannot modify eggs.

How many?

After instantiating toast and bacon, it is possible to ask for one, two, or three of either. Eggs are already instantiated, and it is possible to ask for any number of them as well. The can refer to any kind of noun, as can some. If piece-of is not present and the noun is plural, it is possible to ask for the noun without a determinant.

I want eggs.
I want bacon.
I want piece-of bacon. # ILLEGAL

How would you like that?

When specifying eggs, it is possible to ask for them prepared in many different ways. A few of those ways are supported here. Note that the grammar will not stop you from asking for scrambled bacon, but the results would likely be inedible. * Hard-boiled * Scrambled * Poached * Over-easy The first three are adjectives that precede the noun, but over-easy is actually a prepositional phrase that follows it.

Implementation

The grammar is straightforward, and only supports subject - transitive verb - object sentence construction. It allows for adjectives and prepositional phrases, and also supports the idea of having collective nouns (bacon and toast) that must be instantiated before they can be refered to by number.

I want one piece-of bacon.
I want one bacon. # ILLEGAL
 
openccg/grammars/shortorder.txt · Last modified: 2007/04/25 19:20 (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