public class Recognizer.Grammar extends Object
Constructor and Description |
---|
Recognizer.Grammar(String g2gFileName)
Create a
Grammar instance. |
Modifier and Type | Method and Description |
---|---|
void |
addWordToSlot(String slot,
String word,
String pron,
int weight,
String tag)
Add a word to a slot.
|
void |
compile()
Compile all slots.
|
void |
destroy()
Release resources associated with this
Grammar . |
protected void |
finalize()
Clean up resources.
|
void |
resetAllSlots()
Reset all slots.
|
void |
save(String g2gFileName)
Save
Grammar to g2g file. |
void |
setupRecognizer()
Setup
Grammar with Recognizer . |
public Recognizer.Grammar(String g2gFileName) throws IOException
Grammar
instance.g2gFileName
- pathname of g2g file.IOException
public void resetAllSlots()
public void addWordToSlot(String slot, String word, String pron, int weight, String tag)
slot
- slot name.word
- word to insert.pron
- pronunciation, or null to derive from word.weight
- weight to give the word. One is normal, 50 is low.tag
- semantic meaning tag string.public void compile()
public void setupRecognizer()
Grammar
with Recognizer
.public void save(String g2gFileName) throws IOException
Grammar
to g2g file.g2gFileName
- IOException
public void destroy()
Grammar
.