public class TrivialAcousticModel extends java.lang.Object implements AcousticModel
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LEFT_CONTEXT_SIZE
Defines the left context size
|
static java.lang.String |
RIGHT_CONTEXT_SIZE |
PROP_LOCATION
Constructor and Description |
---|
TrivialAcousticModel() |
TrivialAcousticModel(int leftContextSize,
int rightContextSize) |
Modifier and Type | Method and Description |
---|---|
void |
allocate()
Gets this acoustic model ready to use, allocating all necessary resources.
|
void |
deallocate()
Deallocates previously allocated resources
|
java.util.Iterator<Unit> |
getContextIndependentUnitIterator()
Returns an iterator that can be used to iterate through all the CI units in the acoustic model
|
java.util.Iterator<HMM> |
getHMMIterator()
Returns an iterator that can be used to iterate through all the HMMs of the acoustic model
|
int |
getLeftContextSize()
Returns the size of the left context for context dependent units
|
java.lang.String |
getName()
Returns the name of this AcousticModel, or null if it has no name.
|
java.util.Properties |
getProperties()
Returns the properties of this acoustic model.
|
int |
getRightContextSize()
Returns the size of the right context for context dependent units
|
HMM |
lookupNearestHMM(Unit unit,
HMMPosition position,
boolean exactMatch)
Given a unit, returns the HMM that best matches the given unit.
|
void |
newProperties(PropertySheet ps)
This method is called when this configurable component needs to be reconfigured.
|
@S4Integer(defaultValue=1) public static final java.lang.String LEFT_CONTEXT_SIZE
@S4Integer(defaultValue=1) public static final java.lang.String RIGHT_CONTEXT_SIZE
public TrivialAcousticModel(int leftContextSize, int rightContextSize)
public TrivialAcousticModel()
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 java.lang.String getName()
getName
in interface AcousticModel
public java.util.Properties getProperties()
getProperties
in interface AcousticModel
public HMM lookupNearestHMM(Unit unit, HMMPosition position, boolean exactMatch)
lookupNearestHMM
in interface AcousticModel
unit
- the unit of interestposition
- the position of the unit of interestexactMatch
- if true, only an exact match is acceptable.public java.util.Iterator<HMM> getHMMIterator()
getHMMIterator
in interface AcousticModel
HMM
.public java.util.Iterator<Unit> getContextIndependentUnitIterator()
getContextIndependentUnitIterator
in interface AcousticModel
Unit
public int getLeftContextSize()
getLeftContextSize
in interface AcousticModel
public int getRightContextSize()
getRightContextSize
in interface AcousticModel
public void allocate() throws java.io.IOException
AcousticModel
allocate
in interface AcousticModel
java.io.IOException
- if the model could not be loadedpublic void deallocate()
AcousticModel
deallocate
in interface AcousticModel