Beispiel #1
0
            protected internal virtual HMMStateState expandHMMTree(UnitState parent, HMMStateState tree)
            {
                HMMStateState result = tree;

                HMMStateArc[] successors = tree.getHMMState().getSuccessors();
                int           num        = successors.Length;

                for (int i = 0; i < num; i++)
                {
                    HMMStateArc   hmmstateArc = successors[i];
                    HMMStateState hmmstateState;
                    if (hmmstateArc.getHMMState().isEmitting())
                    {
                        hmmstateState = new HMMStateState(parent, hmmstateArc.getHMMState());
                    }
                    else
                    {
                        hmmstateState = new NonEmittingHMMState(parent, hmmstateArc.getHMMState());
                    }
                    SentenceHMMState existingState  = this.getExistingState(hmmstateState);
                    float            logProbability = hmmstateArc.getLogProbability();
                    if (existingState != null)
                    {
                        this.attachState(tree, existingState, 0f, logProbability);
                    }
                    else
                    {
                        this.attachState(tree, hmmstateState, 0f, logProbability);
                        this.addStateToCache(hmmstateState);
                        result = this.expandHMMTree(parent, hmmstateState);
                    }
                }
                return(result);
            }