Apple Newton Utilities User's Guide Page 658

  • Download
  • Add to my manuals
  • Print
  • Page
    / 942
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 657
CHAPTER 18
Intelligent Assistant
18-12 About the Assistant
value "Bob Anderson", that element of the phrases array stores the entire
string
"Bob Anderson", as the following code fragment shows:
// input string is "call bob anderson"
{…
phrases: ["bob anderson", "call"],
…}
Note that strings may appear in the phrases array in a different order than they
did in the original input to the Assistant.
The OrigPhrase Slot 18
The original input phrase is returned as a single string that resides in the task
frame’s
origPhrase slot. You can examine this slot to determine the number and
ordering of words in the original input string.
The Value Slot 18
Some values can be parsed correctly only by using a lexical dictionary that
describes their format. These values include formatted numbers such as phone
numbers, currency values, dates, and times.
When the Assistant uses a lexical dictionary to parse an object, it returns the parsed
phrase as a single string in the
value slot. For example, if the user had entered the
phrase
"Call 555-1212" the Assistant would store the phone number in the
value slot, as shown in the following example:
{...
input: [{isa: {value: "action"},
Lexicon: [["call", "phone", "ring", "dial"]],
value: "call"},
{isa: {isa: {isa: {#4B9F1D},
value: NIL,
Lexicon: [#4B9FA1]}},
value: "555-1212"}],
...}
Note that the value slot is created only when the Assistant uses a lexical
dictionary to parse a formatted string such as a time, date, phone number, or
monetary value.
Page view 657
1 2 ... 653 654 655 656 657 658 659 660 661 662 663 ... 941 942

Comments to this Manuals

No comments