Apple Newton Utilities Guía de usuario Pagina 659

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 942
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 658
CHAPTER 18
Intelligent Assistant
About the Assistant 18-13
Resolving Template-Matching Conicts 18
Template matching conicts may arise when a template’s lexicon includes a word
that appears in the lexicon of another registered template. This section describes
the means by which the Assistant attempts to resolve such conicts.
When a verb matches more than one action template, the Assistant must choose the
appropriate action template. For example, imagine that two games, Chess and
Checkers, are currently loaded in the Extras Drawer. If both games specify the
word
"play" in their action template’s lexicon, the Assistant cannot open the
correct application by simply matching this verb; the correct game to open must be
determined by some other means. For example, the code fragment below shows the
template for an action, play_act, that might conceivably be dened by both games:
play_act := { value: "play action",
isa: 'dyna_user_action,
lexicon: [ "play" ]
}
The task templates for each of these games might look like the following example.
Note that both templates dene
play_act as the primary action:
chessTemplate := {
value: "Chess Template",
isa: 'task_template,
primary_act: play_act,
preConditions: ['generic_action,'action, 'game],
signature: ['dyna_user_action, play_act,
chess_obj],
PostParse: func()
begin
print("we made it, chess!");
end,
score: nil},
checkersTemplate := { value: "Checkers Template",
isa: 'task_template,
primary_act: play_act,
preConditions: ['generic_action, 'action,
'game],
signature: ['dyna_user_action, play_act,
chkrs_obj],
PostParse: func()
begin
print("we made it, checkers!");
end,
score: nil},
Vista de pagina 658
1 2 ... 654 655 656 657 658 659 660 661 662 663 664 ... 941 942

Comentarios a estos manuales

Sin comentarios