Table of Contents Index NMS Glossary Previous Page Next Page (Page 1 of 5 in this chapter) Version


Appendix D

Using the Prompt Builder


Prompt Builder Runtime Files
Prompt Builder Source Programs
Using the Prompt Rules Table
Prompt Rules Table Processing
String Operations
Processing Termination
CONVERT 191
FIND 193
OUTPUT 196
TEST 197

Prompt Builder Runtime Files
File Name

Description

american.tbl

The compiled rules table for standard American English. The rules contained in this file are used by the Prompt Builder to build a list of message numbers that can be sent directly to vcePlayList to say dates, times, numbers, and dollar amounts. The supplied American rules table understands the following:

· Any number from 0 to 999,999,999,999 with or without commas.

· Decimal fractions of any length.

· Dates in MM/DD, MM/DD/YY, or MM/DD/YYYY format.

· Time in HH:MM or HH:MM:SS 24 hour format where hour is 0 to 23.

· Dollar amounts in $DDD,DDD.CC format, with or without cents, or commas.

· Months and days of the week in the following format:
MON, TUE, WED, THU, FRI, SAT, SUN, JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC.

· The words: AT, AND.

· Any space separated list of the above formats will be output in succession separated by pauses.

· Strings starting with @ are spoken as individual digits, with pauses at spaces and hyphens. All other characters are ignored.

american.vox

The default voice message library for the standard American prompts. This file would be opened and specified in vcePlayList in conjunction with the message list output of vceBuildPromptList. This file can be re-recorded to change the voice that speaks the Prompt Builder prompts. This file also contains a brief text description of each message.

mkprompt.exe

Prompt Table Compiler used to compile prompt rule text files (.ptx) into prompt rules tables (.tbl). For more information, refer to Section 5.6, Make Prompt: mkprompt.

testpmpt.exe

Prompt Test Utility, used when developing new rules or editing existing ones. This utility allows you to try rules without having to record voice messages. For more information, refer to Section 5.7, Test Prompt: testpmpt.

Top of Page

Note: mkprompt and testpmpt are .exe files in Windows NT and Windows 2000 only.

Prompt Builder Source Programs
File Name

Description

american.ptx

The source rule file for the standard American rules. It can be compiled into american.tbl using mkprompt. New rules can be added and then compiled into a .tbl file.

testpmpt.c

The source to the Prompt Test utility. This file demonstrates how the Prompt Builder functions are used by an application.

Top of Page

To re-record american.vox, use vceinfo to list the message descriptions in american.vox. Follow this list to create a new american.vox. Refer to Section 5.3, Voice File Information: vceinfo for more information.

Using the Prompt Rules TableTop of Page

The Prompt Rules Table included with Natural Access contains an extensive set of translation rules detailed in the previous section. Some tools are provided to extend the capabilities of the Prompt Builder.

A Prompt Rules Table file (.tbl) is created from a Prompt Rules Source file (.ptx) using mkprompt. mkprompt expects a text source file that contains prompt table commands.

A prompt rules table is composed of a list of commands, keywords, and labels. Four commands, in conjunction with context sensitive keywords, are used to:

The four commands are
Command

Description

CONVERT

Converts string to a message number or label. Appends a computed message number to an output list or jumps to a computed label.

FIND

Parses input string. Performs conditional jumps.

OUTPUT

Appends message numbers to an output list. Can also be used to terminate processing.

TEST

Performs conditional jumps based upon result of string or integer comparison.


In addition to the four commands, use the following elements:
Element

Description

;

Comment field, all remaining text on the line is ignored.

label=num

Assign a value to a label. This is primarily used to assign a name to each message in the prompt message file.

label:

Marks the command as a target for a jump from a CONVERT, TEST, or FIND command.

The syntax of these commands is:

command [option1|option2] value ...
command - is the name of the command.

[option1|option2] - is a selection of optional keywords. The available choices are presented within the brackets. Only one can be selected. That is, either option1 or option2 can be specified, but not both. Both choices can be omitted, and the default option will be used.

value - is a number, string, or label. This value is dependent on the command syntax.

Prompt Rules Table ProcessingTop of Page

Prompt Rules table processing occurs when an application passes a string and a prompt table handle to vceBuildPromptList. Prompt table commands are processed line by line. Each command receives an input string passed to it by the previous command. The initial input string is passed in by the application. The initial line is determined by the method parameter passed to vceBuildPromptList.

Control flow can be modified by the GOTO and CALL keywords, as well as the EXIT, QUIT, and ERROR keywords. The GOTO keyword specifies a jump to a specified label. Command processing then continues in a line by line fashion. The CALL keyword also specifies a jump to a specified label. A CALL jump results in the following actions:

  1. Save current state: input string, current line.

    
    
  2. Jump to label.

    
    
  3. Process commands until an EXIT signifying a return to this saved state is encountered.

    
    
  4. Restore saved state of the input string and current line.

    
    
  5. Continue processing at following line.

The EXIT keyword is used to return to the previously saved state, which consists of the saved input string and command line. The EXIT keyword can be optionally preceded by the keyword ELSE when used with the FIND and TEST commands.

The QUIT keyword is allowed only with the OUTPUT command. It terminates processing of the prompt rules table and returns SUCCESS to the application.

The ERROR keyword is allowed only with the FIND and TEST commands. It terminates processing of the prompt rules table and returns VCE_PROMPT_BUILD_ERROR to the application.

String OperationsTop of Page

A substring of the input string can be compared to a string or an integer with the TEST command. It can be translated to a message or label with the CONVERT command. The input string can be parsed with the FIND command. The FIND command is the only command that affects the input string itself by passing a substring to the next command. The other commands pass the string unmodified. Once a string has been shortened by the FIND command, it cannot be restored unless an EXIT is used to return from a CALL jump.

Processing TerminationTop of Page

Command processing terminates when there are no commands left to process. In this case, SUCCESS is returned to the application. Command processing also terminates when either a QUIT or ERROR is encountered.



Table of Contents Index NMS Glossary Previous Page Next Page (Page 1 of 5 in this chapter) Version


Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2001, Natural MicroSystems, Inc. All rights reserved.