android.speech.recognition
Class WordItem
java.lang.Object
android.speech.recognition.WordItem
- All Implemented Interfaces:
- SlotItem
- Direct Known Subclasses:
- WordItemImpl
public abstract class WordItem
- extends Object
- implements SlotItem
Word that may be inserted into an embedded grammar slot.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WordItem
public WordItem()
valueOf
public static WordItem valueOf(String word,
String[] pronunciations)
throws IllegalArgumentException
- Creates a new WordItem.
- Parameters:
word - the word to insertpronunciations - the pronunciations to associated with the item. If the list is
is empty (example:new String[0]) the recognizer will attempt to guess the pronunciations.
- Returns:
- the WordItem
- Throws:
IllegalArgumentException - if word is null or if pronunciations is
null or pronunciations contains an element equal to null or empty string.
valueOf
public static WordItem valueOf(String word,
String pronunciation)
throws IllegalArgumentException
- Creates a new WordItem.
- Parameters:
word - the word to insertpronunciation - the pronunciation to associate with the item. If it
is null the recognizer will attempt to guess the pronunciations.
- Returns:
- the WordItem
- Throws:
IllegalArgumentException - if word is null or if pronunciation is
an empty string
Please submit a feedback, bug or feature