Exercise 29: QueriesOctober 18, 2008
SummaryImplement the following queries:
1. | |
2. | | What is {first_name}'s phone number? |
|
|
3. | | We need more {food_item}. |
|
|
4. | | What's on the grocery list? |
|
|
5. | |
Support at least 10 phone numbers and 25 grocery items.
Implementing the "What's on the grocery list?" query will involve enhancing the query system so that it can return multiple results. Implementing the "Clear the grocery list" command will involve some new syntax to allow a relationship to be cleared.
Web UIClick hereGrace applicationClick hereNOTE: The Grace application requires that you have
Expressivo installed for text-to-speech.
Exercise 28: Integrating Plato with GraceOctober 17, 2008
SummaryThe goal of this exercise is to integrate the
Plato engine with the
Grace UI, and to demonstrate the
temperature() functionality.
  | Combine the Grace and Plato projects into a single solution. |
  | Create data files (.txt) to represent each of Plato's data structures, and have Grace load those into memory when it initializes. |
  | Every 5 seconds, have Grace examine the file sizes and reload them as needed. |
  | Create a new data structure for Grace which will represent the phrases that will be recognized. They may use entity types, such as: |
 | | what is the current temperature in {city}? |
| |
  | Optional words are denoted with round brackets, and vertical bars can be used to denote several options. For required words that have several options, use square brackets. For example: |
 | | [what is|what's] the (current) temperature in {city}? |
| |
  | Transform these specifications into an SR grammar, write it to disk, compile it, and then load it. |
  | When a statement is recognized, pass it on to Plato. |
  | If Plato can't parse the statement/question, abort all operations. Simply do nothing. |
  | If Plato's output is a value, display it and speak it. |
  | If Plato's output is an assignment or relationship, briefly display a full-screen green window. (1 second) |
  | If Plato's output is a TransOutput_Program, display a full-screen gray window while the query executes. If the query completes properly, display and speak the answer. If it fails, display a full-screen red window for 1 second. |
  | Test the setup in a kitchen with a laptop, speakers, and a Bluetooth headset. |
...
Exercise 27: Visual feedbackOctober 17, 2008
SummaryImplement a class that, given a string, opens a full screen window with no title bar, a black background, and the given text displayed in white letters centered horizontally and vertically. The text should remain visible for 3 seconds and then the window should disappear.
older >>