www.pudn.com > TAPIOfControl.rar > AdSapiGr.pas
(***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is TurboPower Async Professional
*
* The Initial Developer of the Original Code is
* TurboPower Software
*
* Portions created by the Initial Developer are Copyright (C) 1991-2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** *)
{*********************************************************}
{* ADSAPIGR.PAS 4.06 *}
{*********************************************************}
{* SAPI grammar definitions *}
{*********************************************************}
{Global defines potentially affecting this unit}
{$I AWDEFINE.INC}
unit AdSapiGr;
interface
resourcestring
{ AskFor xxx Prompts }
ApdAskAreaCode = 'What is the area code?';
ApdAskLastFour = 'What are the last four digits of the phone number?';
ApdAskNextThree = 'What are the next three digits of the phone number?';
ApdCannotGoBack = 'Cannot go back.';
ApdCannotHangUp = 'Cannot hang up now.';
ApdHangingUp = 'Goodbye.';
ApdHelp = 'This is help.';
ApdHelp2 = 'This is additional help.';
ApdHelpVerify = 'You can speak yes or no, or press 1 for yes, or 2 for no.';
ApdGoingBack = 'Going back.';
ApdMain = 'Please say something.';
ApdMain2 = 'Please say the something. - Shorter prompt';
ApdMaxSpeed = 'I am speaking as fast as I can.';
ApdMinSpeed = 'I am speaking as slowly as I can.';
ApdOperator = 'Connecting to an operator.';
ApdNoOperator = 'An operator is not available.';
ApdNoSpeedChange = 'Cannot change speed.';
ApdSpeakingFaster = 'Speaking faster.';
ApdSpeakingSlower = 'Speaking slower.';
ApdTooFewDigits = 'Not enough digits for the extension.';
ApdTooManyDigits = 'Too many digits for the extension.';
ApdUnrecognized = 'Sorry, I didn''t understand.';
ApdVerifyPost = 'Is this correct?';
ApdVerifyPre = 'I heard:';
ApdWhere = 'You are somewhere.';
ApdWhere2 = 'You are somewhere - Shorter prompt.';
ApdYouHaveSpelled = 'You have spelled: ';
{ Error Codes }
{ SAPI Engine }
ecApdNoSS = 'Speech synthesis engine is not assigned';
ecApdNoSR = 'Speech recognition engine is not assigned';
ecApdBadIndex = 'Invalid speech engine';
ecNoSREngines = 'No speech recognition engines are installed';
ecNoSSEngines = 'No speech synthesis engines are installed';
{ SAPI Phone }
ecApdNoSapiEngine = 'No SAPI engine';
ecApdNoPrompts = 'No prompts';
ecApdBadDeviceNum = 'Unable to set device number: ';
ecApdCannotCreateCOM = 'Cannot create COM Object';
ecApdNotPhone = 'SAPI Engine is not phone optimized';
{ More error strings }
{SS}
ApdStrTTSERR_INVALIDINTERFACE = 'Invalid interface';
ApdStrTTSERR_OUTOFDISK = 'Out of disk space';
ApdStrTTSERR_NOTSUPPORTED = 'Not supported';
ApdStrTTSERR_VALUEOUTOFRANGE = 'Value out of range';
ApdStrTTSERR_INVALIDWINDOW = 'Invalid window';
ApdStrTTSERR_INVALIDPARAM = 'Invalid parameter';
ApdStrTTSERR_INVALIDMODE = 'Invalid mode';
ApdStrTTSERR_INVALIDKEY = 'Invalid key';
ApdStrTTSERR_WAVEFORMATNOTSUPPORTED = 'Wave format not supported';
ApdStrTTSERR_INVALIDCHAR = 'Invalid character';
ApdStrTTSERR_QUEUEFULL = 'Queue full';
ApdStrTTSERR_WAVEDEVICEBUSY = 'Wave device busy';
ApdStrTTSERR_NOTPAUSED = 'Not paused';
ApdStrTTSERR_ALREADYPAUSED = 'Already paused';
{SR}
ApdStrSRERR_OUTOFDISK = 'Out of disk space';
ApdStrSRERR_NOTSUPPORTED = 'Not supported';
ApdStrSRERR_NOTENOUGHDATA = 'Not enough data';
ApdStrSRERR_VALUEOUTOFRANGE = 'Value out of range';
ApdStrSRERR_GRAMMARTOOCOMPLEX = 'Grammar too complex';
ApdStrSRERR_GRAMMARWRONGTYPE = 'Grammar is of the wrong type';
ApdStrSRERR_INVALIDWINDOW = 'Invalid window';
ApdStrSRERR_INVALIDPARAM = 'Invalid parameter';
ApdStrSRERR_INVALIDMODE = 'Invalid mode';
ApdStrSRERR_TOOMANYGRAMMARS = 'Too many grammars';
ApdStrSRERR_INVALIDLIST = 'Invalid list';
ApdStrSRERR_WAVEDEVICEBUSY = 'Wave device busy';
ApdStrSRERR_WAVEFORMATNOTSUPPORTED = 'Wave format not supported';
ApdStrSRERR_INVALIDCHAR = 'Invalid character';
ApdStrSRERR_GRAMTOOCOMPLEX = 'Grammar too complex';
ApdStrSRERR_GRAMTOOLARGE = 'Grammar too large';
ApdStrSRERR_INVALIDINTERFACE = 'Invalid interface';
ApdStrSRERR_INVALIDKEY = 'Invalid key';
ApdStrSRERR_INVALIDFLAG = 'Invalid flag';
ApdStrSRERR_GRAMMARERROR = 'Grammar error';
ApdStrSRERR_INVALIDRULE = 'Invalid rule';
ApdStrSRERR_RULEALREADYACTIVE = 'Rule already active';
ApdStrSRERR_RULENOTACTIVE = 'Rule not active';
ApdStrSRERR_NOUSERSELECTED = 'No users selected';
ApdStrSRERR_BAD_PRONUNCIATION = 'Bad pronunciation';
ApdStrSRERR_DATAFILEERROR = 'Data file error';
ApdStrSRERR_GRAMMARALREADYACTIVE = 'Grammar already active';
ApdStrSRERR_GRAMMARNOTACTIVE = 'Grammar not active';
ApdStrSRERR_GLOBALGRAMMARALREADYACTIVE = 'Global grammar already active';
ApdStrSRERR_LANGUAGEMISMATCH = 'Language mismatch';
ApdStrSRERR_MULTIPLELANG = 'Multiple languages';
ApdStrSRERR_LDGRAMMARNOWORDS = 'No words in grammar';
ApdStrSRERR_NOLEXICON = 'No lexicon';
ApdStrSRERR_SPEAKEREXISTS = 'Speaker exists';
ApdStrSRERR_GRAMMARENGINEMISMATCH = 'Grammar engine mismatch';
ApdStrSRERR_BOOKMARKEXISTS = 'Bookmark exists';
ApdStrSRERR_BOOKMARKDOESNOTEXIST = 'Bookmark does not exist';
ApdStrSRERR_MICWIZARDCANCELED = 'Microphone wizard cancelled';
ApdStrSRERR_WORDTOOLONG = 'Word too long';
ApdStrSRERR_BAD_WORD = 'Bad word';
ApdStrE_WRONGTYPE = 'Wrong type';
ApdStrE_BUFFERTOOSMALL = 'Bufer too small';
ApdStrE_UNKNOWN = 'Unknown error';
{ APRO SAPI Errors }
ApdStrE_CANNOTCREATESS = 'Unable to create speech ' +
'synthesis interface';
ApdStrE_CANNOTCREATESR = 'Unable to create speech ' +
'recognition interface';
ApdStrE_CANNOTSETSPEAKER = 'Cannot set speech recognition ' +
'speaker';
ApdStrE_CANNOTSETMIC = 'Cannot set microphone';
ApdStrE_NOSAPI4 = 'SAPI 4 Engine was not found';
{ Other things }
scApdTrainGeneral = 'General Training';
scApdTrainMic = 'Microphone Training';
scApdTrainGrammar = 'Phrase Training';
const
scApdDefaultUser : string = 'APRO User';
scApdDefaultMic : string = 'Default Microphone';
scApdTelMic : string = 'Telephone';
{ Default grammars used by the TApdSapiPhone component -
These are declared as constants. It appears that if resource strings
are used, the grammars wind up truncated. }
{ DefaultPhoneGrammar - This grammar is used as a skeleton by all the
AskFor methods in the TApdSapiPhone component. It provides a basic
driver for the "ask the user for something" loop. It provides a link to
which is used to provide specific information needed for the
data being asked. }
ApdDefaultPhoneGrammar : string =
'[Grammar]' + ^M^J +
'LangId=1033' + ^M^J +
'Type=CFG' + ^M^J +
'' + ^M^J +
'[Prompts]' + ^M^J +
'; you need to modify the next few prompts' + ^M^J +
'Main=Please say something.' + ^M^J +
';Main.2=Please say the something. - Shorter prompt' + ^M^J +
'Where=You are somewhere.' + ^M^J +
'Help=This is help.' + ^M^J +
'' + ^M^J +
'VerifyPre=I heard:' + ^M^J +
'VerifyPost=Is this correct?' + ^M^J +
'Unrecognized=Sorry, I didn''t understand.' + ^M^J +
'SpeakingFaster=Speaking faster.' + ^M^J +
'SpeakingSlower=Speaking slower.' + ^M^J +
'HelpVerify=You can speak yes or no, or press 1 for yes, or 2 for no.' +
^M^J +
'' + ^M^J +
'[Settings]' + ^M^J +
'Verify=0' + ^M^J +
'; verification on grammars just respeaks the recognize string' + ^M^J +
'' + ^M^J +
'; you usually wont need to change wha''t below here' + ^M^J +
'[]' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'' + ^M^J +
'[]' + ^M^J +
'=' + ^M^J +
'=(DefaultResponses)' + ^M^J +
'' + ^M^J +
'; **********************************************************************' +
^M^J +
'; all controls should have these default responses' + ^M^J +
'[(DefaultResponses)]' + ^M^J +
'=[opt] (DefaultJunkBegin) (ValidDefault) [opt] (DefaultJunkEnd)' + ^M^J +
'' + ^M^J +
'[(ValidDefault)]' + ^M^J +
'-3=(AskOperator)' + ^M^J +
'-4=(AskHangUp)' + ^M^J +
'-5=(AskBack)' + ^M^J +
'-10=(AskWhere)' + ^M^J +
'-11=(AskHelp)' + ^M^J +
'-12=(AskRepeat)' + ^M^J +
'-13=(AskSpeakFaster)' + ^M^J +
'-14=(AskSpeakSlower)' + ^M^J +
'' + ^M^J +
'[(DefaultJunkBegin)]' + ^M^J +
'=could you' + ^M^J +
'=I want [opt] to' + ^M^J +
'=please' + ^M^J +
'' + ^M^J +
'[(DefaultJunkEnd)]' + ^M^J +
'=please' + ^M^J +
'=now [opt] please' + ^M^J +
'' + ^M^J +
'[(AskOperator)]' + ^M^J +
'=[opt] (TalkToOperator) (OperatorName)' + ^M^J +
'' + ^M^J +
'[(TalkToOperator)]' + ^M^J +
'=talk to' + ^M^J +
'=speak with' + ^M^J +
'=connect me to' + ^M^J +
'=give me' + ^M^J +
'' + ^M^J +
'[(OperatorName)]' + ^M^J +
'=[opt] an operator' + ^M^J +
'=someone real' + ^M^J +
'=real person' + ^M^J +
'=living person' + ^M^J +
'=warm body' + ^M^J +
'' + ^M^J +
'[(AskHangUp)]' + ^M^J +
'=hang up' + ^M^J +
'=goodbye' + ^M^J +
'' + ^M^J +
'[(AskBack)]' + ^M^J +
'=scratch that' + ^M^J +
'=go back' + ^M^J +
'=undo that' + ^M^J +
'=I made a mistake' + ^M^J +
'=never mind' + ^M^J +
'' + ^M^J +
'[(AskWhere)]' + ^M^J +
'=where am I' + ^M^J +
'=where were we' + ^M^J +
'=what am I doing' + ^M^J +
'=what''s going on' + ^M^J +
'' + ^M^J +
'[(AskHelp)]' + ^M^J +
'=[opt] some help [opt] me' + ^M^J +
'=give me help' + ^M^J +
'=what can I say' + ^M^J +
'=list [opt] voice commands' + ^M^J +
'=what are my options' + ^M^J +
'=tell me what I can say' + ^M^J +
'' + ^M^J +
'[(AskRepeat)]' + ^M^J +
'=what' + ^M^J +
'=what did you say' + ^M^J +
'=repeat [opt] that' + ^M^J +
'=huh' + ^M^J +
'' + ^M^J +
'[(AskSpeakFaster)]' + ^M^J +
'=speak faster' + ^M^J +
'=talk faster' + ^M^J +
'=speak more quickly' + ^M^J +
'=talk more quickly' + ^M^J +
'' + ^M^J +
'[(AskSpeakSlower)]' + ^M^J +
'=speak slower' + ^M^J +
'=talk slower' + ^M^J +
'=speak more slowly' + ^M^J +
'=talk more slowly' + ^M^J +
'' + ^M^J +
'; entries necessary for verification to work' + ^M^J +
'[]' + ^M^J +
'=(YesNo)' + ^M^J +
'=(DefaultResponses)' + ^M^J;
{ AskForDateGrammar - This grammar provides everything needed for asking
the user for a date. }
ApdAskForDateGrammar : string =
'[]' + ^M^J +
'=(TheDate)' + ^M^J +
'' + ^M^J +
'[(TheDate)]' + ^M^J +
'-500=' + ^M^J +
'' + ^M^J +
'[]' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'// Double-number cominations, like "ninteen sixty"' + ^M^J +
'= ' + ^M^J +
'= oh "0" <1_9>' + ^M^J +
'= hundred "00"' + ^M^J +
'' + ^M^J +
'[]' + ^M^J +
'=january' + ^M^J +
'=february' + ^M^J +
'=march' + ^M^J +
'=april' + ^M^J +
'=may' + ^M^J +
'=june' + ^M^J +
'=july' + ^M^J +
'=august' + ^M^J +
'=september' + ^M^J +
'=october' + ^M^J +
'=november' + ^M^J +
'=december' + ^M^J +
'' + ^M^J +
'[]' + ^M^J +
'=1' + ^M^J +
'=2' + ^M^J +
'=3' + ^M^J +
'=4' + ^M^J +
'=5' + ^M^J +
'=6' + ^M^J +
'=7' + ^M^J +
'=8' + ^M^J +
'=9' + ^M^J +
'=10' + ^M^J +
'=11' + ^M^J +
'=12' + ^M^J +
'' + ^M^J +
'[]' + ^M^J +
'= " " ' + ^M^J +
'= " " ' + ^M^J +
'=[opt] ' + ^M^J +
'= ' + ^M^J +
'= ' + ^M^J +
'=' + ^M^J +
'= [opt] ' + ^M^J +
'=<1_31>' + ^M^J +
'=' + ^M^J +
'=", " ' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=<32_99>' + ^M^J +
'<1_31>=<1_9>' + ^M^J +
'<1_31>=<10_19>' + ^M^J +
'<1_31>=<20_31>' + ^M^J +
'// Double-number cominations, like "ninteen sixty"' + ^M^J +
'= ' + ^M^J +
'= oh "0" <1_9>' + ^M^J +
'= hundred "00"' + ^M^J +
'=next' + ^M^J +
'=last' + ^M^J +
'=monday' + ^M^J +
'=tuesday' + ^M^J +
'=wednesday' + ^M^J +
'=thursday' + ^M^J +
'=friday' + ^M^J +
'=saturday' + ^M^J +
'=sunday' + ^M^J +
'=today' + ^M^J +
'=yesterday' + ^M^J +
'=tomorrow' + ^M^J +
'=week' + ^M^J +
'=month' + ^M^J +
'' + ^M^J +
'// Less than 1,000,000,000,000,000, not padded with zeros' + ^M^J +
'= ' +
^M^J +
'= ' +
^M^J +
'=trillion "000000000000"' + ^M^J +
'=trillion [opt] and ' +
^M^J +
'// Less than 1,000,000,000,000, padded with zeros' + ^M^J +
'="000" ' + ^M^J +
'=billion [opt] and "001" ' +
^M^J +
'= ' + ^M^J +
'= ' + ^M^J +
'=billion "000000000"' + ^M^J +
'=billion [opt] and ' + ^M^J +
'// Less than 1,000,000,000,000, not padded with zeros' + ^M^J +
'= ' + ^M^J +
'= ' + ^M^J +
'=billion "000000000"' + ^M^J +
'=billion [opt] and ' + ^M^J +
'// Less than 1,000,000,000, padded with zeros' + ^M^J +
'="000" ' + ^M^J +
'=million [opt] and "001" ' + ^M^J +
'= ' + ^M^J +
'=million "000000"' + ^M^J +
'=million [opt] and ' + ^M^J +
'// Less than 1,000,000,000, not padded with zeros' + ^M^J +
'= ' + ^M^J +
'= ' + ^M^J +
'=million "000000"' + ^M^J +
'=million [opt] and ' + ^M^J +
'// Less than 1,000,000, padded with zeros' + ^M^J +
'="000" ' + ^M^J +
'=thousand [opt] and "001" ' + ^M^J +
'= ' + ^M^J +
'=thousand "000"' + ^M^J +
'=thousand [opt] and ' + ^M^J +
'' + ^M^J +
'[]' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'=' + ^M^J +
'= hundredth "00"' + ^M^J +
'= trillionth "000000000000"' + ^M^J +
'= trillion [opt] and ' +
'' + ^M^J +
'= trillionth "000000000000"' + ^M^J +
'= trillion [opt] and ' +
'' + ^M^J +
'="000" ' + ^M^J +
'=billion [opt] and "001" ' +
'' + ^M^J +
'= ' +
'' + ^M^J +
'= ' +
'' + ^M^J +
'=billionth "000000000"' + ^M^J +
'=billion [opt] and ' +
'' + ^M^J +
'= ' +
'' + ^M^J +
'= ' +
'' + ^M^J +
'=billionth "000000000"' + ^M^J +
'=billion [opt] and ' +
'' + ^M^J +
'="000" ' + ^M^J +
'=million [opt] and "001" ' +
'' + ^M^J +
'= ' +
^M^J +
'=millionth "000000"' + ^M^J +
'=million [opt] and ' +
^M^J +
'= ' +
^M^J +
'= ' +
^M^J +
'=millionth "000000"' + ^M^J +
'=million [opt] and ' +
^M^J +
'// Ordinal Less than 1,000,000, padded with zeros, without ending' + ^M^J +
'="000" ' + ^M^J +
'=thousand [opt] and "001" ' +
^M^J +
'= ' + ^M^J +
'=thousandth "000"' + ^M^J +
'=thousandth [opt] and ' +
^M^J +
'// Ordinal Less than 1,000,000, not padded with zeros, without ending' +
^M^J +
'=<1_9> thousandth "000"' + ^M^J +
'=<1_9> thousand [opt] and ' +
^M^J +
'= ' + ^M^J +
'