Unable to create dynamic list of phrases for XML grammar
Last reviewed: 2/28/2003
PRB Article ID: P020308
The information in this article applies to:
- Chant SpeechKit 4
Symptoms
Creating a dynamic list of phrases for an XML Grammar with DefineResource results in an E_INVALIDARG (0x80070057) return code.
Cause
Parameter validation for CSRVocabList was in error. Required parameters include CSRVocabList as the resource type, descriptor that matches the rule name in the XML grammar, and vocabulary resource identifier.
VocabID = ChantSR.DefineResource(CSRGrammarVocab, "c:\\myvocab.xml")
ListID = ChantSR.DefineResource(CSRVocabList, "rulelistname", CRFNone, NULL, NULL, 0, VocabID)
ChantSR.AddResource(CSRVocabPhrase, ListID, "Log Call")
ChantSR.AddResource(CSRVocabPhrase, ListID, "Enter Time")
ChantSR.AddResource(CSRVocabPhrase, ListID, "Schedule Meeting")
ChantSR.EnableResource(CSRGrammarVocab, VocabID)
ChantSR.EnableResource(CSRVocabList, ListID)
XML grammar contains a placeholder for the dynamic rule list:
<GRAMMAR LANGID="409">
<RULE NAME="rulelistname" DYNAMIC="TRUE" TOPLEVEL="ACTIVE">
<P>placeholder</P>
</RULE>
</GRAMMAR>
Status
Fixed in SpeechKit 4 build 4.0.76.0.
Component Formats Impacted
All formats.