示例#1
0
        /**
         * /// Performs the recognition for the given number of frames.
         *
         * /// @param nFrames the number of frames to recognize
         * /// @return the current result or null if there is no Result (due to the lack of frames to recognize)
         */
        public override Result Recognize(int nFrames)
        {
            bool   done   = false;
            Result result = null;

            StreamEnd = false;

            for (int i = 0; i < nFrames && !done; i++)
            {
                done = Recognize();
            }

            // generate a new temporary result if the current token is based on a final search state
            // remark: the first check for not null is necessary in cases that the search space does not contain scoreable tokens.
            if (ActiveList.GetBestToken() != null)
            {
                // to make the current result as correct as possible we undo the last search graph expansion here
                ActiveList fixedList = UndoLastGrowStep();

                // Now create the result using the fixed active-list.
                if (!StreamEnd)
                {
                    result = new Result(fixedList, ResultList, CurrentFrameNumber, done, false);
                }
            }

            if (_showTokenCount)
            {
                ShowTokenCount();
            }

            return(result);
        }
示例#2
0
 /**
  * /// Dumps out debugging info for the given active list
  *
  * /// @param al the active list to dump
  */
 private void DumpList(ActiveList al)
 {
     this.LogInfo("Size: " + al.Size + " Best token: " + al.GetBestToken());
 }