Public Member Functions | |
virtual UAPI_EXPORT void | addItem (const char *slotName, const SlotItemProxy &item, int weight, const char *semanticMeaning, ReturnCode::Type &returnCode)=0 |
virtual UAPI_EXPORT void | addItemList (const char *slotName, SlotItemProxy **items, int *weights, const char **semanticMeanings, ARRAY_LIMIT itemsCount, ReturnCode::Type &returnCode)=0 |
virtual void | compileAllSlots (ReturnCode::Type &returnCode)=0 |
virtual void | resetAllSlots (ReturnCode::Type &returnCode)=0 |
virtual void | save (const char *path, ReturnCode::Type &returnCode)=0 |
virtual void | load (ReturnCode::Type &returnCode)=0 |
virtual void | unload (ReturnCode::Type &returnCode)=0 |
Protected Member Functions | |
UAPI_EXPORT | SrecGrammar () |
virtual UAPI_EXPORT | ~SrecGrammar () |
Friends | |
class | SrecGrammarProxy |
class | EmbeddedGrammarProxy |
class | GrammarProxy |
UAPI_EXPORT android.speech.recognition.SrecGrammar.SrecGrammar | ( | ) | [protected] |
Prevent construction.
virtual UAPI_EXPORT android.speech.recognition.SrecGrammar.~SrecGrammar | ( | ) | [protected, virtual] |
Prevent destruction.
virtual UAPI_EXPORT void android.speech.recognition.SrecGrammar.addItem | ( | const char * | slotName, | |
const SlotItemProxy & | item, | |||
int | weight, | |||
const char * | semanticMeaning, | |||
ReturnCode::Type & | returnCode | |||
) | [pure virtual] |
Adds an item to a slot.
slotName | the name of the slot | |
item | the item to add to the slot. | |
weight | the weight of the item. Smaller values are more likely to get recognized. This should be >= 0. | |
semanticMeaning | the value that will be returned if this item is recognized. This should be of the form "V='Jen_Parker'" | |
returnCode | ILLEGAL_ARGUMENT if slotName, item or semanticMeaning are null or if semanticMeaning is not in the form "key=value". ILLEGAL_STATE if the associated recognizer has been deleted. HOMONYM_COLLISION if another item with the same pronunciation already exists in the slot. |
virtual UAPI_EXPORT void android.speech.recognition.SrecGrammar.addItemList | ( | const char * | slotName, | |
SlotItemProxy ** | items, | |||
int * | weights, | |||
const char ** | semanticMeanings, | |||
ARRAY_LIMIT | itemsCount, | |||
ReturnCode::Type & | returnCode | |||
) | [pure virtual] |
Add a list of item to a slot.
slotName | the name of the slot | |
items | the array of SlotItems to add to the slot. | |
weights | the array of weights for each item in the list. Smaller values are more likely to get recognized. This should be >= 0. | |
semanticMeanings | the array of strings that will be returned for each item during recognition. | |
itemsCount | number of items in the list |
IllegalArgumentException | if slotName, items, weights or semanticMeanings are null;if any semanticMeaning of the list is not of the format "V='Jen_Parker' if the size of list parameters is not equal." |
virtual void android.speech.recognition.EmbeddedGrammar.compileAllSlots | ( | ReturnCode::Type & | returnCode | ) | [pure virtual, inherited] |
Compiles items that were added to any of the grammar slots.
returnCode | ILLEGAL_ARGUMENT if the associated recognizer has been deleted |
virtual void android.speech.recognition.EmbeddedGrammar.resetAllSlots | ( | ReturnCode::Type & | returnCode | ) | [pure virtual, inherited] |
Removes all words added to all slots.
returnCode | ILLEGAL_ARGUMENT if the associated recognizer has been deleted |
virtual void android.speech.recognition.EmbeddedGrammar.save | ( | const char * | path, | |
ReturnCode::Type & | returnCode | |||
) | [pure virtual, inherited] |
Saves the compiled grammar.
path | the path to save the grammar to | |
returnCode | ILLEGAL_ARGUMENT if the associated recognizer has been deleted |
virtual void android.speech.recognition.Grammar.load | ( | ReturnCode::Type & | returnCode | ) | [pure virtual, inherited] |
Indicates that the grammar will be used in the near future.
returnCode | ILLEGAL_ARGUMENT if the associated recognizer has been deleted |
virtual void android.speech.recognition.Grammar.unload | ( | ReturnCode::Type & | returnCode | ) | [pure virtual, inherited] |
Indicates that the grammar won't be used in the near future.
returnCode | ILLEGAL_ARGUMENT if the associated recognizer has been deleted |