background image
C H A P T E R 1 8
Intelligent Assistant
18-14
About the Assistant
If you specify the
'dyna_user_action
symbol as the first element of your task
template's
signature
slot, any target that distinguishes one template from
another enables the Assistant to select the correct template. For example, the two
target templates in the following code fragment represent the games Chess and
Checkers, respectively:
chess_obj := {value: "chess obj",
isa: 'dyna_user_obj,
lexicon: [ "chess" ]
}
chkrs_obj := {value: "checkers obj",
isa: 'dyna_user_obj,
lexicon: [ "checkers" ]
}
The fact that the lexicons in these templates do not match allows the Assistant to
resolve the ambiguity. When the string
"play chess"
is passed to the Assistant,
the word
"play"
is matched to the
play_act
template and the Assistant creates
an action frame from that template. Similarly, the Assistant matches the word
"chess"
with the
chess_obj
template's lexicon and creates a target frame from
that template.
Note that the
play_act
action frame can be matched to the
primary_act
of
either the
chess_Template
or the
checkers_Template
. Because the
signatures of both of these templates specify the
dyna_user_action
and
play_act
frame types as their first two elements, the conflict is not resolved until
the third element of one of these
signature
arrays is matched.
The
chess_obj
target frame matches the third element of the signature for the
chess_template
. It does not match any elements of the signature in the
checkers_Template
. Thus, matching the word
"chess"
resolves the conflict
because the only
signature
array that has been matched completely is that of the
chess_Template
.
Compatibility Information
18
The Assistant now matches entire words only, instead of allowing partial matches.
The Assistant no longer uppercases the words that it returns.
The Assistant now adds the eight most recently parsed phrases to the bottom of the
Please pop-up menu. Phrases do not need to be interpreted successfully by the
Assistant to be included in this list.
The result frame returned by the
ParseUtter
function contains a new slot named
entries
, which holds an array of aliases to soup entries that were matched when
parsing the input string. To retrieve these entries, you must use the new
GetMatchedEntries
global function.
© 2007-2024, o7 studio » при воспроизведении материала сайта ссылка обязательна