Exemple #1
0
        /**
         * /// Calculate the acoustic scores for the active list. The active list should contain only emitting tokens.
         *
         * /// @return <code>true</code> if there are more frames to score, otherwise, false
         */
        protected Boolean scoreTokens()
        {
            Boolean moreTokens;

            scoreTimer.start();
            IData data = scorer.calculateScores(activeList.getTokens().ConvertAll(x => (IScoreable)x));

            scoreTimer.stop();

            Token bestToken = null;

            if (data is Token)
            {
                bestToken = (Token)data;
            }
            else if (data == null)
            {
                streamEnd = true;
            }

            moreTokens = (bestToken != null);
            activeList.setBestToken(bestToken);

            //monitorWords(activeList);
            monitorStates(activeList);

            // System.out.println("BEST " + bestToken);

            curTokensScored.value   += activeList.size();
            totalTokensScored.value += activeList.size();

            return(moreTokens);
        }
Exemple #2
0
        /// <summary>
        /// Calculate the acoustic scores for the active list. The active list should contain only emitting tokens.
        /// </summary>
        /// <returns><code>true</code> if there are more frames to score, otherwise, false</returns>
        protected bool scoreTokens()
        {
            bool hasMoreFrames = false;

            scoreTimer.start();
            IData data = scorer.calculateScores(activeList.getTokens().ConvertAll(x => (IScoreable)x));

            scoreTimer.stop();

            Token bestToken = null;

            if (data is Token)
            {
                bestToken = (Token)data;
            }
            else if (data == null)
            {
                streamEnd = true;
            }

            if (bestToken != null)
            {
                hasMoreFrames = true;
                activeList.setBestToken(bestToken);
            }

            // update statistics
            curTokensScored.value   += activeList.size();
            totalTokensScored.value += activeList.size();
            tokensPerSecond.value    = totalTokensScored.value / getTotalTime();

            //        if (logger.isLoggable(Level.FINE)) {
            //            logger.fine(currentFrameNumber + " " + activeList.size()
            //                    + " " + curTokensScored.value + " "
            //                    + (int) tokensPerSecond.value);
            //        }

            return(hasMoreFrames);
        }