Apple Newton Utilities User's Guide Page 662

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 661
CHAPTER 18
Intelligent Assistant
18-16 Using the Assistant
5. Dene the words or phrases this template is to match as an array of strings in its
lexicon slot. If you place the name of a system-supplied template in your
template’s
isa slot, your template inherits its lexicon from the system-supplied
template. You should be aware, however that
isa slot values other than the
symbols
'dyna_user_action and 'dyna_user_obj may interfere
with the system’s ability to match your template successfully. For more
information, see the section “Dening Your Own Frame Types to the Assistant,
immediately following.
Sample Action Template 18
The following code fragment denes an action template called myPayAction that
might be used by a home banking application:
myPayAction := {
value: "Pay Action", // name of action
isa: 'dyna_user_action // must use this value
lexicon: ["pay", "paid"] // words to match
}
Sample Target Template 18
The following code fragment denes a target template called cbPayee that a
home banking application might use:
myPayee := {
value: "Who Object", // name of target
isa: 'dyna_user_obj // must use this value
lexicon: ["to", "Bob"] // words to match
}
Dening Your Own Frame Types to the Assistant 18
The conict resolution mechanism relies on the use of system-supplied dynamic
user object templates. You can dene your own symbol for your template’s
isa slot as long as it ultimately refers to a template with the symbol
'dyna_user_action or 'dyna_user_obj as the value of its isa
slot. For example, you can dene a
my_action template that is a
'dyna_user_action , as shown in the following code fragment:
my_action := {
value: "my action" // name of this action
isa: 'dyna_user_action, // must use this value
lexicon: ["jump", "hop"] // words to match action
}
Page view 661
1 2 ... 657 658 659 660 661 662 663 664 665 666 667 ... 941 942

Comments to this Manuals

No comments