protected internal virtual void growBranches()
        {
            int num = this.activeList.size() * 10;

            if (num == 0)
            {
                num = 1;
            }
            this.growTimer.start();
            this.bestTokenMap = new HashMap(num);
            ActiveList activeList = this.activeList;

            this.resultList    = new LinkedList();
            this.activeList    = this.activeListFactory.newInstance();
            this.threshold     = activeList.getBeamThreshold();
            this.wordThreshold = activeList.getBestScore() + this.logRelativeWordBeamWidth;
            Iterator iterator = activeList.iterator();

            while (iterator.hasNext())
            {
                Token token = (Token)iterator.next();
                this.collectSuccessorTokens(token);
            }
            this.growTimer.stop();
            if (this.logger.isLoggable(Level.FINE))
            {
                int num2 = this.activeList.size();
                this.totalHmms += num2;
                this.logger.fine(new StringBuilder().append("Frame: ").append(this.currentFrameNumber).append(" Hmms: ").append(num2).append("  total ").append(this.totalHmms).toString());
            }
        }
Beispiel #2
0
        public static List <Token> GetTokenCollection(ActiveList activeList)
        {
            var      tokens = new List <Token>();
            Iterator iter   = activeList.iterator();

            while (iter.hasNext())
            {
                var token = (Token)iter.next();
                tokens.Add(token);
            }

            return(tokens);
        }
Beispiel #3
0
        protected internal virtual void growFastmatchBranches()
        {
            this.growTimer.start();
            ActiveList activeList = this.fastmatchActiveList;

            this.fastmatchActiveList = this.fastmatchActiveListFactory.newInstance();
            float beamThreshold = activeList.getBeamThreshold();

            float[] array = new float[1024];
            Arrays.fill(array, float.MinValue);
            float    num      = float.MinValue;
            Iterator iterator = activeList.iterator();

            while (iterator.hasNext())
            {
                Token token = (Token)iterator.next();
                float score = token.getScore();
                if (score >= beamThreshold)
                {
                    if (token.getSearchState() is PhoneHmmSearchState)
                    {
                        int baseId = ((PhoneHmmSearchState)token.getSearchState()).getBaseId();
                        if (array[baseId] < score)
                        {
                            array[baseId] = score;
                        }
                        if (num < score)
                        {
                            num = score;
                        }
                    }
                    this.collectFastMatchSuccessorTokens(token);
                }
            }
            this.ciScores.add(new WordPruningBreadthFirstLookaheadSearchManager.FrameCiScores(this, array, num));
            this.growTimer.stop();
        }