edu.cmu.sphinx.linguist.acoustic.tiedstate
Class CompositeSenone

java.lang.Object
  extended byedu.cmu.sphinx.linguist.acoustic.tiedstate.CompositeSenone
All Implemented Interfaces:
Senone, java.io.Serializable

public class CompositeSenone
extends java.lang.Object
implements Senone, java.io.Serializable

Represents a composite senone. A composite senone consists of a set of all possible senones for a given state. CompositeSenones are used when the exact context of a senone is not known. The CompositeSenone represents all the possible senones.

This class currently only needs to be public for testing purposes.

Note that all scores are maintained in LogMath log base

See Also:
Serialized Form

Constructor Summary
CompositeSenone(Senone[] senones, float weight)
          Constructs a CompositeSenone given the set of constiuent senones
 
Method Summary
 float[] calculateComponentScore(Data feature)
          Calculate scores for each component in the senone's distribution.
static CompositeSenone create(java.util.Collection senoneCollection, float weight)
          a factory method that creates a CompositeSenone from a list of senones.
 void dump(java.lang.String msg)
          Dumps this senone
 boolean equals(java.lang.Object o)
          Determines if two objects are equal
 long getID()
          Gets the ID for this senone
 float getScore(Data feature)
          Calculates the composite senone score.
 Senone[] getSenones()
          Returns the set of senones that compose this composite senone.
 int hashCode()
          Returns the hashcode for this object
 java.lang.String toString()
          Retrieves a string form of this object
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeSenone

public CompositeSenone(Senone[] senones,
                       float weight)
Constructs a CompositeSenone given the set of constiuent senones

Parameters:
senones - the set of constiuent senones
Method Detail

create

public static CompositeSenone create(java.util.Collection senoneCollection,
                                     float weight)
a factory method that creates a CompositeSenone from a list of senones.

Parameters:
senoneCollection - the Collection of senones
Returns:
a composite senone

dump

public void dump(java.lang.String msg)
Dumps this senone

Specified by:
dump in interface Senone
Parameters:
msg - annotatin for the dump

getScore

public float getScore(Data feature)
Calculates the composite senone score. Typically this is the best score for all of the constituent senones

Specified by:
getScore in interface Senone
Parameters:
feature - the feature to score
Returns:
the score for the feature in logmath log base

calculateComponentScore

public float[] calculateComponentScore(Data feature)
Calculate scores for each component in the senone's distribution. Not yet implemented.

Specified by:
calculateComponentScore in interface Senone
Parameters:
feature - the current feature
Returns:
the score for the feature in LogMath

getSenones

public Senone[] getSenones()
Returns the set of senones that compose this composite senone. This method is only needed for unit testing.

Returns:
the array of senones.

equals

public boolean equals(java.lang.Object o)
Determines if two objects are equal

Parameters:
o - the object to compare to this.
Returns:
true if the objects are equal

hashCode

public int hashCode()
Returns the hashcode for this object

Returns:
the hashcode

getID

public long getID()
Gets the ID for this senone

Specified by:
getID in interface Senone
Returns:
the senone id

toString

public java.lang.String toString()
Retrieves a string form of this object

Returns:
the string representation of this object