public class FeatureFileReader extends Object
Modifier and Type | Field and Description |
---|---|
protected FeatureDefinition |
featureDefinition |
protected FeatureVector[] |
featureVectors |
protected MaryHeader |
hdr |
Constructor and Description |
---|
FeatureFileReader()
Empty constructor; need to call load() separately when using this.
|
FeatureFileReader(String fileName) |
Modifier and Type | Method and Description |
---|---|
FeatureVector[] |
featureVectorMapping(FeatureDefinition newFeatureDefinition)
feature vector mapping according to new feature definition Note: The new feature definition should be a subset of original
feature definition
|
FeatureVector[] |
getCopyOfFeatureVectors()
Return a shallow copy of the array of feature vectors.
|
FeatureDefinition |
getFeatureDefinition() |
static FeatureFileReader |
getFeatureFileReader(String fileName)
Get a feature file reader representing the given feature file.
|
FeatureVector |
getFeatureVector(int unitIndex)
Get the unit feature vector for the given unit index number.
|
FeatureVector |
getFeatureVector(Unit unit)
Get the unit feature vector for the given unit.
|
FeatureVector[] |
getFeatureVectors()
Return the internal array of feature vectors.
|
int |
getNumberOfUnits() |
void |
load(String fileName) |
protected void |
loadFromByteBuffer(String fileName) |
protected void |
loadFromStream(String fileName) |
protected MaryHeader hdr
protected FeatureDefinition featureDefinition
protected FeatureVector[] featureVectors
public FeatureFileReader()
load(String fileName)
public FeatureFileReader(String fileName) throws IOException, MaryConfigurationException
public static FeatureFileReader getFeatureFileReader(String fileName) throws IOException, MaryConfigurationException
fileName
- the filename of a valid feature file.IOException
- if there was a problem reading the fileMaryConfigurationException
- if the file is not a valid feature file.public void load(String fileName) throws IOException, MaryConfigurationException
protected void loadFromStream(String fileName) throws IOException, MaryConfigurationException
protected void loadFromByteBuffer(String fileName) throws IOException, MaryConfigurationException
public FeatureVector getFeatureVector(int unitIndex)
unitIndex
- the absolute index number of a unit in the databasepublic FeatureVector[] getCopyOfFeatureVectors()
public FeatureVector[] getFeatureVectors()
public FeatureVector[] featureVectorMapping(FeatureDefinition newFeatureDefinition)
newFeatureDefinition
- newFeatureDefinitionpublic FeatureVector getFeatureVector(Unit unit)
unit
- a unit in the databasepublic FeatureDefinition getFeatureDefinition()
public int getNumberOfUnits()
Copyright © 2000–2016 DFKI GmbH. All rights reserved.