marytts.unitselection.data
Class FeatureFileReader

java.lang.Object
  extended by marytts.unitselection.data.FeatureFileReader
Direct Known Subclasses:
HalfPhoneFeatureFileReader

public class FeatureFileReader
extends java.lang.Object


Field Summary
protected  FeatureDefinition featureDefinition
           
protected  FeatureVector[] featureVectors
           
protected  MaryHeader hdr
           
 
Constructor Summary
FeatureFileReader()
          Empty constructor; need to call load() separately when using this.
FeatureFileReader(java.lang.String fileName)
           
 
Method Summary
 FeatureVector[] getCopyOfFeatureVectors()
          Return a shallow copy of the array of feature vectors.
 FeatureDefinition getFeatureDefinition()
           
static FeatureFileReader getFeatureFileReader(java.lang.String fileName)
           
 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()
           
 boolean load(java.io.DataInputStream dis)
           
 void load(java.lang.String fileName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hdr

protected MaryHeader hdr

featureDefinition

protected FeatureDefinition featureDefinition

featureVectors

protected FeatureVector[] featureVectors
Constructor Detail

FeatureFileReader

public FeatureFileReader()
Empty constructor; need to call load() separately when using this.

See Also:
load(String)

FeatureFileReader

public FeatureFileReader(java.lang.String fileName)
                  throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getFeatureFileReader

public static FeatureFileReader getFeatureFileReader(java.lang.String fileName)
                                              throws java.io.IOException
Throws:
java.io.IOException

load

public void load(java.lang.String fileName)
          throws java.io.IOException
Throws:
java.io.IOException

load

public boolean load(java.io.DataInputStream dis)
             throws java.io.IOException
Throws:
java.io.IOException

getFeatureVector

public FeatureVector getFeatureVector(int unitIndex)
Get the unit feature vector for the given unit index number.

Parameters:
unitIndex - the absolute index number of a unit in the database
Returns:
the corresponding feature vector

getCopyOfFeatureVectors

public FeatureVector[] getCopyOfFeatureVectors()
Return a shallow copy of the array of feature vectors.

Returns:
a new array containing the internal feature vectors

getFeatureVectors

public FeatureVector[] getFeatureVectors()
Return the internal array of feature vectors.

Returns:
the internal array of feature vectors.

getFeatureVector

public FeatureVector getFeatureVector(Unit unit)
Get the unit feature vector for the given unit.

Parameters:
unit - a unit in the database
Returns:
the corresponding feature vector

getFeatureDefinition

public FeatureDefinition getFeatureDefinition()

getNumberOfUnits

public int getNumberOfUnits()