Ejemplo n.º 1
0
 public float[] GetComponentScore(IData feature)
 {
     return(HmmState.CalculateComponentScore(feature));
 }
Ejemplo n.º 2
0
        /**
         * /// Retrieves the set of successors for this state
         *
         * /// @return the list of successor states
         */
        public override ISearchStateArc[] GetSuccessors()
        {
            var nextStates = GetCachedArcs();

            if (nextStates == null)
            {
                //if this is an exit state, we are transitioning to a
                //new unit or to a word end.

                if (HmmState.IsExitState())
                {
                    if (_parentNode == null)
                    {
                        nextStates = base.GetSuccessors();
                    }
                    else
                    {
                        nextStates = base.GetSuccessors(_parentNode);
                    }
                }
                else
                {
                    //The current hmm state is not an exit state, so we
                    //just go through the next set of successors

                    var arcs = HmmState.GetSuccessors();
                    nextStates = new ISearchStateArc[arcs.Length];
                    for (var i = 0; i < arcs.Length; i++)
                    {
                        var arc = arcs[i];
                        if (arc.HmmState.IsEmitting)
                        {
                            //if its a self loop and the prob. matches
                            //reuse the state
                            if (arc.HmmState == HmmState &&
                                _logInsertionProbability == arc.LogProbability)
                            {
                                nextStates[i] = this;
                            }
                            else
                            {
                                nextStates[i] = new LexTreeHmmState(
                                    (HMMNode)GetNode(), WordHistory,
                                    SmearTerm, SmearProb,
                                    arc.HmmState, Parent.LogOne,
                                    arc.LogProbability, _parentNode, Parent);
                            }
                        }
                        else
                        {
                            nextStates[i] = new LexTreeNonEmittingHMMState(
                                (HMMNode)GetNode(), WordHistory,
                                SmearTerm, SmearProb,
                                arc.HmmState,
                                arc.LogProbability, _parentNode, Parent);
                        }
                    }
                }
                PutCachedArcs(nextStates);
            }
            return(nextStates);
        }
Ejemplo n.º 3
0
 public float GetScore(IData data)
 {
     return(HmmState.GetScore(data));
 }
Ejemplo n.º 4
0
 public PitchHmmGenerationResult(HiddenMarkovModel <PitchHmmState, PitchHmmEmission> model, HmmState <PitchHmmState, PitchHmmEmission> startState)
 {
     this.Model      = model;
     this.StartState = startState;
 }