Esempio n. 1
0
        /**
         * /// Goes through the active list of tokens and expands each token, finding the set of successor tokens until all the
         * /// successor tokens are emitting tokens.
         */
        protected void growBranches()
        {
            int mapSize = activeList.size() * 10;

            if (mapSize == 0)
            {
                mapSize = 1;
            }
            growTimer.start();
            bestTokenMap = new Dictionary <ISearchState, Token>(mapSize);
            ActiveList oldActiveList = activeList;

            resultList    = new List <Token>();
            activeList    = activeListFactory.newInstance();
            threshold     = oldActiveList.getBeamThreshold();
            wordThreshold = oldActiveList.getBestScore() + logRelativeWordBeamWidth;

            foreach (Token token in oldActiveList.getTokens())
            {
                collectSuccessorTokens(token);
            }
            growTimer.stop();

            #if Debug
            int hmms = activeList.size();
            totalHmms += hmms;
            Trace.WriteLine("Frame: " + currentFrameNumber + " Hmms: "
                            + hmms + "  total " + totalHmms);
                #endif
        }
Esempio n. 2
0
        /**
         * /// Goes through the active list of tokens and expands each token, finding the set of successor tokens until all the
         * /// successor tokens are emitting tokens.
         */
        protected void growBranches()
        {
            growTimer.start();
            float relativeBeamThreshold = activeList.getBeamThreshold();

            Trace.WriteLine("Frame: " + currentFrameNumber
                            + " thresh : " + relativeBeamThreshold + " bs "
                            + activeList.getBestScore() + " tok "
                            + activeList.getBestToken());
            foreach (Token token in activeList.getTokens())
            {
                if (token.getScore() >= relativeBeamThreshold && allowExpansion(token))
                {
                    collectSuccessorTokens(token);
                }
            }
            growTimer.stop();
        }