public class AllphoneLinguist extends java.lang.Object implements Linguist
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROP_ACOUSTIC_MODEL
The property that defines the acoustic model to use when building the search graph
|
static java.lang.String |
PROP_CD
The property that controls whether to use context dependent phones.
|
static java.lang.String |
PROP_PIP
The property that controls phone insertion probability.
|
PROP_FILLER_INSERTION_PROBABILITY, PROP_LANGUAGE_WEIGHT, PROP_SILENCE_INSERTION_PROBABILITY, PROP_UNIT_INSERTION_PROBABILITY, PROP_WORD_INSERTION_PROBABILITY
Constructor and Description |
---|
AllphoneLinguist() |
Modifier and Type | Method and Description |
---|---|
void |
allocate()
Allocates the linguist.
|
void |
deallocate()
Deallocates the linguist.
|
AcousticModel |
getAcousticModel() |
java.util.ArrayList<HMM> |
getCDSuccessors(Unit lc,
Unit base) |
java.util.ArrayList<HMM> |
getCISuccessors() |
float |
getPhoneInsertionProb() |
SearchGraph |
getSearchGraph()
Retrieves search graph.
|
java.util.ArrayList<Unit> |
getUnits(SenoneSequence senoneSeq) |
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
void |
startRecognition()
Called before a recognition.
|
void |
stopRecognition()
Called after a recognition.
|
boolean |
useContextDependentPhones() |
@S4Component(type=AcousticModel.class) public static final java.lang.String PROP_ACOUSTIC_MODEL
@S4Double(defaultValue=0.05) public static final java.lang.String PROP_PIP
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_CD
public void newProperties(PropertySheet ps) throws PropertyException
Configurable
newProperties
in interface Configurable
ps
- a property sheet holding the new dataPropertyException
- if there is a problem with the properties.public SearchGraph getSearchGraph()
Linguist
Implementor's note: This method is typically called at the beginning of each recognition and therefore should be
getSearchGraph
in interface Linguist
public void startRecognition()
Linguist
Implementor's Note - Some linguists (or underlying lanaguge or acoustic models) may keep caches or pools that need to be initialzed before a recognition. A linguist may implement this method to perform such initialization. Note however, that an ideal linguist will, once allocated, be state-less. This will allow the linguist to be shared by multiple simulataneous searches. Reliance on a 'startRecognition' may prevent a linguist from being used in a multi-threaded search.
startRecognition
in interface Linguist
public void stopRecognition()
Linguist
Implementor's Note - Some linguists (or underlying lanaguge or acoustic models) may keep caches or pools that need to be flushed after a recognition. A linguist may implement this method to perform such flushing. Note however, that an ideal linguist will once allocated, be state-less. This will allow the linguist to be shared by multiple simulataneous searches. Reliance on a 'stopRecognition' may prevent a linguist from being used in a multi-threaded search.
stopRecognition
in interface Linguist
public void allocate() throws java.io.IOException
Linguist
Implementor's Note - A well written linguist will allow allocate to be called multiple times without harm. This will allow a linguist to be shared by multiple search managers.
public void deallocate() throws java.io.IOException
Linguist
Implementor's Note - if the linguist is being shared by multiple searches, the deallocate should only actually deallocate things when the last call to deallocate is made. Two approaches for dealing with this:
(1) Keep an allocation counter that is incremented during allocate and decremented during deallocate. Only when the counter reaches zero should the actually deallocation be performed.
(2) Do nothing in dellocate - just the the GC take care of things
deallocate
in interface Linguist
java.io.IOException
- if an IO error occurspublic AcousticModel getAcousticModel()
public float getPhoneInsertionProb()
public boolean useContextDependentPhones()
public java.util.ArrayList<HMM> getCISuccessors()
public java.util.ArrayList<Unit> getUnits(SenoneSequence senoneSeq)