Apple Newton Utilities Betriebsanweisung Seite 656

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 942
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 655
CHAPTER 18
Intelligent Assistant
18-10 About the Assistant
The Signature and PreConditions Slots 18
Your task template must dene two slots, called signature and
preConditions, which store arrays of templates and symbols, respectively.
The
signature slot holds action templates and target templates that must be
matched to complete the primary action. The
preConditions slot species the
names of slots that the Assistant creates in the task frame as templates in the
signature slot are matched.
Each element of the
preConditions array is related to the corresponding
element of the signature array. Specically, an element of the preConditions
array species the name of the slot that the Assistant creates in the task frame when
the template in the corresponding element of the
signature array is matched.
For example, to send a fax the Assistant needs frames representing the action of
faxing, a fax number, the name of the person to whom the fax is sent, and the time
at which the fax is to be sent. The
signature slot in the following code fragment
species by name the templates required to create these frames.
{...
// example: when fax_number is matched, Assistant creates
// a 'number slot in task frame & puts target frame in it
signature: [fax_action, fax_number, who_obj, when_obj],
preConditions: ['action, 'number, 'recipient, 'when],
...}
The corresponding elements of the preConditions slot specify the names of
slots that the Assistant creates in the task frame to hold the frames created as the
templates in the signature slot are matched. For example, the preConditions
array in the previous code fragment species that the Assistant creates slots named
action, number, recipient and when in the task frame as necessary.
Continuing with the example based on the previous code fragment, when the
Assistant parses the input phrase
"fax Bob", it matches the word "fax" to the
fax_action template in the first element of the signature array and creates an
action frame from this template. The Assistant places this action frame in an
action slot (named for the symbol in the first element of the preConditions
array) that it creates in the task frame. Similarly, the Assistant creates a target
frame when the word
"Bob" is matched to the who_obj template in the third
element of the
signature array. The Assistant places this target frame in a
recipient slot (named for the symbol in the third element of the
preConditions array) that it creates in the task frame.
Words representing elements of the
signature array do not necessarily need to
appear in the input string in order to be matched to a template; for example, your
PostParse method might supply Bob’s fax number by finding it in the
Names soup.
Seitenansicht 655
1 2 ... 651 652 653 654 655 656 657 658 659 660 661 ... 941 942

Kommentare zu diesen Handbüchern

Keine Kommentare