Exemple #1
0
        /// <summary>
        /// Adds an EndNode to the set of successors for this node If a node similar to the child has already been added, we
        /// use the previously added node, otherwise we add this.
        /// </summary>
        /// <param name="child">the endNode to add</param>
        /// <param name="probability"></param>
        /// <returns></returns>
        public EndNode AddSuccessor(EndNode child, float probability)
        {
            if (child == null)
            {
                return(null);
            }
            Unit    baseUnit      = child.BaseUnit;
            EndNode matchingChild = (EndNode)GetSuccessor(baseUnit);

            if (matchingChild == null)
            {
                PutSuccessor(baseUnit, child);
            }
            else
            {
                if (matchingChild.UnigramProbability < probability)
                {
                    matchingChild.UnigramProbability = probability;
                }
                child = matchingChild;
            }
            return(child);
        }
 /**
  * /// Gets the set of HMM nodes associated with the given end node
  *
  * /// @param endNode the end node
  * /// @return an array of associated HMM nodes
  */
 public HMMNode[] GetHMMNodes(EndNode endNode)
 {
     return(HMMTree.GetHMMNodes(endNode));
 }