Build 1.0_r1(from source)

android.speech.recognition
Interface SrecGrammar

All Superinterfaces:
EmbeddedGrammar, Grammar
All Known Implementing Classes:
SrecGrammarImpl

public interface SrecGrammar
extends EmbeddedGrammar

Grammar on an SREC recognizer.


Nested Class Summary
static class SrecGrammar.Item
          SrecGrammar Item
 
Method Summary
 void addItem(String slotName, SlotItem item, int weight, String semanticMeaning)
          Adds an item to a slot.
 void addItemList(String slotName, Vector<SrecGrammar.Item> items)
          Add a list of item to a slot.
 
Methods inherited from interface android.speech.recognition.EmbeddedGrammar
compileAllSlots, resetAllSlots, save
 
Methods inherited from interface android.speech.recognition.Grammar
dispose, load, unload
 

Method Detail

addItem

void addItem(String slotName,
             SlotItem item,
             int weight,
             String semanticMeaning)
             throws IllegalArgumentException
Adds an item to a slot.

Parameters:
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.
Throws:
IllegalArgumentException - if slotName, item or semanticMeaning are null; if semanticMeaning is not of the format "V='Jen_Parker'"

addItemList

void addItemList(String slotName,
                 Vector<SrecGrammar.Item> items)
                 throws IllegalArgumentException
Add a list of item to a slot.

Parameters:
slotName - the name of the slot
items - the vector of SrecGrammar.Item to add to the slot.
Throws:
IllegalArgumentException - if slotName,items are null or any element in the items(_item, _semanticMeaning) is null; if any semanticMeaning of the list is not of the format "key='value'"

Build 1.0_r1(from source)

Please submit a feedback, bug or feature