|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sphinx.result.Node
public class Node
A node is part of Lattices, representing the theory that a word was spoken over a given period of time. A node also has a set of entering and leaving
edges
, connecting it to other nodes. One can get
and set the beginning and end frames of the word via the getBeginTime and getEndTime methods. When setting these
times, the beginning time must be earlier or equal to the end time, otherwise an error will be thrown.
The posterior probability of any word in a word lattice is the probability that the node representing that word
occurs on any path through the lattice. It is usually computed as the ratio of the total likelihood scores of all
paths through the lattice that pass through the node, to the total likelihood score of all paths through the lattice.
Path scores are usually computed using the acoustic likelihoods of the nodes, although language scores can also be
incorporated. The posterior probabilities of an entire lattice is usually computed efficiently using the
Forward-Backward Algorithm. Refer to the computeNodePosteriors
method in the Lattice class for details.
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Assumes ids are unique node identifiers |
Edge |
findEquivalentLeavingEdge(Edge edge)
Returns a leaving edge that is equivalent to the given edge. |
double |
getBackwardScore()
Returns the backward score, which is calculated during the computation of the posterior score for this node. |
int |
getBeginTime()
Get the frame number when the word began |
Node |
getBestPredecessor()
Returns the best predecessor for this node. |
java.util.List |
getChildNodes()
Get the nodes at the other ends of outgoing edges of this node. |
java.util.Collection |
getCopyOfLeavingEdges()
Returns a copy of the Edges from this Node, so that the underlying data structure will not be modified. |
Edge |
getEdgeFromNode(Node n)
given a node find the edge from that node |
Edge |
getEdgeToNode(Node n)
given a node find the edge to that node |
int |
getEndTime()
Get the frame number when the word ends |
java.util.Collection |
getEnteringEdges()
Get the Edges to this Node |
double |
getForwardScore()
Returns the forward score, which is calculated during the computation of the posterior score for this node. |
java.lang.String |
getId()
Get the ID associated with this Node |
java.util.Collection |
getLeavingEdges()
Get the Edges from this Node |
double |
getPosterior()
Returns the posterior probability of this node. |
double |
getViterbiScore()
Returns the Viterbi score for this node. |
Word |
getWord()
Get the word associated with this Node |
boolean |
hasAncestralRelationship(Node node)
Check whether this node has an ancestral relationship with another node (i.e. either this node is an ancestor of the other node, or vice versa) |
boolean |
hasEquivalentLeavingEdges(Node n)
Test if a Node has all Edges to the same Nodes and another Node. |
int |
hashCode()
|
boolean |
isAncestorOf(Node node)
Check whether this node is an ancestor of another node. |
boolean |
isEquivalent(Node other)
Returns true if the given node is equivalent to this node. |
void |
removeLeavingEdge(Edge e)
Remove an Edge to this Node |
void |
setBackwardScore(double backwardScore)
Sets the backward score for this node. |
void |
setBeginTime(int beginTime)
Sets the frame number when the word began. |
void |
setBestPredecessor(Node bestPredecessor)
Sets the best predecessor of this node. |
void |
setEndTime(int endTime)
Sets the frame number when the words ended. |
void |
setForwardScore(double forwardScore)
Sets the backward score for this node. |
void |
setPosterior(double posterior)
Sets the posterior probability of this node. |
void |
setViterbiScore(double viterbiScore)
Sets the Viterbi score for this node. |
java.lang.String |
toString()
Returns a description of this Node that contains the word, the start time, and the end time. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Edge getEdgeToNode(Node n)
n
- the node of interest
null
if no edge could be found.public Edge getEdgeFromNode(Node n)
n
- the node of interest
null
if no edge could be found.public boolean hasEquivalentLeavingEdges(Node n)
n
- the node of interest
public java.util.Collection getEnteringEdges()
public java.util.Collection getLeavingEdges()
public java.util.Collection getCopyOfLeavingEdges()
public void removeLeavingEdge(Edge e)
e
- the edge to removepublic java.lang.String getId()
public Word getWord()
public int getBeginTime()
public void setBeginTime(int beginTime)
beginTime
- the frame number when the word beganpublic int getEndTime()
public void setEndTime(int endTime)
endTime
- the frame number when the word endedpublic java.lang.String toString()
toString
in class java.lang.Object
public double getBackwardScore()
public void setBackwardScore(double backwardScore)
backwardScore
- The backwardScore to set.public double getForwardScore()
public void setForwardScore(double forwardScore)
forwardScore
- The forwardScore to set.public double getPosterior()
public void setPosterior(double posterior)
posterior
- The node posterior probability to set.public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.util.List getChildNodes()
public boolean isAncestorOf(Node node)
node
- the Node to check
public boolean hasAncestralRelationship(Node node)
node
- the Node to check for a relationship
public boolean isEquivalent(Node other)
other
- the Node we're comparing to
public Edge findEquivalentLeavingEdge(Edge edge)
edge
- the Edge to compare the leaving edges of this node against
public Node getBestPredecessor()
public void setBestPredecessor(Node bestPredecessor)
bestPredecessor
- The bestPredecessor to set.public double getViterbiScore()
public void setViterbiScore(double viterbiScore)
viterbiScore
- The viterbiScore to set.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |